@anker-in/headless-ui 1.3.28 → 1.3.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/CONTRIBUTING.md +2 -2
- package/dist/cjs/biz-components/AccordionCards/index.d.ts +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.js.map +2 -2
- package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
- package/dist/cjs/biz-components/Category/index.d.ts +1 -1
- package/dist/cjs/biz-components/CreativeModule/index.d.ts +1 -1
- package/dist/cjs/biz-components/DownLoad/index.d.ts +1 -1
- package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.d.ts +1 -1
- package/dist/cjs/biz-components/Faq/Faq.d.ts +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +1 -1
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +1 -1
- package/dist/cjs/biz-components/FeaturedBlogPosts/index.d.ts +1 -1
- package/dist/cjs/biz-components/Features/index.d.ts +1 -1
- package/dist/cjs/biz-components/FootCharger/index.d.ts +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/GiftBox/index.d.ts +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/Graphic/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -1
- package/dist/cjs/biz-components/ImageTextOverlay/index.d.ts +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +1 -1
- package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -1
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +1 -1
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaEndorsement/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +1 -1
- package/dist/cjs/biz-components/ModalCoupon/index.d.ts +45 -0
- package/dist/cjs/biz-components/ModalCoupon/index.js +2 -0
- package/dist/cjs/biz-components/ModalCoupon/index.js.map +7 -0
- package/dist/cjs/biz-components/ModalRegisterSubscribe/index.d.ts +33 -0
- package/dist/cjs/biz-components/ModalRegisterSubscribe/index.js +2 -0
- package/dist/cjs/biz-components/ModalRegisterSubscribe/index.js.map +7 -0
- package/dist/cjs/biz-components/ModalSmsSubscribe/index.d.ts +35 -0
- package/dist/cjs/biz-components/ModalSmsSubscribe/index.js +2 -0
- package/dist/cjs/biz-components/ModalSmsSubscribe/index.js.map +7 -0
- package/dist/cjs/biz-components/ModalSubscribeConfirm/index.d.ts +20 -0
- package/dist/cjs/biz-components/ModalSubscribeConfirm/index.js +2 -0
- package/dist/cjs/biz-components/ModalSubscribeConfirm/index.js.map +7 -0
- package/dist/cjs/biz-components/ModalVerify/index.d.ts +33 -0
- package/dist/cjs/biz-components/ModalVerify/index.js +2 -0
- package/dist/cjs/biz-components/ModalVerify/index.js.map +7 -0
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.d.ts +6 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js.map +3 -3
- package/dist/cjs/biz-components/SceneShelf/Scene.d.ts +2 -0
- package/dist/cjs/biz-components/SceneShelf/Scene.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/Scene.js.map +3 -3
- package/dist/cjs/biz-components/SceneShelf/context.d.ts +3 -0
- package/dist/cjs/biz-components/SceneShelf/context.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/context.js.map +2 -2
- package/dist/cjs/biz-components/SceneShelf/types.d.ts +1 -1
- package/dist/cjs/biz-components/SceneShelf/types.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/types.js.map +1 -1
- package/dist/cjs/biz-components/SceneShelfV2/index.d.ts +1 -1
- package/dist/cjs/biz-components/SceneShelfV3/index.d.ts +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +1 -1
- package/dist/cjs/biz-components/SelectStore/index.d.ts +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +1 -1
- package/dist/cjs/biz-components/Slogan/index.d.ts +1 -1
- package/dist/cjs/biz-components/Spacer/index.d.ts +1 -1
- package/dist/cjs/biz-components/Specs/index.d.ts +1 -1
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -1
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.d.ts +1 -1
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +1 -1
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -1
- package/dist/cjs/biz-components/Title/index.d.ts +1 -1
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +1 -1
- package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +1 -1
- package/dist/cjs/biz-components/index.d.ts +9 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/index.d.ts +11 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/biz-components/AccordionCards/index.d.ts +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
- package/dist/esm/biz-components/ActivitySchedule/index.d.ts +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/AplusDesc/index.d.ts +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
- package/dist/esm/biz-components/Category/index.d.ts +1 -1
- package/dist/esm/biz-components/CreativeModule/index.d.ts +1 -1
- package/dist/esm/biz-components/DownLoad/index.d.ts +1 -1
- package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/esm/biz-components/EventSchedule/index.d.ts +1 -1
- package/dist/esm/biz-components/Faq/Faq.d.ts +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +1 -1
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +1 -1
- package/dist/esm/biz-components/FeaturedBlogPosts/index.d.ts +1 -1
- package/dist/esm/biz-components/Features/index.d.ts +1 -1
- package/dist/esm/biz-components/FootCharger/index.d.ts +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/GiftBox/index.d.ts +1 -1
- package/dist/esm/biz-components/GiftShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/GiftTierShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/Graphic/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +1 -1
- package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -1
- package/dist/esm/biz-components/ImageTextOverlay/index.d.ts +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +1 -1
- package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -1
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +1 -1
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaEndorsement/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +1 -1
- package/dist/esm/biz-components/MemberEquity/index.d.ts +1 -1
- package/dist/esm/biz-components/ModalCoupon/index.d.ts +45 -0
- package/dist/esm/biz-components/ModalCoupon/index.js +2 -0
- package/dist/esm/biz-components/ModalCoupon/index.js.map +7 -0
- package/dist/esm/biz-components/ModalRegisterSubscribe/index.d.ts +33 -0
- package/dist/esm/biz-components/ModalRegisterSubscribe/index.js +2 -0
- package/dist/esm/biz-components/ModalRegisterSubscribe/index.js.map +7 -0
- package/dist/esm/biz-components/ModalSmsSubscribe/index.d.ts +35 -0
- package/dist/esm/biz-components/ModalSmsSubscribe/index.js +2 -0
- package/dist/esm/biz-components/ModalSmsSubscribe/index.js.map +7 -0
- package/dist/esm/biz-components/ModalSubscribeConfirm/index.d.ts +20 -0
- package/dist/esm/biz-components/ModalSubscribeConfirm/index.js +2 -0
- package/dist/esm/biz-components/ModalSubscribeConfirm/index.js.map +7 -0
- package/dist/esm/biz-components/ModalVerify/index.d.ts +33 -0
- package/dist/esm/biz-components/ModalVerify/index.js +2 -0
- package/dist/esm/biz-components/ModalVerify/index.js.map +7 -0
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.d.ts +6 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js.map +3 -3
- package/dist/esm/biz-components/SceneShelf/Scene.d.ts +2 -0
- package/dist/esm/biz-components/SceneShelf/Scene.js +1 -1
- package/dist/esm/biz-components/SceneShelf/Scene.js.map +3 -3
- package/dist/esm/biz-components/SceneShelf/context.d.ts +3 -0
- package/dist/esm/biz-components/SceneShelf/context.js.map +2 -2
- package/dist/esm/biz-components/SceneShelf/types.d.ts +1 -1
- package/dist/esm/biz-components/SceneShelfV2/index.d.ts +1 -1
- package/dist/esm/biz-components/SceneShelfV3/index.d.ts +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +1 -1
- package/dist/esm/biz-components/SelectStore/index.d.ts +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +1 -1
- package/dist/esm/biz-components/Slogan/index.d.ts +1 -1
- package/dist/esm/biz-components/Spacer/index.d.ts +1 -1
- package/dist/esm/biz-components/Specs/index.d.ts +1 -1
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -1
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.d.ts +1 -1
- package/dist/esm/biz-components/TabsGroup/index.d.ts +1 -1
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -1
- package/dist/esm/biz-components/Title/index.d.ts +1 -1
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +1 -1
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +1 -1
- package/dist/esm/biz-components/index.d.ts +9 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/package.json +1 -1
- package/style.css +169 -0
- package/dist/cjs/types/index.d.ts +0 -0
- package/dist/cjs/types/index.js +0 -2
- package/dist/cjs/types/index.js.map +0 -7
- package/dist/esm/types/index.d.ts +0 -0
- package/dist/esm/types/index.js +0 -2
- package/dist/esm/types/index.js.map +0 -7
|
@@ -54,7 +54,7 @@ export interface MediaSceneSwitcherV2Props extends React.HTMLAttributes<HTMLDivE
|
|
|
54
54
|
/** 场景切换回调 */
|
|
55
55
|
onSceneChange?: (index: number, scene: MediaSceneSwitcherV2Item) => void;
|
|
56
56
|
}
|
|
57
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<MediaSceneSwitcherV2Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
57
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<MediaSceneSwitcherV2Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
58
58
|
readonly $$typeof: symbol;
|
|
59
59
|
};
|
|
60
60
|
export default _default;
|
|
@@ -118,7 +118,7 @@ export interface MediaShelfComponent extends React.ForwardRefExoticComponent<Med
|
|
|
118
118
|
/** 独立的 ProductCard 组件 */
|
|
119
119
|
ProductCard: typeof ProductCard;
|
|
120
120
|
}
|
|
121
|
-
declare const MediaShelfWrapped: React.ForwardRefExoticComponent<Omit<MediaShelfProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
121
|
+
declare const MediaShelfWrapped: React.ForwardRefExoticComponent<Omit<MediaShelfProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
122
122
|
readonly $$typeof: symbol;
|
|
123
123
|
ProductCard: typeof ProductCard;
|
|
124
124
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { MediaTextOverlayProps } from './types.js';
|
|
3
3
|
import 'swiper/css';
|
|
4
4
|
import 'swiper/css/navigation';
|
|
5
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<MediaTextOverlayProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<MediaTextOverlayProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
6
6
|
readonly $$typeof: symbol;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MemberEquityProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<MemberEquityProps, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<MemberEquityProps, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {};
|
|
4
4
|
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface CouponItem {
|
|
2
|
+
id: string;
|
|
3
|
+
discountLabel: string;
|
|
4
|
+
offLabel: string;
|
|
5
|
+
code: string;
|
|
6
|
+
conditions: string[];
|
|
7
|
+
onCopy?: (code: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface FooterNoteItem {
|
|
10
|
+
id: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ModalCouponProps {
|
|
14
|
+
/** 控制弹窗打开状态 */
|
|
15
|
+
open: boolean;
|
|
16
|
+
/** 弹窗状态改变时的回调 */
|
|
17
|
+
onOpenChange: (open: boolean) => void;
|
|
18
|
+
/** 弹窗标题 */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** 描述 */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** 优惠券列表数据 */
|
|
23
|
+
coupons?: CouponItem[];
|
|
24
|
+
/** 底部注释文案列表 */
|
|
25
|
+
footerNotes?: FooterNoteItem[];
|
|
26
|
+
/** 主按钮文案 */
|
|
27
|
+
primaryLabel?: string;
|
|
28
|
+
/** 主按钮跳转 URL */
|
|
29
|
+
primaryUrl?: string;
|
|
30
|
+
/** 次按钮文案 */
|
|
31
|
+
secondaryLabel?: string;
|
|
32
|
+
/** 次按钮跳转 URL */
|
|
33
|
+
secondaryUrl?: string;
|
|
34
|
+
/** 主按钮点击回调 */
|
|
35
|
+
onPrimary?: () => void;
|
|
36
|
+
/** 次按钮点击回调 */
|
|
37
|
+
onSecondary?: () => void;
|
|
38
|
+
}
|
|
39
|
+
declare const ModalCoupon: {
|
|
40
|
+
({ open, onOpenChange, title, description, copy, coupons, footerNotes, primaryLabel, primaryUrl, secondaryLabel, secondaryUrl, onPrimary, onSecondary, }: ModalCouponProps & {
|
|
41
|
+
copy?: Record<string, any>;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
export default ModalCoupon;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{Fragment as w,jsx as t,jsxs as e}from"react/jsx-runtime";import"react";import{Dialog as b,DialogContent as Z,Button as C,Heading as f,Text as n,Link as c}from"../../components/index.js";const v=({className:a})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"358",height:"110",viewBox:"0 0 358 110",fill:"none",className:a,children:[t("mask",{id:"path-1-inside-1_4272_30135",fill:"white",children:t("path",{d:"M111 0C111 3.31371 113.686 6 117 6C120.314 6 123 3.31371 123 0H352C355.314 0 358 2.68629 358 6V104C358 107.314 355.314 110 352 110H123C123 106.686 120.314 104 117 104C113.686 104 111 106.686 111 110H6C2.68629 110 8.05346e-09 107.314 0 104V6C4.50994e-07 2.68629 2.68629 1.75157e-07 6 0H111Z"})}),t("path",{d:"M111 0C111 3.31371 113.686 6 117 6C120.314 6 123 3.31371 123 0H352C355.314 0 358 2.68629 358 6V104C358 107.314 355.314 110 352 110H123C123 106.686 120.314 104 117 104C113.686 104 111 106.686 111 110H6C2.68629 110 8.05346e-09 107.314 0 104V6C4.50994e-07 2.68629 2.68629 1.75157e-07 6 0H111Z",fill:"url(#paint0_linear_4272_30135)"}),t("path",{d:"M111 0H112V-1H111V0ZM123 0V-1H122V0H123ZM358 6H359H358ZM358 104H359V104H358ZM352 110V111V111V110ZM123 110H122V111H123V110ZM111 110V111H112V110H111ZM0 104H-1H0ZM0 6H-1V6H0ZM6 0V-1V-1V0ZM111 0H110C110 3.86599 113.134 7 117 7V6V5C114.239 5 112 2.76142 112 0H111ZM117 6V7C120.866 7 124 3.86599 124 0H123H122C122 2.76142 119.761 5 117 5V6ZM123 0V1H352V0V-1H123V0ZM352 0V1C354.761 1 357 3.23858 357 6H358H359C359 2.13401 355.866 -1 352 -1V0ZM358 6H357V104H358H359V6H358ZM358 104H357C357 106.761 354.761 109 352 109V110V111C355.866 111 359 107.866 359 104H358ZM352 110V109H123V110V111H352V110ZM123 110H124C124 106.134 120.866 103 117 103V104V105C119.761 105 122 107.239 122 110H123ZM117 104V103C113.134 103 110 106.134 110 110H111H112C112 107.239 114.239 105 117 105V104ZM111 110V109H6V110V111H111V110ZM6 110V109C3.23858 109 1 106.761 1 104H0H-1C-1 107.866 2.13401 111 6 111V110ZM0 104H1V6H0H-1V104H0ZM0 6H1C1 3.23858 3.23858 1 6 1V0V-1C2.13401 -1 -0.999999 2.13401 -1 6H0ZM6 0V1H111V0V-1H6V0Z",fill:"url(#paint1_linear_4272_30135)",mask:"url(#path-1-inside-1_4272_30135)"}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_4272_30135",x1:"248",y1:"114",x2:"248",y2:"-12",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#FFE8D6"}),t("stop",{offset:"1",stopColor:"#FCF8F5"})]}),e("linearGradient",{id:"paint1_linear_4272_30135",x1:"248",y1:"-12",x2:"248",y2:"114",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#F6ECE4"}),t("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]}),N=({className:a})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"496",height:"126",viewBox:"0 0 496 126",fill:"none",className:a,children:[t("mask",{id:"path-1-inside-1_4208_2828",fill:"white",children:t("path",{d:"M185 0C185 4.41828 188.582 8 193 8C197.418 8 201 4.41828 201 0H488C492.418 0 496 3.58172 496 8V118C496 122.418 492.418 126 488 126H201C201 121.582 197.418 118 193 118C188.582 118 185 121.582 185 126H8C3.58172 126 2.49657e-07 122.418 0 118V8C0 3.58172 3.58172 0 8 0H185Z"})}),t("path",{d:"M185 0C185 4.41828 188.582 8 193 8C197.418 8 201 4.41828 201 0H488C492.418 0 496 3.58172 496 8V118C496 122.418 492.418 126 488 126H201C201 121.582 197.418 118 193 118C188.582 118 185 121.582 185 126H8C3.58172 126 2.49657e-07 122.418 0 118V8C0 3.58172 3.58172 0 8 0H185Z",fill:"url(#paint0_linear_4208_2828)"}),t("path",{d:"M185 0H186V-1H185V0ZM201 0V-1H200V0H201ZM496 8H497V8H496ZM201 126H200V127H201V126ZM185 126V127H186V126H185ZM0 118H-1V118H0ZM185 0H184C184 4.97056 188.029 9 193 9V8V7C189.134 7 186 3.86599 186 0H185ZM193 8V9C197.971 9 202 4.97056 202 0H201H200C200 3.86599 196.866 7 193 7V8ZM201 0V1H488V0V-1H201V0ZM488 0V1C491.866 1 495 4.13401 495 8H496H497C497 3.02944 492.971 -1 488 -1V0ZM496 8H495V118H496H497V8H496ZM496 118H495C495 121.866 491.866 125 488 125V126V127C492.971 127 497 122.971 497 118H496ZM488 126V125H201V126V127H488V126ZM201 126H202C202 121.029 197.971 117 193 117V118V119C196.866 119 200 122.134 200 126H201ZM193 118V117C188.029 117 184 121.029 184 126H185H186C186 122.134 189.134 119 193 119V118ZM185 126V125H8V126V127H185V126ZM8 126V125C4.13401 125 1 121.866 1 118H0H-1C-1 122.971 3.02944 127 8 127V126ZM0 118H1V8H0H-1V118H0ZM0 8H1C1 4.13401 4.13401 1 8 1V0V-1C3.02944 -1 -1 3.02944 -1 8H0ZM8 0V1H185V0V-1H8V0Z",fill:"url(#paint1_linear_4208_2828)",mask:"url(#path-1-inside-1_4208_2828)"}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_4208_2828",x1:"248",y1:"126",x2:"248",y2:"0",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#FFE8D6"}),t("stop",{offset:"1",stopColor:"#FCF8F5"})]}),e("linearGradient",{id:"paint1_linear_4208_2828",x1:"248",y1:"0",x2:"248",y2:"126",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#F6ECE4"}),t("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]}),_=({className:a})=>e(w,{children:[t(v,{className:`tablet:hidden ${a}`}),t(N,{className:`tablet:block hidden ${a}`})]}),y=({coupon:a})=>e("div",{className:"modal-coupon-card border-lines-default rounded-box-small tablet:h-[126px] relative h-[110px] w-full shrink-0 overflow-hidden",children:[t(_,{className:"absolute inset-0"}),e("div",{className:"absolute inset-0 z-10 flex items-center",children:[t("div",{className:"modal-coupon-card-discount tablet:w-[185px] mx-4 flex w-[85px] shrink-0 items-center justify-center",children:e(f,{as:"h4",className:"modal-coupon-card-amount font-bold leading-none tracking-[-0.04em] text-[#FF5900]",children:[t("span",{className:"tablet:text-[64px] text-[40px]",children:a.discountLabel}),e("span",{className:"tablet:text-2xl text-[20px]",children:[" ",a.offLabel]})]})}),e("div",{className:"modal-coupon-card-info flex min-w-0 flex-1 flex-col gap-[4px] p-4",children:[e("div",{className:"flex items-center gap-[4px] whitespace-nowrap",children:[t(n,{as:"span",size:3,html:`Code: ${a.code}`,className:"modal-coupon-card-code text-info-primary truncate text-[12px]"}),t(c,{onClick:()=>a.onCopy?.(a.code),className:"modal-coupon-card-copy shrink-0 text-[12px] text-[#005D8E]",children:"COPY"})]}),t("ul",{className:"flex flex-col gap-0",children:a.conditions.map((o,i)=>t("li",{className:"modal-coupon-card-condition ml-[18px] list-disc",children:t(n,{as:"span",size:3,html:o,className:"text-info-tertiary text-[12px] [&_a]:underline"})},i))})]})]})]}),u=({open:a,onOpenChange:o,title:i,description:x,copy:g,coupons:s,footerNotes:d,primaryLabel:p,primaryUrl:H,secondaryLabel:r,secondaryUrl:V,onPrimary:h,onSecondary:M})=>{const m=g?.couponsCountLabel;return t(b,{open:a,onOpenChange:o,children:t(Z,{className:"modal-coupon-root tablet:!top-1/2 tablet:!left-1/2 tablet:!bottom-auto tablet:!right-auto tablet:!-translate-x-1/2 tablet:!-translate-y-1/2 tablet:!rounded-box rounded-t-box tablet:max-w-[580px] !inset-x-0 !bottom-0 !top-auto flex max-h-[90vh] w-full !translate-x-0 !translate-y-0 flex-col !gap-0 overflow-hidden rounded-b-none !border-none bg-white !p-0",children:e("div",{className:"modal-coupon-inner flex min-h-0 w-full flex-col bg-white",children:[e("div",{className:"modal-coupon-body tablet:p-8 flex shrink-0 flex-col gap-6 px-4 pb-2 pt-4",children:[e("div",{children:[i&&t(f,{as:"h2",size:2,html:i,className:"modal-coupon-title text-info-primary tablet:text-[24px] text-[20px]"}),x&&t(n,{as:"p",size:4,html:x,className:"modal-coupon-description tablet:text-[18px] mt-2 text-[14px] font-[700] [&_a]:underline"})]}),m&&t("div",{className:"flex flex-col gap-2",children:t(n,{as:"p",size:3,html:m.replace("${count}",String(s?.length??0)),className:"modal-coupon-count text-info-tertiary font-[700] [&_a]:underline"})})]}),s&&s.length>0&&t("div",{className:"modal-coupon-list tablet:px-8 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4",children:s.map(l=>t(y,{coupon:l},l.id))}),e("div",{className:"modal-coupon-footer border-lines-default tablet:p-8 flex shrink-0 flex-col gap-4 border-t p-6",children:[d&&d.length>0&&t("div",{className:"flex flex-col gap-1",children:d.map(l=>t(n,{as:"p",size:3,html:l.text,className:"modal-coupon-footer-note text-info-tertiary tablet:text-[16px] text-[14px] font-[700] [&_a]:underline"},l.id))}),(p||r)&&e("div",{className:"flex flex-col items-center gap-4",children:[p&&(H?t(C,{as:"a",href:H,className:"modal-coupon-primary-btn tablet:text-[16px] w-full text-[14px]",children:p}):t(C,{onClick:()=>{h?.(),o(!1)},className:"modal-coupon-primary-btn tablet:text-[16px] w-full text-[14px]",children:p})),r&&(V?t(c,{href:V,className:"modal-coupon-secondary-btn text-info-primary tablet:text-[16px] text-[14px]",children:r}):t(c,{onClick:()=>{M?.(),o(!1)},className:"modal-coupon-secondary-btn text-info-primary tablet:text-[16px] text-[14px]",children:r}))]})]})]})})})};u.displayName="ModalCoupon";var B=u;export{B as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ModalCoupon/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Dialog, DialogContent, Button, Heading, Text, Link } from '../../components/index.js'\n\nexport interface CouponItem {\n id: string\n discountLabel: string\n offLabel: string\n code: string\n conditions: string[]\n onCopy?: (code: string) => void\n}\n\nexport interface FooterNoteItem {\n id: string\n text: string\n}\n\nexport interface ModalCouponProps {\n /** \u63A7\u5236\u5F39\u7A97\u6253\u5F00\u72B6\u6001 */\n open: boolean\n /** \u5F39\u7A97\u72B6\u6001\u6539\u53D8\u65F6\u7684\u56DE\u8C03 */\n onOpenChange: (open: boolean) => void\n /** \u5F39\u7A97\u6807\u9898 */\n title?: string\n /** \u63CF\u8FF0 */\n description?: string\n /** \u4F18\u60E0\u5238\u5217\u8868\u6570\u636E */\n coupons?: CouponItem[]\n /** \u5E95\u90E8\u6CE8\u91CA\u6587\u6848\u5217\u8868 */\n footerNotes?: FooterNoteItem[]\n /** \u4E3B\u6309\u94AE\u6587\u6848 */\n primaryLabel?: string\n /** \u4E3B\u6309\u94AE\u8DF3\u8F6C URL */\n primaryUrl?: string\n /** \u6B21\u6309\u94AE\u6587\u6848 */\n secondaryLabel?: string\n /** \u6B21\u6309\u94AE\u8DF3\u8F6C URL */\n secondaryUrl?: string\n /** \u4E3B\u6309\u94AE\u70B9\u51FB\u56DE\u8C03 */\n onPrimary?: () => void\n /** \u6B21\u6309\u94AE\u70B9\u51FB\u56DE\u8C03 */\n onSecondary?: () => void\n}\n\nconst CouponCardBgMobile = ({ className }: { className: string }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"358\"\n height=\"110\"\n viewBox=\"0 0 358 110\"\n fill=\"none\"\n className={className}\n >\n <mask id=\"path-1-inside-1_4272_30135\" fill=\"white\">\n <path d=\"M111 0C111 3.31371 113.686 6 117 6C120.314 6 123 3.31371 123 0H352C355.314 0 358 2.68629 358 6V104C358 107.314 355.314 110 352 110H123C123 106.686 120.314 104 117 104C113.686 104 111 106.686 111 110H6C2.68629 110 8.05346e-09 107.314 0 104V6C4.50994e-07 2.68629 2.68629 1.75157e-07 6 0H111Z\" />\n </mask>\n <path\n d=\"M111 0C111 3.31371 113.686 6 117 6C120.314 6 123 3.31371 123 0H352C355.314 0 358 2.68629 358 6V104C358 107.314 355.314 110 352 110H123C123 106.686 120.314 104 117 104C113.686 104 111 106.686 111 110H6C2.68629 110 8.05346e-09 107.314 0 104V6C4.50994e-07 2.68629 2.68629 1.75157e-07 6 0H111Z\"\n fill=\"url(#paint0_linear_4272_30135)\"\n />\n <path\n d=\"M111 0H112V-1H111V0ZM123 0V-1H122V0H123ZM358 6H359H358ZM358 104H359V104H358ZM352 110V111V111V110ZM123 110H122V111H123V110ZM111 110V111H112V110H111ZM0 104H-1H0ZM0 6H-1V6H0ZM6 0V-1V-1V0ZM111 0H110C110 3.86599 113.134 7 117 7V6V5C114.239 5 112 2.76142 112 0H111ZM117 6V7C120.866 7 124 3.86599 124 0H123H122C122 2.76142 119.761 5 117 5V6ZM123 0V1H352V0V-1H123V0ZM352 0V1C354.761 1 357 3.23858 357 6H358H359C359 2.13401 355.866 -1 352 -1V0ZM358 6H357V104H358H359V6H358ZM358 104H357C357 106.761 354.761 109 352 109V110V111C355.866 111 359 107.866 359 104H358ZM352 110V109H123V110V111H352V110ZM123 110H124C124 106.134 120.866 103 117 103V104V105C119.761 105 122 107.239 122 110H123ZM117 104V103C113.134 103 110 106.134 110 110H111H112C112 107.239 114.239 105 117 105V104ZM111 110V109H6V110V111H111V110ZM6 110V109C3.23858 109 1 106.761 1 104H0H-1C-1 107.866 2.13401 111 6 111V110ZM0 104H1V6H0H-1V104H0ZM0 6H1C1 3.23858 3.23858 1 6 1V0V-1C2.13401 -1 -0.999999 2.13401 -1 6H0ZM6 0V1H111V0V-1H6V0Z\"\n fill=\"url(#paint1_linear_4272_30135)\"\n mask=\"url(#path-1-inside-1_4272_30135)\"\n />\n <defs>\n <linearGradient id=\"paint0_linear_4272_30135\" x1=\"248\" y1=\"114\" x2=\"248\" y2=\"-12\" gradientUnits=\"userSpaceOnUse\">\n <stop stopColor=\"#FFE8D6\" />\n <stop offset=\"1\" stopColor=\"#FCF8F5\" />\n </linearGradient>\n <linearGradient id=\"paint1_linear_4272_30135\" x1=\"248\" y1=\"-12\" x2=\"248\" y2=\"114\" gradientUnits=\"userSpaceOnUse\">\n <stop stopColor=\"#F6ECE4\" />\n <stop offset=\"1\" stopColor=\"white\" stopOpacity=\"0\" />\n </linearGradient>\n </defs>\n </svg>\n)\n\nconst CouponCardBgTablet = ({ className }: { className: string }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"496\"\n height=\"126\"\n viewBox=\"0 0 496 126\"\n fill=\"none\"\n className={className}\n >\n <mask id=\"path-1-inside-1_4208_2828\" fill=\"white\">\n <path d=\"M185 0C185 4.41828 188.582 8 193 8C197.418 8 201 4.41828 201 0H488C492.418 0 496 3.58172 496 8V118C496 122.418 492.418 126 488 126H201C201 121.582 197.418 118 193 118C188.582 118 185 121.582 185 126H8C3.58172 126 2.49657e-07 122.418 0 118V8C0 3.58172 3.58172 0 8 0H185Z\" />\n </mask>\n <path\n d=\"M185 0C185 4.41828 188.582 8 193 8C197.418 8 201 4.41828 201 0H488C492.418 0 496 3.58172 496 8V118C496 122.418 492.418 126 488 126H201C201 121.582 197.418 118 193 118C188.582 118 185 121.582 185 126H8C3.58172 126 2.49657e-07 122.418 0 118V8C0 3.58172 3.58172 0 8 0H185Z\"\n fill=\"url(#paint0_linear_4208_2828)\"\n />\n <path\n d=\"M185 0H186V-1H185V0ZM201 0V-1H200V0H201ZM496 8H497V8H496ZM201 126H200V127H201V126ZM185 126V127H186V126H185ZM0 118H-1V118H0ZM185 0H184C184 4.97056 188.029 9 193 9V8V7C189.134 7 186 3.86599 186 0H185ZM193 8V9C197.971 9 202 4.97056 202 0H201H200C200 3.86599 196.866 7 193 7V8ZM201 0V1H488V0V-1H201V0ZM488 0V1C491.866 1 495 4.13401 495 8H496H497C497 3.02944 492.971 -1 488 -1V0ZM496 8H495V118H496H497V8H496ZM496 118H495C495 121.866 491.866 125 488 125V126V127C492.971 127 497 122.971 497 118H496ZM488 126V125H201V126V127H488V126ZM201 126H202C202 121.029 197.971 117 193 117V118V119C196.866 119 200 122.134 200 126H201ZM193 118V117C188.029 117 184 121.029 184 126H185H186C186 122.134 189.134 119 193 119V118ZM185 126V125H8V126V127H185V126ZM8 126V125C4.13401 125 1 121.866 1 118H0H-1C-1 122.971 3.02944 127 8 127V126ZM0 118H1V8H0H-1V118H0ZM0 8H1C1 4.13401 4.13401 1 8 1V0V-1C3.02944 -1 -1 3.02944 -1 8H0ZM8 0V1H185V0V-1H8V0Z\"\n fill=\"url(#paint1_linear_4208_2828)\"\n mask=\"url(#path-1-inside-1_4208_2828)\"\n />\n <defs>\n <linearGradient id=\"paint0_linear_4208_2828\" x1=\"248\" y1=\"126\" x2=\"248\" y2=\"0\" gradientUnits=\"userSpaceOnUse\">\n <stop stopColor=\"#FFE8D6\" />\n <stop offset=\"1\" stopColor=\"#FCF8F5\" />\n </linearGradient>\n <linearGradient id=\"paint1_linear_4208_2828\" x1=\"248\" y1=\"0\" x2=\"248\" y2=\"126\" gradientUnits=\"userSpaceOnUse\">\n <stop stopColor=\"#F6ECE4\" />\n <stop offset=\"1\" stopColor=\"white\" stopOpacity=\"0\" />\n </linearGradient>\n </defs>\n </svg>\n)\n\nconst CouponCardBg = ({ className }: { className: string }) => (\n <>\n <CouponCardBgMobile className={`tablet:hidden ${className}`} />\n <CouponCardBgTablet className={`tablet:block hidden ${className}`} />\n </>\n)\n\nconst CouponCard = ({ coupon }: { coupon: CouponItem }) => (\n <div className=\"modal-coupon-card border-lines-default rounded-box-small tablet:h-[126px] relative h-[110px] w-full shrink-0 overflow-hidden\">\n <CouponCardBg className=\"absolute inset-0\" />\n <div className=\"absolute inset-0 z-10 flex items-center\">\n <div className=\"modal-coupon-card-discount tablet:w-[185px] mx-4 flex w-[85px] shrink-0 items-center justify-center\">\n <Heading as=\"h4\" className=\"modal-coupon-card-amount font-bold leading-none tracking-[-0.04em] text-[#FF5900]\">\n <span className=\"tablet:text-[64px] text-[40px]\">{coupon.discountLabel}</span>\n <span className=\"tablet:text-2xl text-[20px]\"> {coupon.offLabel}</span>\n </Heading>\n </div>\n\n <div className=\"modal-coupon-card-info flex min-w-0 flex-1 flex-col gap-[4px] p-4\">\n <div className=\"flex items-center gap-[4px] whitespace-nowrap\">\n <Text\n as=\"span\"\n size={3}\n html={`Code: ${coupon.code}`}\n className=\"modal-coupon-card-code text-info-primary truncate text-[12px]\"\n />\n <Link\n onClick={() => coupon.onCopy?.(coupon.code)}\n className=\"modal-coupon-card-copy shrink-0 text-[12px] text-[#005D8E]\"\n >\n COPY\n </Link>\n </div>\n <ul className=\"flex flex-col gap-0\">\n {coupon.conditions.map((c, i) => (\n <li key={i} className=\"modal-coupon-card-condition ml-[18px] list-disc\">\n <Text as=\"span\" size={3} html={c} className=\"text-info-tertiary text-[12px] [&_a]:underline\" />\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n)\n\nconst ModalCoupon = ({\n open,\n onOpenChange,\n title,\n description,\n copy,\n coupons,\n footerNotes,\n primaryLabel,\n primaryUrl,\n secondaryLabel,\n secondaryUrl,\n onPrimary,\n onSecondary,\n}: ModalCouponProps & { copy?: Record<string, any> }) => {\n const couponsCountLabel = copy?.couponsCountLabel\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"modal-coupon-root tablet:!top-1/2 tablet:!left-1/2 tablet:!bottom-auto tablet:!right-auto tablet:!-translate-x-1/2 tablet:!-translate-y-1/2 tablet:!rounded-box rounded-t-box tablet:max-w-[580px] !inset-x-0 !bottom-0 !top-auto flex max-h-[90vh] w-full !translate-x-0 !translate-y-0 flex-col !gap-0 overflow-hidden rounded-b-none !border-none bg-white !p-0\">\n <div className=\"modal-coupon-inner flex min-h-0 w-full flex-col bg-white\">\n <div className=\"modal-coupon-body tablet:p-8 flex shrink-0 flex-col gap-6 px-4 pb-2 pt-4\">\n <div>\n {title && (\n <Heading\n as=\"h2\"\n size={2}\n html={title}\n className=\"modal-coupon-title text-info-primary tablet:text-[24px] text-[20px]\"\n />\n )}\n {description && (\n <Text\n as=\"p\"\n size={4}\n html={description}\n className=\"modal-coupon-description tablet:text-[18px] mt-2 text-[14px] font-[700] [&_a]:underline\"\n />\n )}\n </div>\n\n {couponsCountLabel && (\n <div className=\"flex flex-col gap-2\">\n <Text\n as=\"p\"\n size={3}\n html={couponsCountLabel.replace('${count}', String(coupons?.length ?? 0))}\n className=\"modal-coupon-count text-info-tertiary font-[700] [&_a]:underline\"\n />\n </div>\n )}\n </div>\n\n {coupons && coupons.length > 0 && (\n <div className=\"modal-coupon-list tablet:px-8 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4\">\n {coupons.map(coupon => (\n <CouponCard key={coupon.id} coupon={coupon} />\n ))}\n </div>\n )}\n\n <div className=\"modal-coupon-footer border-lines-default tablet:p-8 flex shrink-0 flex-col gap-4 border-t p-6\">\n {footerNotes && footerNotes.length > 0 && (\n <div className=\"flex flex-col gap-1\">\n {footerNotes.map(note => (\n <Text\n key={note.id}\n as=\"p\"\n size={3}\n html={note.text}\n className=\"modal-coupon-footer-note text-info-tertiary tablet:text-[16px] text-[14px] font-[700] [&_a]:underline\"\n />\n ))}\n </div>\n )}\n\n {(primaryLabel || secondaryLabel) && (\n <div className=\"flex flex-col items-center gap-4\">\n {primaryLabel &&\n (primaryUrl ? (\n <Button\n as=\"a\"\n href={primaryUrl}\n className=\"modal-coupon-primary-btn tablet:text-[16px] w-full text-[14px]\"\n >\n {primaryLabel}\n </Button>\n ) : (\n <Button\n onClick={() => {\n onPrimary?.()\n onOpenChange(false)\n }}\n className=\"modal-coupon-primary-btn tablet:text-[16px] w-full text-[14px]\"\n >\n {primaryLabel}\n </Button>\n ))}\n {secondaryLabel &&\n (secondaryUrl ? (\n <Link\n href={secondaryUrl}\n className=\"modal-coupon-secondary-btn text-info-primary tablet:text-[16px] text-[14px]\"\n >\n {secondaryLabel}\n </Link>\n ) : (\n <Link\n onClick={() => {\n onSecondary?.()\n onOpenChange(false)\n }}\n className=\"modal-coupon-secondary-btn text-info-primary tablet:text-[16px] text-[14px]\"\n >\n {secondaryLabel}\n </Link>\n ))}\n </div>\n )}\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nModalCoupon.displayName = 'ModalCoupon'\n\nexport default ModalCoupon\n"],
|
|
5
|
+
"mappings": "aAwDM,OA2DJ,YAAAA,EA3DI,OAAAC,EAYA,QAAAC,MAZA,oBAtDN,MAAuB,QACvB,OAAS,UAAAC,EAAQ,iBAAAC,EAAe,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,EAAM,QAAAC,MAAY,4BA2CnE,MAAMC,EAAqB,CAAC,CAAE,UAAAC,CAAU,IACtCR,EAAC,OACC,MAAM,6BACN,MAAM,MACN,OAAO,MACP,QAAQ,cACR,KAAK,OACL,UAAWQ,EAEX,UAAAT,EAAC,QAAK,GAAG,6BAA6B,KAAK,QACzC,SAAAA,EAAC,QAAK,EAAE,oSAAoS,EAC9S,EACAA,EAAC,QACC,EAAE,oSACF,KAAK,iCACP,EACAA,EAAC,QACC,EAAE,69BACF,KAAK,iCACL,KAAK,mCACP,EACAC,EAAC,QACC,UAAAA,EAAC,kBAAe,GAAG,2BAA2B,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,cAAc,iBAC9F,UAAAD,EAAC,QAAK,UAAU,UAAU,EAC1BA,EAAC,QAAK,OAAO,IAAI,UAAU,UAAU,GACvC,EACAC,EAAC,kBAAe,GAAG,2BAA2B,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,cAAc,iBAC9F,UAAAD,EAAC,QAAK,UAAU,UAAU,EAC1BA,EAAC,QAAK,OAAO,IAAI,UAAU,QAAQ,YAAY,IAAI,GACrD,GACF,GACF,EAGIU,EAAqB,CAAC,CAAE,UAAAD,CAAU,IACtCR,EAAC,OACC,MAAM,6BACN,MAAM,MACN,OAAO,MACP,QAAQ,cACR,KAAK,OACL,UAAWQ,EAEX,UAAAT,EAAC,QAAK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AAqB,GAAeA,EAAY,OAAS,GACnCtB,EAAC,OAAI,UAAU,sBACZ,SAAAsB,EAAY,IAAIQ,GACf9B,EAACM,EAAA,CAEC,GAAG,IACH,KAAM,EACN,KAAMwB,EAAK,KACX,UAAU,yGAJLA,EAAK,EAKZ,CACD,EACH,GAGAP,GAAgBE,IAChBxB,EAAC,OAAI,UAAU,mCACZ,UAAAsB,IACEC,EACCxB,EAACI,EAAA,CACC,GAAG,IACH,KAAMoB,EACN,UAAU,iEAET,SAAAD,EACH,EAEAvB,EAACI,EAAA,CACC,QAAS,IAAM,CACbuB,IAAY,EACZV,EAAa,EAAK,CACpB,EACA,UAAU,iEAET,SAAAM,EACH,GAEHE,IACEC,EACC1B,EAACO,EAAA,CACC,KAAMmB,EACN,UAAU,8EAET,SAAAD,EACH,EAEAzB,EAACO,EAAA,CACC,QAAS,IAAM,CACbqB,IAAc,EACdX,EAAa,EAAK,CACpB,EACA,UAAU,8EAET,SAAAQ,EACH,IAEN,GAEJ,GACF,EACF,EACF,CAEJ,EAEAV,EAAY,YAAc,cAE1B,IAAOgB,EAAQhB",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Dialog", "DialogContent", "Button", "Heading", "Text", "Link", "CouponCardBgMobile", "className", "CouponCardBgTablet", "CouponCardBg", "CouponCard", "coupon", "c", "ModalCoupon", "open", "onOpenChange", "title", "description", "copy", "coupons", "footerNotes", "primaryLabel", "primaryUrl", "secondaryLabel", "secondaryUrl", "onPrimary", "onSecondary", "couponsCountLabel", "note", "ModalCoupon_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface HeroImage {
|
|
2
|
+
url: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface BenefitItem {
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
export type SocialLoginType = 'google' | 'apple' | 'facebook';
|
|
9
|
+
export interface ModalRegisterSubscribeProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
heroImage?: HeroImage;
|
|
13
|
+
heroTitle?: string;
|
|
14
|
+
rightsDetailsLabel?: string;
|
|
15
|
+
onRightsDetails?: () => void;
|
|
16
|
+
benefitsSectionLabel?: string;
|
|
17
|
+
benefits?: BenefitItem[];
|
|
18
|
+
formTitle?: string;
|
|
19
|
+
termsDefaultChecked?: boolean;
|
|
20
|
+
newsletterDefaultChecked?: boolean;
|
|
21
|
+
registerLabel?: string;
|
|
22
|
+
passwordLoginLabel?: string;
|
|
23
|
+
socialLogins?: SocialLoginType[];
|
|
24
|
+
onRegister?: (email: string, termsAccepted: boolean, newsletterAccepted: boolean) => void;
|
|
25
|
+
onPasswordLogin?: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare const ModalRegisterSubscribe: {
|
|
28
|
+
({ open, onOpenChange, heroImage, heroTitle, rightsDetailsLabel, onRightsDetails, benefitsSectionLabel, benefits, formTitle, copy, termsDefaultChecked, newsletterDefaultChecked, registerLabel, passwordLoginLabel, socialLogins, onRegister, onPasswordLogin, }: ModalRegisterSubscribeProps & {
|
|
29
|
+
copy?: Record<string, any>;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
export default ModalRegisterSubscribe;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{Fragment as re,jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Dialog as M,DialogContent as _,Button as X,Input as Y,Checkbox as I,Heading as w,Text as s,Picture as T,Link as B}from"../../components/index.js";const F=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ee=()=>e("svg",{width:"1",height:"16",viewBox:"0 0 1 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"0.5",y1:"0",x2:"0.5",y2:"16",stroke:"#DADCE0"})}),te=()=>t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),e("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),le=()=>e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:e("path",{fill:"currentColor",d:"M16.365 12.408c.023 2.468 2.161 3.29 2.185 3.301-.018.058-.341 1.17-1.122 2.32-.675.993-1.375 1.982-2.478 2.002-1.084.02-1.433-.644-2.674-.644-1.24 0-1.629.624-2.654.664-1.067.04-1.88-1.07-2.56-2.059-1.39-2.01-2.452-5.68-1.027-8.155.707-1.23 1.973-2.01 3.347-2.03 1.045-.02 2.032.704 2.674.704.641 0 1.846-.87 3.112-.742.53.022 2.018.214 2.974 1.613-.077.048-1.776 1.035-1.757 3.026ZM14.972 4.858c.566-.686.947-1.64.843-2.59-.815.033-1.8.543-2.384 1.229-.525.606-.986 1.576-.862 2.507.908.07 1.838-.462 2.403-1.146Z"})}),se=()=>e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z",fill:"#1877F2"})}),ae={google:{label:"Google",icon:e(te,{})},apple:{label:"Apple",icon:e(le,{})},facebook:{label:"Facebook",icon:e(se,{})}},ie=({open:p,onOpenChange:x,title:a,benefits:i})=>e(M,{open:p,onOpenChange:x,children:e(_,{className:"modal-rights-details-root tablet:max-w-[358px] !z-[1002] flex max-h-[80vh] w-full max-w-[calc(100vw_-_32px)] flex-col !gap-0 overflow-hidden rounded-[12px] !border-none bg-white !p-0 drop-shadow-[0px_2px_4px_rgba(0,0,0,0.12)]",overlayClassName:"!z-[1002] bg-black/60",children:t("div",{className:"rounded-[8px] px-[16px] pb-[24px] pt-[16px] backdrop-blur-sm",children:[a&&e(s,{as:"p",size:3,html:a,className:"text-info-primary mb-2"}),i&&i.length>0&&e("ul",{className:"flex flex-col gap-[4px]",children:i.map((n,g)=>e("li",{className:"ml-[21px] list-disc",children:e(s,{as:"span",size:3,html:n,className:"text-info-tertiary"})},g))})]})})}),H=({open:p,onOpenChange:x,heroImage:a,heroTitle:i,rightsDetailsLabel:n,onRightsDetails:g,benefitsSectionLabel:f,benefits:c,formTitle:N,copy:r,termsDefaultChecked:O,newsletterDefaultChecked:P,registerLabel:k,passwordLoginLabel:C,socialLogins:j,onRegister:G,onPasswordLogin:V})=>{const y=r?.emailLabel,q=r?.emailPlaceholder,Z=r?.emailEmptyErrorLabel,W=r?.emailInvalidErrorLabel,m=r?.termsLabel,z=r?.termsRequiredErrorLabel,L=r?.newsletterLabel,[E,$]=o.useState(""),[R,d]=o.useState(""),[b,J]=o.useState(!!O),[S,K]=o.useState(!!P),[Q,h]=o.useState(!1),[U,A]=o.useState(!1),u=j?.map(l=>({id:l,...ae[l]})),D=t("div",{className:"modal-register-subscribe-form tablet:p-8 tablet:pt-12 flex h-full flex-col justify-between gap-6 p-6 pt-8",children:[t("div",{className:"tablet:gap-8 flex flex-col gap-6",children:[N&&e(w,{as:"h3",size:2,html:N,className:"modal-register-subscribe-form-title text-info-primary tablet:text-[24px] text-[20px]"}),t("div",{className:"flex flex-col gap-4",children:[t("div",{className:"flex flex-col gap-2",children:[y&&e(s,{as:"label",size:3,html:y,className:"modal-register-subscribe-email-label text-info-primary tablet:text-[16px] text-[14px] [&_a]:underline"}),e(Y,{type:"email",placeholder:q,value:E,onChange:l=>{$(l.target.value),d("")},className:"modal-register-subscribe-email-input tablet:h-[52px] border-lines-1 tablet:rounded-box-small tablet:px-4 h-[48px] bg-white px-3 font-[700] placeholder:font-[700]"}),R&&e(s,{as:"p",size:3,className:"text-error-0",children:R})]}),t("div",{className:"flex flex-col gap-2",children:[m&&t("div",{className:"flex items-start gap-2",children:[e(I,{id:"modal-register-terms",checked:b,onCheckedChange:l=>{J(!!l),h(!1)},size:"base",className:"mt-0.5 shrink-0"}),e(s,{as:"label",htmlFor:"modal-register-terms",size:3,html:m,className:"modal-register-subscribe-terms-label text-info-tertiary tablet:text-[16px] cursor-pointer text-[14px] [&_a]:underline"})]}),Q&&z&&e(s,{as:"p",size:3,className:"text-error-0",children:z}),L&&t("div",{className:"flex items-start gap-2",children:[e(I,{id:"modal-register-newsletter",checked:S,onCheckedChange:l=>K(!!l),size:"base",className:"mt-0.5 shrink-0"}),e(s,{as:"label",htmlFor:"modal-register-newsletter",size:3,html:L,className:"modal-register-subscribe-newsletter-label text-info-tertiary tablet:text-[16px] cursor-pointer text-[14px] [&_a]:underline"})]})]})]})]}),t("div",{className:"flex flex-col gap-4",children:[t("div",{className:"flex flex-col items-center gap-4",children:[k&&e(X,{onClick:()=>{const l=E.trim();l?F.test(l)?d(""):d(W||""):d(Z||""),h(!!(m&&!b)),!(!l||!F.test(l)||m&&!b)&&G?.(l,b,S)},className:"modal-register-subscribe-register-btn tablet:text-[16px] w-full text-[14px]",children:k}),C&&e(B,{onClick:V,className:"modal-register-subscribe-password-login tablet:text-[16px] text-[14px]",children:C})]}),u&&u.length>0&&e("div",{className:"modal-register-subscribe-social flex items-center justify-center gap-4",children:u.map((l,v)=>t(o.Fragment,{children:[v>0&&e(ee,{}),t("div",{className:"modal-register-subscribe-social-btn rounded-box-small flex items-center gap-2",children:[e("span",{className:"desktop:size-6 size-5 shrink-0",children:l.icon}),e(s,{as:"span",size:3,html:l.label,className:"text-info-primary desktop::text-[16px] text-[14px] [&_a]:underline"})]})]},l.id))})]})]});return t(re,{children:[e(M,{open:p,onOpenChange:x,children:t(_,{className:"modal-register-subscribe-root tablet:!rounded-box tablet:!top-1/2 tablet:!left-1/2 tablet:!bottom-auto tablet:!right-auto tablet:!-translate-x-1/2 tablet:!-translate-y-1/2 rounded-t-box !inset-x-0 !bottom-0 !top-auto flex max-h-[90vh] w-full !translate-x-0 !translate-y-0 flex-col !gap-0 overflow-hidden rounded-b-none !border-none !p-0",style:{maxWidth:896},overlayClassName:"bg-black/60",children:[t("div",{className:"modal-register-subscribe-inner tablet:hidden flex size-full min-h-0 flex-col bg-white",children:[t("div",{className:"modal-register-subscribe-hero relative h-[310px] w-full shrink-0 overflow-hidden bg-[rgba(200,215,240,0.4)]",children:[a?.url&&t("div",{className:"pointer-events-none absolute inset-0",children:[e(T,{source:a.url,alt:a.alt||"",className:"absolute w-[99%]",imgClassName:"w-full h-full object-cover"}),e("div",{className:"absolute inset-0 bg-[rgba(121,160,223,0.2)]"})]}),t("div",{className:"relative z-10 flex flex-col gap-1 px-[24px] pb-[16px] pr-[44px] pt-[44px]",children:[i&&e(w,{as:"h2",size:2,html:i,className:"modal-register-subscribe-hero-heading text-info-primary text-[20px]"}),n&&e(B,{onClick:()=>{g?.(),A(!0)},className:"modal-register-subscribe-rights-details text-info-primary w-fit text-[14px] underline",children:n})]})]}),e("div",{className:"flex-1 overflow-y-auto",children:D})]}),t("div",{className:"modal-register-subscribe-inner tablet:flex hidden h-[640px] min-h-0 w-full flex-row bg-white",children:[t("div",{className:"modal-register-subscribe-left tablet:w-[448px] relative flex shrink-0 flex-col justify-between overflow-hidden px-4 pb-4 pt-12",children:[a?.url&&t("div",{className:"pointer-events-none absolute inset-0",children:[e(T,{source:a.url,alt:a.alt||"",className:"absolute left-0 size-full",imgClassName:"w-full h-full object-cover"}),e("div",{className:"absolute inset-0 bg-[rgba(121,160,223,0.2)]"})]}),e("div",{className:"modal-register-subscribe-hero-title relative px-4",children:i&&e(w,{as:"h2",size:2,html:i,className:"modal-register-subscribe-hero-heading text-info-primary desktop:text-[24px]"})}),t("div",{className:"modal-register-subscribe-benefits rounded-box-small relative flex flex-col gap-2 bg-white/90 p-6 backdrop-blur-sm",children:[f&&e(s,{as:"p",size:3,html:f,className:"modal-register-subscribe-benefits-label text-info-primary [&_a]:underline"}),c&&c.length>0&&e("ul",{className:"flex flex-col gap-1",children:c.map((l,v)=>e("li",{className:"modal-register-subscribe-benefit-item ml-6 list-disc",children:e(s,{as:"span",size:3,html:l.text,className:"text-info-tertiary [&_a]:underline"})},v))})]})]}),e("div",{className:"modal-register-subscribe-right flex min-w-0 flex-1 flex-col overflow-y-auto",children:D})]})]})}),e(ie,{open:U,onOpenChange:A,title:f,benefits:c?.map(l=>l.text)})]})};H.displayName="ModalRegisterSubscribe";var ne=H;export{ne as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ModalRegisterSubscribe/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Dialog, DialogContent, Button, Input, Checkbox, Heading, Text, Picture, Link } from '../../components/index.js'\n\nexport interface HeroImage {\n url: string\n alt?: string\n}\n\nexport interface BenefitItem {\n text: string\n}\n\nexport type SocialLoginType = 'google' | 'apple' | 'facebook'\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\nexport interface ModalRegisterSubscribeProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n heroImage?: HeroImage\n heroTitle?: string\n rightsDetailsLabel?: string\n onRightsDetails?: () => void\n benefitsSectionLabel?: string\n benefits?: BenefitItem[]\n formTitle?: string\n termsDefaultChecked?: boolean\n newsletterDefaultChecked?: boolean\n registerLabel?: string\n passwordLoginLabel?: string\n socialLogins?: SocialLoginType[]\n onRegister?: (email: string, termsAccepted: boolean, newsletterAccepted: boolean) => void\n onPasswordLogin?: () => void\n}\n\nconst VerticalDivider = () => (\n <svg width=\"1\" height=\"16\" viewBox=\"0 0 1 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"0.5\" y1=\"0\" x2=\"0.5\" y2=\"16\" stroke=\"#DADCE0\" />\n </svg>\n)\n\nconst GoogleIcon = () => (\n <svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n)\n\nconst AppleIcon = () => (\n <svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\">\n <path\n fill=\"currentColor\"\n d=\"M16.365 12.408c.023 2.468 2.161 3.29 2.185 3.301-.018.058-.341 1.17-1.122 2.32-.675.993-1.375 1.982-2.478 2.002-1.084.02-1.433-.644-2.674-.644-1.24 0-1.629.624-2.654.664-1.067.04-1.88-1.07-2.56-2.059-1.39-2.01-2.452-5.68-1.027-8.155.707-1.23 1.973-2.01 3.347-2.03 1.045-.02 2.032.704 2.674.704.641 0 1.846-.87 3.112-.742.53.022 2.018.214 2.974 1.613-.077.048-1.776 1.035-1.757 3.026ZM14.972 4.858c.566-.686.947-1.64.843-2.59-.815.033-1.8.543-2.384 1.229-.525.606-.986 1.576-.862 2.507.908.07 1.838-.462 2.403-1.146Z\"\n />\n </svg>\n)\n\nconst FacebookIcon = () => (\n <svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\"\n fill=\"#1877F2\"\n />\n </svg>\n)\n\nconst SOCIAL_LOGIN_META: Record<SocialLoginType, { label: string; icon: React.ReactNode }> = {\n google: {\n label: 'Google',\n icon: <GoogleIcon />,\n },\n apple: {\n label: 'Apple',\n icon: <AppleIcon />,\n },\n facebook: {\n label: 'Facebook',\n icon: <FacebookIcon />,\n },\n}\n\nconst ModalRightsDetails = ({\n open,\n onOpenChange,\n title,\n benefits,\n}: {\n open: boolean\n onOpenChange: (open: boolean) => void\n title?: string\n benefits?: string[]\n}) => (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n className=\"modal-rights-details-root tablet:max-w-[358px] !z-[1002] flex max-h-[80vh] w-full max-w-[calc(100vw_-_32px)] flex-col !gap-0 overflow-hidden rounded-[12px] !border-none bg-white !p-0 drop-shadow-[0px_2px_4px_rgba(0,0,0,0.12)]\"\n overlayClassName=\"!z-[1002] bg-black/60\"\n >\n <div className=\"rounded-[8px] px-[16px] pb-[24px] pt-[16px] backdrop-blur-sm\">\n {title && <Text as=\"p\" size={3} html={title} className=\"text-info-primary mb-2\" />}\n {benefits && benefits.length > 0 && (\n <ul className=\"flex flex-col gap-[4px]\">\n {benefits.map((b, i) => (\n <li key={i} className=\"ml-[21px] list-disc\">\n <Text as=\"span\" size={3} html={b} className=\"text-info-tertiary\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </DialogContent>\n </Dialog>\n)\n\nconst ModalRegisterSubscribe = ({\n open,\n onOpenChange,\n heroImage,\n heroTitle,\n rightsDetailsLabel,\n onRightsDetails,\n benefitsSectionLabel,\n benefits,\n formTitle,\n copy,\n termsDefaultChecked,\n newsletterDefaultChecked,\n registerLabel,\n passwordLoginLabel,\n socialLogins,\n onRegister,\n onPasswordLogin,\n}: ModalRegisterSubscribeProps & { copy?: Record<string, any> }) => {\n const emailLabel = copy?.emailLabel\n const emailPlaceholder = copy?.emailPlaceholder\n const emailEmptyErrorLabel = copy?.emailEmptyErrorLabel\n const emailInvalidErrorLabel = copy?.emailInvalidErrorLabel\n const termsLabel = copy?.termsLabel\n const termsRequiredErrorLabel = copy?.termsRequiredErrorLabel\n const newsletterLabel = copy?.newsletterLabel\n const [email, setEmail] = React.useState('')\n const [emailError, setEmailError] = React.useState('')\n const [termsAccepted, setTermsAccepted] = React.useState(!!termsDefaultChecked)\n const [newsletterAccepted, setNewsletterAccepted] = React.useState(!!newsletterDefaultChecked)\n const [showTermsError, setShowTermsError] = React.useState(false)\n const [showRightsDetails, setShowRightsDetails] = React.useState(false)\n const socialLoginItems = socialLogins?.map(type => ({\n id: type,\n ...SOCIAL_LOGIN_META[type],\n }))\n\n const formSection = (\n <div className=\"modal-register-subscribe-form tablet:p-8 tablet:pt-12 flex h-full flex-col justify-between gap-6 p-6 pt-8\">\n <div className=\"tablet:gap-8 flex flex-col gap-6\">\n {formTitle && (\n <Heading\n as=\"h3\"\n size={2}\n html={formTitle}\n className=\"modal-register-subscribe-form-title text-info-primary tablet:text-[24px] text-[20px]\"\n />\n )}\n\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex flex-col gap-2\">\n {emailLabel && (\n <Text\n as=\"label\"\n size={3}\n html={emailLabel}\n className=\"modal-register-subscribe-email-label text-info-primary tablet:text-[16px] text-[14px] [&_a]:underline\"\n />\n )}\n <Input\n type=\"email\"\n placeholder={emailPlaceholder}\n value={email}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setEmail(e.target.value)\n setEmailError('')\n }}\n className=\"modal-register-subscribe-email-input tablet:h-[52px] border-lines-1 tablet:rounded-box-small tablet:px-4 h-[48px] bg-white px-3 font-[700] placeholder:font-[700]\"\n />\n {emailError && (\n <Text as=\"p\" size={3} className=\"text-error-0\">\n {emailError}\n </Text>\n )}\n </div>\n\n <div className=\"flex flex-col gap-2\">\n {termsLabel && (\n <div className=\"flex items-start gap-2\">\n <Checkbox\n id=\"modal-register-terms\"\n checked={termsAccepted}\n onCheckedChange={(v: boolean | 'indeterminate') => {\n setTermsAccepted(!!v)\n setShowTermsError(false)\n }}\n size=\"base\"\n className=\"mt-0.5 shrink-0\"\n />\n <Text\n as=\"label\"\n htmlFor=\"modal-register-terms\"\n size={3}\n html={termsLabel}\n className=\"modal-register-subscribe-terms-label text-info-tertiary tablet:text-[16px] cursor-pointer text-[14px] [&_a]:underline\"\n />\n </div>\n )}\n {showTermsError && termsRequiredErrorLabel && (\n <Text as=\"p\" size={3} className=\"text-error-0\">\n {termsRequiredErrorLabel}\n </Text>\n )}\n {newsletterLabel && (\n <div className=\"flex items-start gap-2\">\n <Checkbox\n id=\"modal-register-newsletter\"\n checked={newsletterAccepted}\n onCheckedChange={(v: boolean | 'indeterminate') => setNewsletterAccepted(!!v)}\n size=\"base\"\n className=\"mt-0.5 shrink-0\"\n />\n <Text\n as=\"label\"\n htmlFor=\"modal-register-newsletter\"\n size={3}\n html={newsletterLabel}\n className=\"modal-register-subscribe-newsletter-label text-info-tertiary tablet:text-[16px] cursor-pointer text-[14px] [&_a]:underline\"\n />\n </div>\n )}\n </div>\n </div>\n </div>\n\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex flex-col items-center gap-4\">\n {registerLabel && (\n <Button\n onClick={() => {\n const trimmedEmail = email.trim()\n\n if (!trimmedEmail) {\n setEmailError(emailEmptyErrorLabel || '')\n } else if (!EMAIL_PATTERN.test(trimmedEmail)) {\n setEmailError(emailInvalidErrorLabel || '')\n } else {\n setEmailError('')\n }\n\n if (!!termsLabel && !termsAccepted) {\n setShowTermsError(true)\n } else {\n setShowTermsError(false)\n }\n\n if (!trimmedEmail || !EMAIL_PATTERN.test(trimmedEmail) || (!!termsLabel && !termsAccepted)) {\n return\n }\n\n onRegister?.(trimmedEmail, termsAccepted, newsletterAccepted)\n }}\n className=\"modal-register-subscribe-register-btn tablet:text-[16px] w-full text-[14px]\"\n >\n {registerLabel}\n </Button>\n )}\n\n {passwordLoginLabel && (\n <Link\n onClick={onPasswordLogin}\n className=\"modal-register-subscribe-password-login tablet:text-[16px] text-[14px]\"\n >\n {passwordLoginLabel}\n </Link>\n )}\n </div>\n\n {socialLoginItems && socialLoginItems.length > 0 && (\n <div className=\"modal-register-subscribe-social flex items-center justify-center gap-4\">\n {socialLoginItems.map((social, idx) => (\n <React.Fragment key={social.id}>\n {idx > 0 && <VerticalDivider />}\n <div className=\"modal-register-subscribe-social-btn rounded-box-small flex items-center gap-2\">\n <span className=\"desktop:size-6 size-5 shrink-0\">{social.icon}</span>\n <Text\n as=\"span\"\n size={3}\n html={social.label}\n className=\"text-info-primary desktop::text-[16px] text-[14px] [&_a]:underline\"\n />\n </div>\n </React.Fragment>\n ))}\n </div>\n )}\n </div>\n </div>\n )\n\n return (\n <>\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n className=\"modal-register-subscribe-root tablet:!rounded-box tablet:!top-1/2 tablet:!left-1/2 tablet:!bottom-auto tablet:!right-auto tablet:!-translate-x-1/2 tablet:!-translate-y-1/2 rounded-t-box !inset-x-0 !bottom-0 !top-auto flex max-h-[90vh] w-full !translate-x-0 !translate-y-0 flex-col !gap-0 overflow-hidden rounded-b-none !border-none !p-0\"\n style={{ maxWidth: 896 }}\n overlayClassName=\"bg-black/60\"\n >\n {/* \u624B\u673A\u7AEF */}\n <div className=\"modal-register-subscribe-inner tablet:hidden flex size-full min-h-0 flex-col bg-white\">\n <div className=\"modal-register-subscribe-hero relative h-[310px] w-full shrink-0 overflow-hidden bg-[rgba(200,215,240,0.4)]\">\n {heroImage?.url && (\n <div className=\"pointer-events-none absolute inset-0\">\n <Picture\n source={heroImage.url}\n alt={heroImage.alt || ''}\n className=\"absolute w-[99%]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"absolute inset-0 bg-[rgba(121,160,223,0.2)]\" />\n </div>\n )}\n\n <div className=\"relative z-10 flex flex-col gap-1 px-[24px] pb-[16px] pr-[44px] pt-[44px]\">\n {heroTitle && (\n <Heading\n as=\"h2\"\n size={2}\n html={heroTitle}\n className=\"modal-register-subscribe-hero-heading text-info-primary text-[20px]\"\n />\n )}\n {rightsDetailsLabel && (\n <Link\n onClick={() => {\n onRightsDetails?.()\n setShowRightsDetails(true)\n }}\n className=\"modal-register-subscribe-rights-details text-info-primary w-fit text-[14px] underline\"\n >\n {rightsDetailsLabel}\n </Link>\n )}\n </div>\n </div>\n\n <div className=\"flex-1 overflow-y-auto\">{formSection}</div>\n </div>\n {/* pc \u7AEF */}\n <div className=\"modal-register-subscribe-inner tablet:flex hidden h-[640px] min-h-0 w-full flex-row bg-white\">\n <div className=\"modal-register-subscribe-left tablet:w-[448px] relative flex shrink-0 flex-col justify-between overflow-hidden px-4 pb-4 pt-12\">\n {heroImage?.url && (\n <div className=\"pointer-events-none absolute inset-0\">\n <Picture\n source={heroImage.url}\n alt={heroImage.alt || ''}\n className=\"absolute left-0 size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"absolute inset-0 bg-[rgba(121,160,223,0.2)]\" />\n </div>\n )}\n\n <div className=\"modal-register-subscribe-hero-title relative px-4\">\n {heroTitle && (\n <Heading\n as=\"h2\"\n size={2}\n html={heroTitle}\n className=\"modal-register-subscribe-hero-heading text-info-primary desktop:text-[24px]\"\n />\n )}\n </div>\n\n <div className=\"modal-register-subscribe-benefits rounded-box-small relative flex flex-col gap-2 bg-white/90 p-6 backdrop-blur-sm\">\n {benefitsSectionLabel && (\n <Text\n as=\"p\"\n size={3}\n html={benefitsSectionLabel}\n className=\"modal-register-subscribe-benefits-label text-info-primary [&_a]:underline\"\n />\n )}\n {benefits && benefits.length > 0 && (\n <ul className=\"flex flex-col gap-1\">\n {benefits.map((item, idx) => (\n <li key={idx} className=\"modal-register-subscribe-benefit-item ml-6 list-disc\">\n <Text as=\"span\" size={3} html={item.text} className=\"text-info-tertiary [&_a]:underline\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n\n <div className=\"modal-register-subscribe-right flex min-w-0 flex-1 flex-col overflow-y-auto\">\n {formSection}\n </div>\n </div>\n </DialogContent>\n </Dialog>\n\n <ModalRightsDetails\n open={showRightsDetails}\n onOpenChange={setShowRightsDetails}\n title={benefitsSectionLabel}\n benefits={benefits?.map(b => b.text)}\n />\n </>\n )\n}\n\nModalRegisterSubscribe.displayName = 'ModalRegisterSubscribe'\nexport default ModalRegisterSubscribe\n"],
|
|
5
|
+
"mappings": "aAuCI,OAyRA,YAAAA,GAzRA,OAAAC,EAKF,QAAAC,MALE,oBArCJ,UAAYC,MAAW,QACvB,OAAS,UAAAC,EAAQ,iBAAAC,EA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,GAAKA,EAAE,IAAI,EACrC,GACF,CAEJ,EAEAE,EAAuB,YAAc,yBACrC,IAAO2C,GAAQ3C",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "React", "Dialog", "DialogContent", "Button", "Input", "Checkbox", "Heading", "Text", "Picture", "Link", "EMAIL_PATTERN", "VerticalDivider", "GoogleIcon", "AppleIcon", "FacebookIcon", "SOCIAL_LOGIN_META", "ModalRightsDetails", "open", "onOpenChange", "title", "benefits", "b", "i", "ModalRegisterSubscribe", "heroImage", "heroTitle", "rightsDetailsLabel", "onRightsDetails", "benefitsSectionLabel", "formTitle", "copy", "termsDefaultChecked", "newsletterDefaultChecked", "registerLabel", "passwordLoginLabel", "socialLogins", "onRegister", "onPasswordLogin", "emailLabel", "emailPlaceholder", "emailEmptyErrorLabel", "emailInvalidErrorLabel", "termsLabel", "termsRequiredErrorLabel", "newsletterLabel", "email", "setEmail", "emailError", "setEmailError", "termsAccepted", "setTermsAccepted", "newsletterAccepted", "setNewsletterAccepted", "showTermsError", "setShowTermsError", "showRightsDetails", "setShowRightsDetails", "socialLoginItems", "type", "formSection", "e", "v", "trimmedEmail", "social", "idx", "item", "ModalRegisterSubscribe_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface SmsBenefitItem {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ModalSmsSubscribeProps {
|
|
6
|
+
/** 控制弹窗打开状态 */
|
|
7
|
+
open: boolean;
|
|
8
|
+
/** 弹窗状态改变时的回调 */
|
|
9
|
+
onOpenChange: (open: boolean) => void;
|
|
10
|
+
/** 弹窗标题 */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** 权益列表文案 */
|
|
13
|
+
benefits?: SmsBenefitItem[];
|
|
14
|
+
/** 主按钮文案 */
|
|
15
|
+
primaryLabel?: string;
|
|
16
|
+
/** 主按钮跳转 URL */
|
|
17
|
+
primaryUrl?: string;
|
|
18
|
+
/** 次按钮文案 */
|
|
19
|
+
secondaryLabel?: string;
|
|
20
|
+
/** 次按钮跳转 URL */
|
|
21
|
+
secondaryUrl?: string;
|
|
22
|
+
/** 底部法律条款声明文案 */
|
|
23
|
+
legalText?: string;
|
|
24
|
+
/** 激活按钮点击回调 */
|
|
25
|
+
onActivate?: (phone: string) => void;
|
|
26
|
+
/** 次按钮点击回调 */
|
|
27
|
+
onSecondary?: () => void;
|
|
28
|
+
}
|
|
29
|
+
declare const ModalSmsSubscribe: {
|
|
30
|
+
({ open, onOpenChange, title, benefits, copy, primaryLabel, primaryUrl, secondaryLabel, secondaryUrl, legalText, onActivate, onSecondary, }: ModalSmsSubscribeProps & {
|
|
31
|
+
copy?: Record<string, any>;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
export default ModalSmsSubscribe;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as h from"react";import{Dialog as z,DialogContent as B,Button as g,Input as M,Heading as T,Text as l,Link as v}from"../../components/index.js";const N=/^\+?[\d\s\-()]{7,20}$/,y=({open:S,onOpenChange:n,title:b,benefits:r,copy:a,primaryLabel:i,primaryUrl:c,secondaryLabel:m,secondaryUrl:p,legalText:d,onActivate:E,onSecondary:w})=>{const x=a?.phoneLabel,P=a?.phonePlaceholder,k=a?.phoneEmptyError,C=a?.phoneInvalidError,[u,I]=h.useState(""),[f,s]=h.useState("");return e(z,{open:S,onOpenChange:n,children:e(B,{className:"modal-sms-subscribe-root tablet:!top-1/2 tablet:!left-1/2 tablet:!bottom-auto tablet:!right-auto tablet:!-translate-x-1/2 tablet:!-translate-y-1/2 tablet:!rounded-box tablet:max-w-[480px] rounded-t-box !inset-x-0 !bottom-0 !top-auto flex max-h-[90vh] w-full !translate-x-0 !translate-y-0 flex-col !gap-0 overflow-hidden rounded-b-none !border-none !bg-white !p-0",children:e("div",{className:"modal-sms-subscribe-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white",children:o("div",{className:"modal-sms-subscribe-body tablet:px-8 tablet:pb-8 tablet:gap-8 tablet:pt-12 flex flex-col gap-6 px-6 pb-6 pt-4",children:[o("div",{className:"flex flex-col gap-1",children:[b&&e(T,{as:"h2",size:2,html:b,className:"modal-sms-subscribe-title text-info-primary tablet:text-[24px]"}),r&&r.length>0&&e("ul",{className:"flex flex-col gap-1",children:r.map(t=>e("li",{className:"modal-sms-subscribe-benefit ml-6 list-disc",children:e(l,{as:"span",size:3,html:t.text,className:"text-info-primary tablet:text-[16px] text-[14px] [&_a]:underline"})},t.id))})]}),o("div",{className:"flex flex-col gap-2",children:[x&&e(l,{as:"label",size:3,html:x,className:"modal-sms-subscribe-phone-label text-info-primary tablet:text-[16px] text-[14px] [&_a]:underline"}),e(M,{type:"tel",placeholder:P,value:u,onChange:t=>{I(t.target.value),s("")},className:"modal-sms-subscribe-phone-input border-lines-default placeholder:text-info-tertiary rounded-box-small h-[54px] bg-white px-4 placeholder:font-[700]"}),f&&e(l,{as:"p",size:3,className:"text-error-0",children:f})]}),o("div",{className:"flex flex-col items-center gap-4",children:[i&&(c?e(g,{as:"a",href:c,className:"modal-sms-subscribe-activate-btn w-full",children:i}):e(g,{onClick:()=>{const t=u.trim();t?N.test(t)?s(""):s(C||""):s(k||""),!(!t||!N.test(t))&&(E?.(t),n(!1))},className:"modal-sms-subscribe-activate-btn w-full",children:i})),m&&(p?e(v,{href:p,className:"modal-sms-subscribe-secondary-btn text-info-primary",children:m}):e(v,{onClick:()=>{w?.(),n(!1)},className:"modal-sms-subscribe-secondary-btn text-info-primary tablet:text-[16px] text-[14px]",children:m})),d&&e(l,{as:"p",size:2,align:"center",html:d,className:"modal-sms-subscribe-legal text-info-tertiary tablet:text-[14px] text-[12px] [&_a]:underline"})]})]})})})})};y.displayName="ModalSmsSubscribe";var L=y;export{L as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ModalSmsSubscribe/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Dialog, DialogContent, Button, Input, Heading, Text, Link } from '../../components/index.js'\n\nexport interface SmsBenefitItem {\n id: string\n text: string\n}\n\nconst PHONE_PATTERN = /^\\+?[\\d\\s\\-()]{7,20}$/\n\nexport interface ModalSmsSubscribeProps {\n /** \u63A7\u5236\u5F39\u7A97\u6253\u5F00\u72B6\u6001 */\n open: boolean\n /** \u5F39\u7A97\u72B6\u6001\u6539\u53D8\u65F6\u7684\u56DE\u8C03 */\n onOpenChange: (open: boolean) => void\n /** \u5F39\u7A97\u6807\u9898 */\n title?: string\n /** \u6743\u76CA\u5217\u8868\u6587\u6848 */\n benefits?: SmsBenefitItem[]\n /** \u4E3B\u6309\u94AE\u6587\u6848 */\n primaryLabel?: string\n /** \u4E3B\u6309\u94AE\u8DF3\u8F6C URL */\n primaryUrl?: string\n /** \u6B21\u6309\u94AE\u6587\u6848 */\n secondaryLabel?: string\n /** \u6B21\u6309\u94AE\u8DF3\u8F6C URL */\n secondaryUrl?: string\n /** \u5E95\u90E8\u6CD5\u5F8B\u6761\u6B3E\u58F0\u660E\u6587\u6848 */\n legalText?: string\n /** \u6FC0\u6D3B\u6309\u94AE\u70B9\u51FB\u56DE\u8C03 */\n onActivate?: (phone: string) => void\n /** \u6B21\u6309\u94AE\u70B9\u51FB\u56DE\u8C03 */\n onSecondary?: () => void\n}\n\nconst ModalSmsSubscribe = ({\n open,\n onOpenChange,\n title,\n benefits,\n copy,\n primaryLabel,\n primaryUrl,\n secondaryLabel,\n secondaryUrl,\n legalText,\n onActivate,\n onSecondary,\n}: ModalSmsSubscribeProps & { copy?: Record<string, any> }) => {\n const phoneLabel = copy?.phoneLabel\n const phonePlaceholder = copy?.phonePlaceholder\n const phoneEmptyError = copy?.phoneEmptyError\n const phoneInvalidError = copy?.phoneInvalidError\n const [phone, setPhone] = React.useState('')\n const [phoneError, setPhoneError] = React.useState('')\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"modal-sms-subscribe-root tablet:!top-1/2 tablet:!left-1/2 tablet:!bottom-auto tablet:!right-auto tablet:!-translate-x-1/2 tablet:!-translate-y-1/2 tablet:!rounded-box tablet:max-w-[480px] rounded-t-box !inset-x-0 !bottom-0 !top-auto flex max-h-[90vh] w-full !translate-x-0 !translate-y-0 flex-col !gap-0 overflow-hidden rounded-b-none !border-none !bg-white !p-0\">\n <div className=\"modal-sms-subscribe-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white\">\n <div className=\"modal-sms-subscribe-body tablet:px-8 tablet:pb-8 tablet:gap-8 tablet:pt-12 flex flex-col gap-6 px-6 pb-6 pt-4\">\n <div className=\"flex flex-col gap-1\">\n {title && (\n <Heading\n as=\"h2\"\n size={2}\n html={title}\n className=\"modal-sms-subscribe-title text-info-primary tablet:text-[24px]\"\n />\n )}\n {benefits && benefits.length > 0 && (\n <ul className=\"flex flex-col gap-1\">\n {benefits.map(b => (\n <li key={b.id} className=\"modal-sms-subscribe-benefit ml-6 list-disc\">\n <Text\n as=\"span\"\n size={3}\n html={b.text}\n className=\"text-info-primary tablet:text-[16px] text-[14px] [&_a]:underline\"\n />\n </li>\n ))}\n </ul>\n )}\n </div>\n\n <div className=\"flex flex-col gap-2\">\n {phoneLabel && (\n <Text\n as=\"label\"\n size={3}\n html={phoneLabel}\n className=\"modal-sms-subscribe-phone-label text-info-primary tablet:text-[16px] text-[14px] [&_a]:underline\"\n />\n )}\n <Input\n type=\"tel\"\n placeholder={phonePlaceholder}\n value={phone}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setPhone(e.target.value)\n setPhoneError('')\n }}\n className=\"modal-sms-subscribe-phone-input border-lines-default placeholder:text-info-tertiary rounded-box-small h-[54px] bg-white px-4 placeholder:font-[700]\"\n />\n {phoneError && (\n <Text as=\"p\" size={3} className=\"text-error-0\">\n {phoneError}\n </Text>\n )}\n </div>\n\n <div className=\"flex flex-col items-center gap-4\">\n {primaryLabel &&\n (primaryUrl ? (\n <Button as=\"a\" href={primaryUrl} className=\"modal-sms-subscribe-activate-btn w-full\">\n {primaryLabel}\n </Button>\n ) : (\n <Button\n onClick={() => {\n const trimmedPhone = phone.trim()\n\n if (!trimmedPhone) {\n setPhoneError(phoneEmptyError || '')\n } else if (!PHONE_PATTERN.test(trimmedPhone)) {\n setPhoneError(phoneInvalidError || '')\n } else {\n setPhoneError('')\n }\n\n if (!trimmedPhone || !PHONE_PATTERN.test(trimmedPhone)) {\n return\n }\n\n onActivate?.(trimmedPhone)\n onOpenChange(false)\n }}\n className=\"modal-sms-subscribe-activate-btn w-full\"\n >\n {primaryLabel}\n </Button>\n ))}\n {secondaryLabel &&\n (secondaryUrl ? (\n <Link href={secondaryUrl} className=\"modal-sms-subscribe-secondary-btn text-info-primary\">\n {secondaryLabel}\n </Link>\n ) : (\n <Link\n onClick={() => {\n onSecondary?.()\n onOpenChange(false)\n }}\n className=\"modal-sms-subscribe-secondary-btn text-info-primary tablet:text-[16px] text-[14px]\"\n >\n {secondaryLabel}\n </Link>\n ))}\n {legalText && (\n <Text\n as=\"p\"\n size={2}\n align=\"center\"\n html={legalText}\n className=\"modal-sms-subscribe-legal text-info-tertiary tablet:text-[14px] text-[12px] [&_a]:underline\"\n />\n )}\n </div>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nModalSmsSubscribe.displayName = 'ModalSmsSubscribe'\n\nexport default ModalSmsSubscribe\n"],
|
|
5
|
+
"mappings": "aA+DY,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBA7DZ,UAAYC,MAAW,QACvB,OAAS,UAAAC,EAAQ,iBAAAC,EAAe,UAAAC,EAAQ,SAAAC,EAAO,WAAAC,EAAS,QAAAC,EAAM,QAAAC,MAAY,4BAO1E,MAAMC,EAAgB,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GAEJ,EAEA7B,EAAC,OAAI,UAAU,mCACZ,UAAAgB,IACEC,EACClB,EAACK,EAAA,CAAO,GAAG,IAAI,KAAMa,EAAY,UAAU,0CACxC,SAAAD,EACH,EAEAjB,EAACK,EAAA,CACC,QAAS,IAAM,CACb,MAAM6B,EAAeN,EAAM,KAAK,EAE3BM,EAEOxB,EAAc,KAAKwB,CAAY,EAGzCH,EAAc,EAAE,EAFhBA,EAAcJ,GAAqB,EAAE,EAFrCI,EAAcL,GAAmB,EAAE,EAOjC,GAACQ,GAAgB,CAACxB,EAAc,KAAKwB,CAAY,KAIrDZ,IAAaY,CAAY,EACzBrB,EAAa,EAAK,EACpB,EACA,UAAU,0CAET,SAAAI,EACH,GAEHE,IACEC,EACCpB,EAACS,EAAA,CAAK,KAAMW,EAAc,UAAU,sDACjC,SAAAD,EACH,EAEAnB,EAACS,EAAA,CACC,QAAS,IAAM,CACbc,IAAc,EACdV,EAAa,EAAK,CACpB,EACA,UAAU,qFAET,SAAAM,EACH,GAEHE,GACCrB,EAACQ,EAAA,CACC,GAAG,IACH,KAAM,EACN,MAAM,SACN,KAAMa,EACN,UAAU,8FACZ,GAEJ,GACF,EACF,EACF,EACF,CAEJ,EAEAV,EAAkB,YAAc,oBAEhC,IAAOwB,EAAQxB",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "Dialog", "DialogContent", "Button", "Input", "Heading", "Text", "Link", "PHONE_PATTERN", "ModalSmsSubscribe", "open", "onOpenChange", "title", "benefits", "copy", "primaryLabel", "primaryUrl", "secondaryLabel", "secondaryUrl", "legalText", "onActivate", "onSecondary", "phoneLabel", "phonePlaceholder", "phoneEmptyError", "phoneInvalidError", "phone", "setPhone", "phoneError", "setPhoneError", "b", "e", "trimmedPhone", "ModalSmsSubscribe_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ModalSubscribeConfirmProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
icon?: {
|
|
5
|
+
url: string;
|
|
6
|
+
};
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
cancelLabel?: string;
|
|
10
|
+
cancelUrl?: string;
|
|
11
|
+
confirmLabel?: string;
|
|
12
|
+
confirmUrl?: string;
|
|
13
|
+
onCancel?: () => void;
|
|
14
|
+
onConfirm?: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare const ModalSubscribeConfirm: {
|
|
17
|
+
({ open, onOpenChange, icon, title, description, cancelLabel, cancelUrl, confirmLabel, confirmUrl, onCancel, onConfirm, }: ModalSubscribeConfirmProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
export default ModalSubscribeConfirm;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import"react";import{Dialog as p,DialogContent as x,Button as s,Heading as g,Text as v,Picture as N}from"../../components/index.js";const b=({open:f,onOpenChange:i,icon:a,title:o,description:n,cancelLabel:t,cancelUrl:c,confirmLabel:r,confirmUrl:m,onCancel:d,onConfirm:u})=>e(p,{open:f,onOpenChange:i,children:e(x,{className:"modal-subscribe-confirm-root rounded-box tablet:max-w-[480px] flex max-h-[80dvh] w-full max-w-[calc(100vw_-_32px)] flex-col !gap-0 overflow-hidden !border-none !p-0",children:e("div",{className:"modal-subscribe-confirm-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white",children:l("div",{className:"modal-subscribe-confirm-body tablet:p-8 tablet:pt-12 tablet:gap-8 flex flex-col gap-6 px-6 pb-6 pt-4",children:[l("div",{className:"tablet:gap-8 flex flex-col gap-6",children:[(a||o)&&l("div",{className:"modal-subscribe-confirm-headline flex items-start gap-2",children:[a&&a.url&&e("span",{className:"modal-subscribe-confirm-icon flex size-6 shrink-0 items-center justify-center",children:e(N,{source:a.url,alt:"",className:"size-full",imgClassName:"w-full h-full object-contain"})}),o&&e(g,{as:"h3",size:2,html:o,className:"modal-subscribe-confirm-title text-info-primary tablet:text-[24px] text-pretty text-[20px]"})]}),n&&e("ul",{className:"modal-subscribe-confirm-description list-outside list-disc pl-6",children:e("li",{className:"pl-2",children:e(v,{as:"span",size:4,html:n,className:"modal-subscribe-confirm-desc-text text-info-primary tablet:text-[18px] text-[14px] [&_a]:underline"})})})]}),l("div",{className:"modal-subscribe-confirm-actions tablet:gap-4 flex items-center gap-3",children:[t&&(c?e(s,{as:"a",href:c,variant:"secondary",className:"modal-subscribe-confirm-cancel-btn flex-1",children:t}):e(s,{onClick:()=>{d?.(),i(!1)},variant:"secondary",className:"modal-subscribe-confirm-cancel-btn flex-1",children:t})),r&&(m?e(s,{as:"a",href:m,className:"modal-subscribe-confirm-confirm-btn flex-1",children:r}):e(s,{onClick:()=>{u?.(),i(!1)},className:"modal-subscribe-confirm-confirm-btn flex-1",children:r}))]})]})})})});b.displayName="ModalSubscribeConfirm";var w=b;export{w as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ModalSubscribeConfirm/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Dialog, DialogContent, Button, Heading, Text, Picture } from '../../components/index.js'\n\nexport interface ModalSubscribeConfirmProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n icon?: {\n url: string\n }\n title?: string\n description?: string\n cancelLabel?: string\n cancelUrl?: string\n confirmLabel?: string\n confirmUrl?: string\n onCancel?: () => void\n onConfirm?: () => void\n}\n\nconst ModalSubscribeConfirm = ({\n open,\n onOpenChange,\n icon,\n title,\n description,\n cancelLabel,\n cancelUrl,\n confirmLabel,\n confirmUrl,\n onCancel,\n onConfirm,\n}: ModalSubscribeConfirmProps) => {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"modal-subscribe-confirm-root rounded-box tablet:max-w-[480px] flex max-h-[80dvh] w-full max-w-[calc(100vw_-_32px)] flex-col !gap-0 overflow-hidden !border-none !p-0\">\n <div className=\"modal-subscribe-confirm-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white\">\n <div className=\"modal-subscribe-confirm-body tablet:p-8 tablet:pt-12 tablet:gap-8 flex flex-col gap-6 px-6 pb-6 pt-4\">\n <div className=\"tablet:gap-8 flex flex-col gap-6\">\n {(icon || title) && (\n <div className=\"modal-subscribe-confirm-headline flex items-start gap-2\">\n {icon && icon.url && (\n <span className=\"modal-subscribe-confirm-icon flex size-6 shrink-0 items-center justify-center\">\n <Picture\n source={icon.url}\n alt=\"\"\n className=\"size-full\"\n imgClassName=\"w-full h-full object-contain\"\n />\n </span>\n )}\n {title && (\n <Heading\n as=\"h3\"\n size={2}\n html={title}\n className=\"modal-subscribe-confirm-title text-info-primary tablet:text-[24px] text-pretty text-[20px]\"\n />\n )}\n </div>\n )}\n\n {description && (\n <ul className=\"modal-subscribe-confirm-description list-outside list-disc pl-6\">\n <li className=\"pl-2\">\n <Text\n as=\"span\"\n size={4}\n html={description}\n className=\"modal-subscribe-confirm-desc-text text-info-primary tablet:text-[18px] text-[14px] [&_a]:underline\"\n />\n </li>\n </ul>\n )}\n </div>\n\n <div className=\"modal-subscribe-confirm-actions tablet:gap-4 flex items-center gap-3\">\n {cancelLabel &&\n (cancelUrl ? (\n <Button\n as=\"a\"\n href={cancelUrl}\n variant=\"secondary\"\n className=\"modal-subscribe-confirm-cancel-btn flex-1\"\n >\n {cancelLabel}\n </Button>\n ) : (\n <Button\n onClick={() => {\n onCancel?.()\n onOpenChange(false)\n }}\n variant=\"secondary\"\n className=\"modal-subscribe-confirm-cancel-btn flex-1\"\n >\n {cancelLabel}\n </Button>\n ))}\n {confirmLabel &&\n (confirmUrl ? (\n <Button as=\"a\" href={confirmUrl} className=\"modal-subscribe-confirm-confirm-btn flex-1\">\n {confirmLabel}\n </Button>\n ) : (\n <Button\n onClick={() => {\n onConfirm?.()\n onOpenChange(false)\n }}\n className=\"modal-subscribe-confirm-confirm-btn flex-1\"\n >\n {confirmLabel}\n </Button>\n ))}\n </div>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nModalSubscribeConfirm.displayName = 'ModalSubscribeConfirm'\n\nexport default ModalSubscribeConfirm\n"],
|
|
5
|
+
"mappings": "aAyCgB,OAGM,OAAAA,EAHN,QAAAC,MAAA,oBAvChB,MAAuB,QACvB,OAAS,UAAAC,EAAQ,iBAAAC,EAAe,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,EAAM,WAAAC,MAAe,4BAkBtE,MAAMC,EAAwB,CAAC,CAC7B,KAAAC,EACA,aAAAC,EACA,KAAAC,EACA,MAAAC,EACA,YAAAC,EACA,YAAAC,EACA,UAAAC,EACA,aAAAC,EACA,WAAAC,EACA,SAAAC,EACA,UAAAC,CACF,IAEInB,EAACE,EAAA,CAAO,KAAMO,EAAM,aAAcC,EAChC,SAAAV,EAACG,EAAA,CAAc,UAAU,uKACvB,SAAAH,EAAC,OAAI,UAAU,sFACb,SAAAC,EAAC,OAAI,UAAU,uGACb,UAAAA,EAAC,OAAI,UAAU,mCACX,WAAAU,GAAQC,IACRX,EAAC,OAAI,UAAU,0DACZ,UAAAU,GAAQA,EAAK,KACZX,EAAC,QAAK,UAAU,gFACd,SAAAA,EAACO,EAAA,CACC,OAAQI,EAAK,IACb,IAAI,GACJ,UAAU,YACV,aAAa,+BACf,EACF,EAEDC,GACCZ,EAACK,EAAA,CACC,GAAG,KACH,KAAM,EACN,KAAMO,EACN,UAAU,6FACZ,GAEJ,EAGDC,GACCb,EAAC,MAAG,UAAU,kEACZ,SAAAA,EAAC,MAAG,UAAU,OACZ,SAAAA,EAACM,EAAA,CACC,GAAG,OACH,KAAM,EACN,KAAMO,EACN,UAAU,qGACZ,EACF,EACF,GAEJ,EAEAZ,EAAC,OAAI,UAAU,uEACZ,UAAAa,IACEC,EACCf,EAACI,EAAA,CACC,GAAG,IACH,KAAMW,EACN,QAAQ,YACR,UAAU,4CAET,SAAAD,EACH,EAEAd,EAACI,EAAA,CACC,QAAS,IAAM,CACbc,IAAW,EACXR,EAAa,EAAK,CACpB,EACA,QAAQ,YACR,UAAU,4CAET,SAAAI,EACH,GAEHE,IACEC,EACCjB,EAACI,EAAA,CAAO,GAAG,IAAI,KAAMa,EAAY,UAAU,6CACxC,SAAAD,EACH,EAEAhB,EAACI,EAAA,CACC,QAAS,IAAM,CACbe,IAAY,EACZT,EAAa,EAAK,CACpB,EACA,UAAU,6CAET,SAAAM,EACH,IAEN,GACF,EACF,EACF,EACF,EAIJR,EAAsB,YAAc,wBAEpC,IAAOY,EAAQZ",
|
|
6
|
+
"names": ["jsx", "jsxs", "Dialog", "DialogContent", "Button", "Heading", "Text", "Picture", "ModalSubscribeConfirm", "open", "onOpenChange", "icon", "title", "description", "cancelLabel", "cancelUrl", "confirmLabel", "confirmUrl", "onCancel", "onConfirm", "ModalSubscribeConfirm_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface VerifyHintItem {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ModalVerifyProps {
|
|
6
|
+
/** 控制弹窗打开状态 */
|
|
7
|
+
open: boolean;
|
|
8
|
+
/** 弹窗状态改变时的回调 */
|
|
9
|
+
onOpenChange: (open: boolean) => void;
|
|
10
|
+
/** 弹窗标题 */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** 弹窗描述文案 */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** 验证码长度 */
|
|
15
|
+
codeLength?: number;
|
|
16
|
+
/** 提示文案列表 */
|
|
17
|
+
hints?: VerifyHintItem[];
|
|
18
|
+
/** 提交按钮文案 */
|
|
19
|
+
primaryLabel?: string;
|
|
20
|
+
/** 提交成功后的跳转 URL */
|
|
21
|
+
primaryUrl?: string;
|
|
22
|
+
/** 提交验证码回调 */
|
|
23
|
+
onSubmit?: (code: string) => void;
|
|
24
|
+
/** 重新发送验证码回调 */
|
|
25
|
+
onResend?: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare const ModalVerify: {
|
|
28
|
+
({ open, onOpenChange, title, description, copy, codeLength, hints, primaryLabel, primaryUrl, onSubmit, onResend, }: ModalVerifyProps & {
|
|
29
|
+
copy?: Record<string, any>;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
export default ModalVerify;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as h from"react";import{Dialog as _,DialogContent as k,Button as w,Heading as D,Text as t,Link as I,OtpInput as L}from"../../components/index.js";const C=({open:E,onOpenChange:c,title:p,description:x,copy:a,codeLength:v=6,hints:s,primaryLabel:n,primaryUrl:g,onSubmit:y,onResend:z})=>{const b=a?.codeLabel,d=a?.resendPrompt,m=a?.resendLabel,u=a?.footerNote,M=a?.codeEmptyError,P=a?.codeInvalidError,[i,V]=h.useState(""),[N,f]=h.useState(""),o=i.length===v;return e(_,{open:E,onOpenChange:c,children:e(k,{className:"modal-verify-root tablet:max-w-[480px] rounded-box flex max-h-[80vh] w-full max-w-[calc(100vw_-_32px)] flex-col !gap-0 overflow-hidden !border-none !p-0",children:e("div",{className:"modal-verify-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white",children:l("div",{className:"modal-verify-body tablet:px-8 tablet:pb-8 tablet:gap-8 tablet:pt-12 flex flex-col gap-4 px-6 pb-6 pt-4",children:[l("div",{className:"flex flex-col gap-1",children:[p&&e(D,{as:"h2",size:2,html:p,className:"modal-verify-title text-info-primary text-pretty"}),x&&e(t,{as:"p",size:3,html:x,className:"modal-verify-description text-info-primary [&_a]:underline"})]}),l("div",{className:"flex flex-col gap-2",children:[b&&e(t,{as:"label",size:3,html:b,className:"modal-verify-code-label text-info-primary [&_a]:underline"}),e(L,{length:v,value:i,onChange:r=>{V(r),f("")},className:"modal-verify-otp"}),N&&e(t,{as:"p",size:3,className:"text-error-0",children:N})]}),l("div",{className:"flex flex-col gap-2",children:[s&&s.length>0&&e("ul",{className:"flex flex-col gap-0",children:s.map(r=>e("li",{className:"modal-verify-hint ml-6 list-disc",children:e(t,{as:"span",size:3,html:r.text,className:"text-info-tertiary [&_a]:underline"})},r.id))}),(d||m)&&l("div",{className:"modal-verify-resend tablet:gap-2 flex flex-wrap items-center gap-0",children:[d&&e(t,{as:"span",size:3,html:d,className:"text-info-primary whitespace-nowrap text-nowrap [&_a]:underline"}),m&&e(I,{onClick:z,className:"modal-verify-resend-btn text-[#005D8E]",children:m})]})]}),l("div",{className:"flex flex-col items-center gap-4",children:[n&&(g?e(w,{as:"a",href:o?g:void 0,onClick:()=>{o&&(f(""),y?.(i))},disabled:!o,className:"modal-verify-submit-btn w-full",children:n}):e(w,{onClick:()=>{o&&(f(""),y?.(i),c(!1))},disabled:!o,className:"modal-verify-submit-btn w-full",children:n})),u&&e(t,{as:"p",size:3,align:"center",html:u,className:"modal-verify-footer-note text-info-tertiary [&_a]:underline"})]})]})})})})};C.displayName="ModalVerify";var H=C;export{H as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ModalVerify/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Dialog, DialogContent, Button, Heading, Text, Link, OtpInput } from '../../components/index.js'\n\nexport interface VerifyHintItem {\n id: string\n text: string\n}\n\nexport interface ModalVerifyProps {\n /** \u63A7\u5236\u5F39\u7A97\u6253\u5F00\u72B6\u6001 */\n open: boolean\n /** \u5F39\u7A97\u72B6\u6001\u6539\u53D8\u65F6\u7684\u56DE\u8C03 */\n onOpenChange: (open: boolean) => void\n /** \u5F39\u7A97\u6807\u9898 */\n title?: string\n /** \u5F39\u7A97\u63CF\u8FF0\u6587\u6848 */\n description?: string\n /** \u9A8C\u8BC1\u7801\u957F\u5EA6 */\n codeLength?: number\n /** \u63D0\u793A\u6587\u6848\u5217\u8868 */\n hints?: VerifyHintItem[]\n /** \u63D0\u4EA4\u6309\u94AE\u6587\u6848 */\n primaryLabel?: string\n /** \u63D0\u4EA4\u6210\u529F\u540E\u7684\u8DF3\u8F6C URL */\n primaryUrl?: string\n /** \u63D0\u4EA4\u9A8C\u8BC1\u7801\u56DE\u8C03 */\n onSubmit?: (code: string) => void\n /** \u91CD\u65B0\u53D1\u9001\u9A8C\u8BC1\u7801\u56DE\u8C03 */\n onResend?: () => void\n}\n\nconst ModalVerify = ({\n open,\n onOpenChange,\n title,\n description,\n copy,\n codeLength = 6,\n hints,\n primaryLabel,\n primaryUrl,\n onSubmit,\n onResend,\n}: ModalVerifyProps & { copy?: Record<string, any> }) => {\n const codeLabel = copy?.codeLabel\n const resendPrompt = copy?.resendPrompt\n const resendLabel = copy?.resendLabel\n const footerNote = copy?.footerNote\n const codeEmptyError = copy?.codeEmptyError\n const codeInvalidError = copy?.codeInvalidError\n const [code, setCode] = React.useState('')\n const [codeError, setCodeError] = React.useState('')\n const isCodeValid = code.length === codeLength\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"modal-verify-root tablet:max-w-[480px] rounded-box flex max-h-[80vh] w-full max-w-[calc(100vw_-_32px)] flex-col !gap-0 overflow-hidden !border-none !p-0\">\n <div className=\"modal-verify-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white\">\n <div className=\"modal-verify-body tablet:px-8 tablet:pb-8 tablet:gap-8 tablet:pt-12 flex flex-col gap-4 px-6 pb-6 pt-4\">\n <div className=\"flex flex-col gap-1\">\n {title && (\n <Heading as=\"h2\" size={2} html={title} className=\"modal-verify-title text-info-primary text-pretty\" />\n )}\n {description && (\n <Text\n as=\"p\"\n size={3}\n html={description}\n className=\"modal-verify-description text-info-primary [&_a]:underline\"\n />\n )}\n </div>\n\n <div className=\"flex flex-col gap-2\">\n {codeLabel && (\n <Text\n as=\"label\"\n size={3}\n html={codeLabel}\n className=\"modal-verify-code-label text-info-primary [&_a]:underline\"\n />\n )}\n <OtpInput\n length={codeLength}\n value={code}\n onChange={(v: string) => {\n setCode(v)\n setCodeError('')\n }}\n className=\"modal-verify-otp\"\n />\n {codeError && (\n <Text as=\"p\" size={3} className=\"text-error-0\">\n {codeError}\n </Text>\n )}\n </div>\n\n <div className=\"flex flex-col gap-2\">\n {hints && hints.length > 0 && (\n <ul className=\"flex flex-col gap-0\">\n {hints.map(hint => (\n <li key={hint.id} className=\"modal-verify-hint ml-6 list-disc\">\n <Text as=\"span\" size={3} html={hint.text} className=\"text-info-tertiary [&_a]:underline\" />\n </li>\n ))}\n </ul>\n )}\n {(resendPrompt || resendLabel) && (\n <div className=\"modal-verify-resend tablet:gap-2 flex flex-wrap items-center gap-0\">\n {resendPrompt && (\n <Text\n as=\"span\"\n size={3}\n html={resendPrompt}\n className=\"text-info-primary whitespace-nowrap text-nowrap [&_a]:underline\"\n />\n )}\n {resendLabel && (\n <Link onClick={onResend} className=\"modal-verify-resend-btn text-[#005D8E]\">\n {resendLabel}\n </Link>\n )}\n </div>\n )}\n </div>\n\n <div className=\"flex flex-col items-center gap-4\">\n {primaryLabel &&\n (primaryUrl ? (\n <Button\n as=\"a\"\n href={isCodeValid ? primaryUrl : undefined}\n onClick={() => {\n if (isCodeValid) {\n setCodeError('')\n onSubmit?.(code)\n }\n }}\n disabled={!isCodeValid}\n className=\"modal-verify-submit-btn w-full\"\n >\n {primaryLabel}\n </Button>\n ) : (\n <Button\n onClick={() => {\n if (!isCodeValid) {\n return\n }\n setCodeError('')\n onSubmit?.(code)\n onOpenChange(false)\n }}\n disabled={!isCodeValid}\n className=\"modal-verify-submit-btn w-full\"\n >\n {primaryLabel}\n </Button>\n ))}\n {footerNote && (\n <Text\n as=\"p\"\n size={3}\n align=\"center\"\n html={footerNote}\n className=\"modal-verify-footer-note text-info-tertiary [&_a]:underline\"\n />\n )}\n </div>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nModalVerify.displayName = 'ModalVerify'\n\nexport default ModalVerify\n"],
|
|
5
|
+
"mappings": "aA6DY,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBA3DZ,UAAYC,MAAW,QACvB,OAAS,UAAAC,EAAQ,iBAAAC,EAAe,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,EAAM,QAAAC,EAAM,YAAAC,MAAgB,4BA8B7E,MAAMC,EAAc,CAAC,CACnB,KAAAC,EACA,aAAAC,EACA,MAAAC,EACA,YAAAC,EACA,KAAAC,EACA,WAAAC,EAAa,EACb,MAAAC,EACA,aAAAC,EACA,WAAAC,EACA,SAAAC,EACA,SAAAC,CACF,IAAyD,CACvD,MAAMC,EAAYP,GAAM,UAClBQ,EAAeR,GAAM,aACrBS,EAAcT,GAAM,YACpBU,EAAaV,GAAM,WACnBW,EAAiBX,GAAM,eACvBY,EAAmBZ,GAAM,iBACzB,CAACa,EAAMC,CAAO,EAAI3B,EAAM,SAAS,EAAE,EACnC,CAAC4B,EAAWC,CAAY,EAAI7B,EAAM,SAAS,EAAE,EAC7C8B,EAAcJ,EAAK,SAAWZ,EAEpC,OACEhB,EAACG,EAAA,CAAO,KAAMQ,EAAM,aAAcC,EAChC,SAAAZ,EAACI,EAAA,CAAc,UAAU,2JACvB,SAAAJ,EAAC,OAAI,UAAU,2EACb,SAAAC,EAAC,OAAI,UAAU,yGACb,UAAAA,EAAC,OAAI,UAAU,sBACZ,UAAAY,GACCb,EAACM,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,KAAMO,EAAO,UAAU,mDAAmD,EAErGC,GACCd,EAACO,EAAA,CACC,GAAG,IACH,KAAM,EACN,KAAMO,EACN,UAAU,6DACZ,GAEJ,EAEAb,EAAC,OAAI,UAAU,sBACZ,UAAAqB,GACCtB,EAACO,EAAA,CACC,GAAG,QACH,KAAM,EACN,KAA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Ac,cAE1B,IAAOyB,EAAQzB",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "Dialog", "DialogContent", "Button", "Heading", "Text", "Link", "OtpInput", "ModalVerify", "open", "onOpenChange", "title", "description", "copy", "codeLength", "hints", "primaryLabel", "primaryUrl", "onSubmit", "onResend", "codeLabel", "resendPrompt", "resendLabel", "footerNote", "codeEmptyError", "codeInvalidError", "code", "setCode", "codeError", "setCodeError", "isCodeValid", "v", "hint", "ModalVerify_default"]
|
|
7
|
+
}
|
|
@@ -4,7 +4,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<React.HTMLAttribute
|
|
|
4
4
|
onSecondaryButtonClick?: () => void;
|
|
5
5
|
onPrimaryButtonClick?: () => void;
|
|
6
6
|
data: {
|
|
7
|
-
shape?: import("
|
|
7
|
+
shape?: import("../..").Shape;
|
|
8
8
|
sectionTitle?: string;
|
|
9
9
|
mode?: "grid" | "carousel";
|
|
10
10
|
groupByTab?: boolean;
|
|
@@ -16,7 +16,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<React.HTMLAttribute
|
|
|
16
16
|
items: Item[];
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
} & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("..").ContainerProps & React.RefAttributes<unknown>> & {
|
|
20
20
|
readonly $$typeof: symbol;
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NavigationSearchProps } from './types.js';
|
|
2
2
|
export declare const canSearch: (target: any) => boolean;
|
|
3
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<NavigationSearchProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<NavigationSearchProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & import("react").RefAttributes<unknown>> & {
|
|
4
4
|
readonly $$typeof: symbol;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
@@ -44,5 +44,5 @@ export interface ProductCompareProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
44
44
|
theme?: Theme;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<ProductCompareProps, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
47
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<ProductCompareProps, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & import("react").RefAttributes<unknown>> & {};
|
|
48
48
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ProductHeroProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<ProductHeroProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<ProductHeroProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
4
4
|
readonly $$typeof: symbol;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProductNavProps } from './types.js';
|
|
2
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<ProductNavProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<ProductNavProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & import("react").RefAttributes<unknown>> & {
|
|
3
3
|
readonly $$typeof: symbol;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
@@ -43,7 +43,7 @@ export interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
43
43
|
data: PromotionalBarData;
|
|
44
44
|
classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>;
|
|
45
45
|
}
|
|
46
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<PromotionalBarProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
46
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<PromotionalBarProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
47
47
|
readonly $$typeof: symbol;
|
|
48
48
|
};
|
|
49
49
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PriceData, ButtonFunctionType } from './types.js';
|
|
2
|
+
import type { PriceData, ButtonFunctionType, SceneProductCardData } from './types.js';
|
|
3
3
|
import 'swiper/css';
|
|
4
4
|
export interface SceneShelfProductsPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/** 标题 */
|
|
@@ -18,6 +18,11 @@ export interface SceneShelfProductsPanelProps extends React.HTMLAttributes<HTMLD
|
|
|
18
18
|
secondaryButtonText?: string;
|
|
19
19
|
/** 次要按钮功能类型 */
|
|
20
20
|
secondaryButtonFun?: ButtonFunctionType;
|
|
21
|
+
/**
|
|
22
|
+
* 套餐折扣标签,支持 string 或 render prop
|
|
23
|
+
* @param selectedProducts 当前选中的产品列表
|
|
24
|
+
*/
|
|
25
|
+
bundleDiscountLabel?: string | ((selectedProducts: SceneProductCardData[]) => React.ReactNode);
|
|
21
26
|
/** 子组件(ProductCard 或自定义卡片) */
|
|
22
27
|
children: React.ReactNode;
|
|
23
28
|
}
|