@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var v=(l,s)=>{for(var i in s)c(l,i,{get:s[i],enumerable:!0})},N=(l,s,i,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of x(s))!g.call(l,o)&&o!==i&&c(l,o,{get:()=>s[o],enumerable:!(t=p(s,o))||t.enumerable});return l};var h=l=>N(c({},"__esModule",{value:!0}),l);var w={};v(w,{default:()=>C});module.exports=h(w);var e=require("react/jsx-runtime"),B=require("react"),a=require("../../components/index.js");const f=({open:l,onOpenChange:s,icon:i,title:t,description:o,cancelLabel:r,cancelUrl:m,confirmLabel:n,confirmUrl:b,onCancel:d,onConfirm:u})=>(0,e.jsx)(a.Dialog,{open:l,onOpenChange:s,children:(0,e.jsx)(a.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",children:(0,e.jsx)("div",{className:"modal-subscribe-confirm-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white",children:(0,e.jsxs)("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:[(0,e.jsxs)("div",{className:"tablet:gap-8 flex flex-col gap-6",children:[(i||t)&&(0,e.jsxs)("div",{className:"modal-subscribe-confirm-headline flex items-start gap-2",children:[i&&i.url&&(0,e.jsx)("span",{className:"modal-subscribe-confirm-icon flex size-6 shrink-0 items-center justify-center",children:(0,e.jsx)(a.Picture,{source:i.url,alt:"",className:"size-full",imgClassName:"w-full h-full object-contain"})}),t&&(0,e.jsx)(a.Heading,{as:"h3",size:2,html:t,className:"modal-subscribe-confirm-title text-info-primary tablet:text-[24px] text-pretty text-[20px]"})]}),o&&(0,e.jsx)("ul",{className:"modal-subscribe-confirm-description list-outside list-disc pl-6",children:(0,e.jsx)("li",{className:"pl-2",children:(0,e.jsx)(a.Text,{as:"span",size:4,html:o,className:"modal-subscribe-confirm-desc-text text-info-primary tablet:text-[18px] text-[14px] [&_a]:underline"})})})]}),(0,e.jsxs)("div",{className:"modal-subscribe-confirm-actions tablet:gap-4 flex items-center gap-3",children:[r&&(m?(0,e.jsx)(a.Button,{as:"a",href:m,variant:"secondary",className:"modal-subscribe-confirm-cancel-btn flex-1",children:r}):(0,e.jsx)(a.Button,{onClick:()=>{d?.(),s(!1)},variant:"secondary",className:"modal-subscribe-confirm-cancel-btn flex-1",children:r})),n&&(b?(0,e.jsx)(a.Button,{as:"a",href:b,className:"modal-subscribe-confirm-confirm-btn flex-1",children:n}):(0,e.jsx)(a.Button,{onClick:()=>{u?.(),s(!1)},className:"modal-subscribe-confirm-confirm-btn flex-1",children:n}))]})]})})})});f.displayName="ModalSubscribeConfirm";var C=f;
|
|
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": "sbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyCgB,IAAAI,EAAA,6BAvChBC,EAAuB,iBACvBC,EAAsE,qCAkBtE,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,OAEI,OAAC,UAAO,KAAMV,EAAM,aAAcC,EAChC,mBAAC,iBAAc,UAAU,uKACvB,mBAAC,OAAI,UAAU,sFACb,oBAAC,OAAI,UAAU,uGACb,qBAAC,OAAI,UAAU,mCACX,WAAAC,GAAQC,OACR,QAAC,OAAI,UAAU,0DACZ,UAAAD,GAAQA,EAAK,QACZ,OAAC,QAAK,UAAU,gFACd,mBAAC,WACC,OAAQA,EAAK,IACb,IAAI,GACJ,UAAU,YACV,aAAa,+BACf,EACF,EAEDC,MACC,OAAC,WACC,GAAG,KACH,KAAM,EACN,KAAMA,EACN,UAAU,6FACZ,GAEJ,EAGDC,MACC,OAAC,MAAG,UAAU,kEACZ,mBAAC,MAAG,UAAU,OACZ,mBAAC,QACC,GAAG,OACH,KAAM,EACN,KAAMA,EACN,UAAU,qGACZ,EACF,EACF,GAEJ,KAEA,QAAC,OAAI,UAAU,uEACZ,UAAAC,IACEC,KACC,OAAC,UACC,GAAG,IACH,KAAMA,EACN,QAAQ,YACR,UAAU,4CAET,SAAAD,EACH,KAEA,OAAC,UACC,QAAS,IAAM,CACbI,IAAW,EACXR,EAAa,EAAK,CACpB,EACA,QAAQ,YACR,UAAU,4CAET,SAAAI,EACH,GAEHE,IACEC,KACC,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAY,UAAU,6CACxC,SAAAD,EACH,KAEA,OAAC,UACC,QAAS,IAAM,CACbG,IAAY,EACZT,EAAa,EAAK,CACpB,EACA,UAAU,6CAET,SAAAM,EACH,IAEN,GACF,EACF,EACF,EACF,EAIJR,EAAsB,YAAc,wBAEpC,IAAOL,EAAQK",
|
|
6
|
+
"names": ["ModalSubscribeConfirm_exports", "__export", "ModalSubscribeConfirm_default", "__toCommonJS", "import_jsx_runtime", "React", "import_components", "ModalSubscribeConfirm", "open", "onOpenChange", "icon", "title", "description", "cancelLabel", "cancelUrl", "confirmLabel", "confirmUrl", "onCancel", "onConfirm"]
|
|
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 strict";"use client";var _=Object.create;var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var M=(t,l)=>{for(var i in l)m(t,i,{get:l[i],enumerable:!0})},w=(t,l,i,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let o of D(l))!L.call(t,o)&&o!==i&&m(t,o,{get:()=>l[o],enumerable:!(r=k(l,o))||r.enumerable});return t};var P=(t,l,i)=>(i=t!=null?_(I(t)):{},w(l||!t||!t.__esModule?m(i,"default",{value:t,enumerable:!0}):i,t)),B=t=>w(m({},"__esModule",{value:!0}),t);var R={};M(R,{default:()=>H});module.exports=B(R);var e=require("react/jsx-runtime"),C=P(require("react")),a=require("../../components/index.js");const E=({open:t,onOpenChange:l,title:i,description:r,copy:o,codeLength:g=6,hints:f,primaryLabel:c,primaryUrl:y,onSubmit:b,onResend:z})=>{const u=o?.codeLabel,p=o?.resendPrompt,x=o?.resendLabel,N=o?.footerNote,O=o?.codeEmptyError,S=o?.codeInvalidError,[n,V]=C.useState(""),[h,v]=C.useState(""),s=n.length===g;return(0,e.jsx)(a.Dialog,{open:t,onOpenChange:l,children:(0,e.jsx)(a.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",children:(0,e.jsx)("div",{className:"modal-verify-inner flex min-h-0 w-full flex-col overflow-y-auto bg-white",children:(0,e.jsxs)("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:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[i&&(0,e.jsx)(a.Heading,{as:"h2",size:2,html:i,className:"modal-verify-title text-info-primary text-pretty"}),r&&(0,e.jsx)(a.Text,{as:"p",size:3,html:r,className:"modal-verify-description text-info-primary [&_a]:underline"})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[u&&(0,e.jsx)(a.Text,{as:"label",size:3,html:u,className:"modal-verify-code-label text-info-primary [&_a]:underline"}),(0,e.jsx)(a.OtpInput,{length:g,value:n,onChange:d=>{V(d),v("")},className:"modal-verify-otp"}),h&&(0,e.jsx)(a.Text,{as:"p",size:3,className:"text-error-0",children:h})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[f&&f.length>0&&(0,e.jsx)("ul",{className:"flex flex-col gap-0",children:f.map(d=>(0,e.jsx)("li",{className:"modal-verify-hint ml-6 list-disc",children:(0,e.jsx)(a.Text,{as:"span",size:3,html:d.text,className:"text-info-tertiary [&_a]:underline"})},d.id))}),(p||x)&&(0,e.jsxs)("div",{className:"modal-verify-resend tablet:gap-2 flex flex-wrap items-center gap-0",children:[p&&(0,e.jsx)(a.Text,{as:"span",size:3,html:p,className:"text-info-primary whitespace-nowrap text-nowrap [&_a]:underline"}),x&&(0,e.jsx)(a.Link,{onClick:z,className:"modal-verify-resend-btn text-[#005D8E]",children:x})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[c&&(y?(0,e.jsx)(a.Button,{as:"a",href:s?y:void 0,onClick:()=>{s&&(v(""),b?.(n))},disabled:!s,className:"modal-verify-submit-btn w-full",children:c}):(0,e.jsx)(a.Button,{onClick:()=>{s&&(v(""),b?.(n),l(!1))},disabled:!s,className:"modal-verify-submit-btn w-full",children:c})),N&&(0,e.jsx)(a.Text,{as:"p",size:3,align:"center",html:N,className:"modal-verify-footer-note text-info-tertiary [&_a]:underline"})]})]})})})})};E.displayName="ModalVerify";var H=E;
|
|
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6DY,IAAAI,EAAA,6BA3DZC,EAAuB,oBACvBC,EAA6E,qCA8B7E,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,EAAIrB,EAAM,SAAS,EAAE,EACnC,CAACsB,EAAWC,CAAY,EAAIvB,EAAM,SAAS,EAAE,EAC7CwB,EAAcJ,EAAK,SAAWZ,EAEpC,SACE,OAAC,UAAO,KAAML,EAAM,aAAcC,EAChC,mBAAC,iBAAc,UAAU,2JACvB,mBAAC,OAAI,UAAU,2EACb,oBAAC,OAAI,UAAU,yGACb,qBAAC,OAAI,UAAU,sBACZ,UAAAC,MACC,OAAC,WAAQ,GAAG,KAAK,KAAM,EAAG,KAAMA,EAAO,UAAU,mDAAmD,EAErGC,MACC,OAAC,QACC,GAAG,IACH,KAAM,EACN,KAAMA,EACN,UAAU,6DACZ,GAEJ,KAEA,QAAC,OAAI,UAAU,sBACZ,UAAAQ,MACC,OAAC,QACC,GAAG,QACH,KAAM,EACN,KAAMA,EACN,UAAU,4DACZ,KAEF,OAAC,YACC,OAAQN,EACR,MAAOY,EACP,SAAWK,GAAc,CACvBJ,EAAQI,CAAC,EACTF,EAAa,EAAE,CACjB,EACA,UAAU,mBACZ,EACCD,MACC,OAAC,QAAK,GAAG,IAAI,KAAM,EAAG,UAAU,eAC7B,SAAAA,EACH,GAEJ,KAEA,QAAC,OAAI,UAAU,sBACZ,UAAAb,GAASA,EAAM,OAAS,MACvB,OAAC,MAAG,UAAU,sBACX,SAAAA,EAAM,IAAIiB,MACT,OAAC,MAAiB,UAAU,mCAC1B,mBAAC,QAAK,GAAG,OAAO,KAAM,EAAG,KAAMA,EAAK,KAAM,UAAU,qCAAqC,GADlFA,EAAK,EAEd,CACD,EACH,GAEAX,GAAgBC,OAChB,QAAC,OAAI,UAAU,qEACZ,UAAAD,MACC,OAAC,QACC,GAAG,OACH,KAAM,EACN,KAAMA,EACN,UAAU,kEACZ,EAEDC,MACC,OAAC,QAAK,QAASH,EAAU,UAAU,yCAChC,SAAAG,EACH,GAEJ,GAEJ,KAEA,QAAC,OAAI,UAAU,mCACZ,UAAAN,IACEC,KACC,OAAC,UACC,GAAG,IACH,KAAMa,EAAcb,EAAa,OACjC,QAAS,IAAM,CACTa,IACFD,EAAa,EAAE,EACfX,IAAWQ,CAAI,EAEnB,EACA,SAAU,CAACI,EACX,UAAU,iCAET,SAAAd,EACH,KAEA,OAAC,UACC,QAAS,IAAM,CACRc,IAGLD,EAAa,EAAE,EACfX,IAAWQ,CAAI,EACfhB,EAAa,EAAK,EACpB,EACA,SAAU,CAACoB,EACX,UAAU,iCAET,SAAAd,EACH,GAEHO,MACC,OAAC,QACC,GAAG,IACH,KAAM,EACN,MAAM,SACN,KAAMA,EACN,UAAU,8DACZ,GAEJ,GACF,EACF,EACF,EACF,CAEJ,EAEAf,EAAY,YAAc,cAE1B,IAAOL,EAAQK",
|
|
6
|
+
"names": ["ModalVerify_exports", "__export", "ModalVerify_default", "__toCommonJS", "import_jsx_runtime", "React", "import_components", "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"]
|
|
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
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var W=Object.create;var x=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var $=(e,r)=>{for(var o in r)x(e,o,{get:r[o],enumerable:!0})},D=(e,r,o,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Y(r))!_.call(e,l)&&l!==o&&x(e,l,{get:()=>r[l],enumerable:!(u=X(r,l))||u.enumerable});return e};var ee=(e,r,o)=>(o=e!=null?W(Z(e)):{},D(r||!e||!e.__esModule?x(o,"default",{value:e,enumerable:!0}):o,e)),te=e=>D(x({},"__esModule",{value:!0}),e);var ae={};$(ae,{SceneShelfProductsPanel:()=>w});module.exports=te(ae);var t=require("react/jsx-runtime"),f=ee(require("react")),y=require("swiper/react"),P=require("swiper/modules"),n=require("../../helpers/index.js"),i=require("../../components/index.js"),F=require("./context.js"),oe=require("swiper/css");const w=f.forwardRef(({title:e,totalPriceLabel:r,totalCurrentPrice:o,totalOriginalPrice:u,primaryButtonText:l,primaryButtonFun:M,secondaryButtonText:A,secondaryButtonFun:R,bundleDiscountLabel:O,className:z,children:V,...H},j)=>{const a=(0,F.useSceneShelfContext)(),s=a?.classNames,B=r??a?.totalPriceLabel??"Total Price:",p=o??a?.totalCurrentPrice,b=u??a?.totalOriginalPrice,h=l??a?.primaryButtonText??"Shop Now",T=M??a?.primaryButtonFun??"buyNow",S=A??a?.secondaryButtonText??"Add to Cart",N=R??a?.secondaryButtonFun??"addCart",m=O??a?.bundleDiscountLabel,d=a?.selectedProducts??[],E=a?.onLearnMore,q=a?.onShopNow,G=a?.onAddToCart,I=a?.showOriginalPrice??!0,[J,K]=f.useState(!1),[Q,U]=f.useState(!1),L=f.Children.toArray(V),v=async(c,g)=>{if(!c)return;const C=g==="primary"?K:U;C(!0);try{switch(c){case"buyNow":await q?.(d);break;case"addCart":await G?.(d);break;case"learnMore":await E?.(d);break;default:break}}finally{C(!1)}},k=c=>c==="learnMore"?!1:d.length===0;return(0,t.jsxs)("div",{ref:j,className:(0,n.cn)("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",z,s?.content),...H,children:[e&&(0,t.jsx)(i.Heading,{as:"h2",size:3,className:(0,n.cn)("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",s?.title),html:e}),(0,t.jsx)("div",{className:(0,n.cn)("lg-desktop:mb-[24px] mb-[16px] flex-1 ",s?.productList),children:(0,t.jsx)(y.Swiper,{modules:[P.FreeMode,P.Mousewheel],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:10,breakpoints:{0:{slidesPerView:1.5},768:{spaceBetween:16,slidesPerView:2.8},1024:{slidesPerView:2.3},1440:{spaceBetween:16,slidesPerView:L.length<=3?3:3.2}},children:L.map((c,g)=>(0,t.jsx)(y.SwiperSlide,{className:"h-fit shrink-0",children:c},g))})}),(0,t.jsxs)("div",{className:(0,n.cn)("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",s?.footer),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,n.cn)("flex flex-wrap items-center gap-1",s?.totalPrice),children:[B&&(0,t.jsx)(i.Text,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:B}),p&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("text-info-primary lg-desktop:text-[24px] text-[20px]",s?.currentTotalPrice),children:p.formatted}),I&&b&&p&&b.value>p.value&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",s?.originalTotalPrice),children:b.formatted})]}),m&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",s?.bundleDiscountLabel),children:typeof m=="function"?m(d):m})]}),(0,t.jsxs)("div",{className:(0,n.cn)("flex gap-3",s?.buttonGroup),children:[S&&(0,t.jsx)(i.Button,{variant:"secondary",onClick:()=>v(N,"secondary"),disabled:k(N),loading:Q,children:S}),h&&(0,t.jsx)(i.Button,{variant:"primary",onClick:()=>v(T,"primary"),disabled:k(T),loading:J,children:h})]})]})]})});w.displayName="SceneShelf.ProductsPanel";
|
|
2
2
|
//# sourceMappingURL=ProductsPanel.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/SceneShelf/ProductsPanel.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { FreeMode, Mousewheel } from 'swiper/modules'\nimport { cn } from '../../helpers/index.js'\nimport { Heading, Button, Text } from '../../components/index.js'\nimport { useSceneShelfContext } from './context.js'\nimport type { PriceData, ButtonFunctionType } from './types.js'\nimport 'swiper/css'\n\nexport interface SceneShelfProductsPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u6807\u9898 */\n title?: string\n /** \u603B\u4EF7\u6807\u7B7E */\n totalPriceLabel?: string\n /** \u5F53\u524D\u603B\u4EF7 */\n totalCurrentPrice?: PriceData\n /** \u539F\u603B\u4EF7 */\n totalOriginalPrice?: PriceData\n /** \u4E3B\u8981\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u4E3B\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n primaryButtonFun?: ButtonFunctionType\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u6B21\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n secondaryButtonFun?: ButtonFunctionType\n /** \u5B50\u7EC4\u4EF6\uFF08ProductCard \u6216\u81EA\u5B9A\u4E49\u5361\u7247\uFF09 */\n children: React.ReactNode\n}\n\n/**\n * SceneShelf ProductsPanel \u7EC4\u4EF6\n *\n * @description \u4EA7\u54C1\u9762\u677F\u7EC4\u4EF6\uFF0C\u5305\u542B\u4EA7\u54C1\u5217\u8868\uFF08Swiper\uFF09\u548C\u5E95\u90E8\u64CD\u4F5C\u533A\u57DF\uFF08\u603B\u4EF7 + \u6309\u94AE\uFF09\n */\nconst SceneShelfProductsPanel = React.forwardRef<HTMLDivElement, SceneShelfProductsPanelProps>(\n (\n {\n title,\n totalPriceLabel: totalPriceLabelProp,\n totalCurrentPrice: totalCurrentPriceProp,\n totalOriginalPrice: totalOriginalPriceProp,\n primaryButtonText: primaryButtonTextProp,\n primaryButtonFun: primaryButtonFunProp,\n secondaryButtonText: secondaryButtonTextProp,\n secondaryButtonFun: secondaryButtonFunProp,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const context = useSceneShelfContext()\n const classNames = context?.classNames\n\n // Props \u4F18\u5148\u7EA7\u9AD8\u4E8E Context\n const totalPriceLabel = totalPriceLabelProp ?? context?.totalPriceLabel ?? 'Total Price:'\n const totalCurrentPrice = totalCurrentPriceProp ?? context?.totalCurrentPrice\n const totalOriginalPrice = totalOriginalPriceProp ?? context?.totalOriginalPrice\n const primaryButtonText = primaryButtonTextProp ?? context?.primaryButtonText ?? 'Shop Now'\n const primaryButtonFun = primaryButtonFunProp ?? context?.primaryButtonFun ?? 'buyNow'\n const secondaryButtonText = secondaryButtonTextProp ?? context?.secondaryButtonText ?? 'Add to Cart'\n const secondaryButtonFun = secondaryButtonFunProp ?? context?.secondaryButtonFun ?? 'addCart'\n\n const selectedProducts = context?.selectedProducts ?? []\n const onLearnMore = context?.onLearnMore\n const onShopNow = context?.onShopNow\n const onAddToCart = context?.onAddToCart\n const showOriginalPrice = context?.showOriginalPrice ?? true\n\n // \u6309\u94AE loading \u72B6\u6001\n const [primaryLoading, setPrimaryLoading] = React.useState(false)\n const [secondaryLoading, setSecondaryLoading] = React.useState(false)\n\n // \u5C06 children \u8F6C\u6362\u4E3A\u6570\u7EC4\n const childrenArray = React.Children.toArray(children)\n\n // \u6839\u636E\u6309\u94AE\u529F\u80FD\u7C7B\u578B\u8C03\u7528\u76F8\u5E94\u7684\u56DE\u8C03\u51FD\u6570\n const handleButtonClick = async (buttonFun?: ButtonFunctionType, buttonType?: 'primary' | 'secondary') => {\n if (!buttonFun) return\n\n const setLoading = buttonType === 'primary' ? setPrimaryLoading : setSecondaryLoading\n setLoading(true)\n\n try {\n switch (buttonFun) {\n case 'buyNow':\n await onShopNow?.(selectedProducts)\n break\n case 'addCart':\n await onAddToCart?.(selectedProducts)\n break\n case 'learnMore':\n await onLearnMore?.(selectedProducts)\n break\n default:\n break\n }\n } finally {\n setLoading(false)\n }\n }\n\n // \u5224\u65AD\u6309\u94AE\u662F\u5426\u5E94\u8BE5\u88AB\u7981\u7528\uFF08learnMore \u4E0D\u9700\u8981\u68C0\u67E5\u9009\u4E2D\u4EA7\u54C1\u6570\u91CF\uFF09\n const isButtonDisabled = (buttonFun?: ButtonFunctionType) => {\n if (buttonFun === 'learnMore') return false\n return selectedProducts.length === 0\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4',\n className,\n classNames?.content\n )}\n {...props}\n >\n {/* \u6807\u9898 */}\n {title && (\n <Heading\n as=\"h2\"\n size={3}\n className={cn('text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0', classNames?.title)}\n html={title}\n />\n )}\n\n {/* \u4EA7\u54C1\u5217\u8868 - Swiper \u5BB9\u5668 */}\n <div className={cn('lg-desktop:mb-[24px] mb-[16px] flex-1 ', classNames?.productList)}>\n <Swiper\n modules={[FreeMode, Mousewheel]}\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n slidesPerView=\"auto\"\n spaceBetween={10}\n breakpoints={{\n 0: {\n slidesPerView: 1.5,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: 2.8,\n },\n 1024: {\n slidesPerView: 2.3,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: childrenArray.length <= 3 ? 3 : 3.2,\n },\n }}\n >\n {childrenArray.map((child, index) => (\n <SwiperSlide key={index} className=\"h-fit shrink-0\">\n {child}\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n\n {/* \u5E95\u90E8\u533A\u57DF - \u603B\u4EF7 + \u6309\u94AE */}\n <div\n className={cn(\n 'tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2',\n classNames?.footer\n )}\n >\n {/* \u603B\u4EF7 */}\n
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["ProductsPanel_exports", "__export", "SceneShelfProductsPanel", "__toCommonJS", "import_jsx_runtime", "React", "import_react", "import_modules", "import_helpers", "import_components", "import_context", "import_css", "title", "totalPriceLabelProp", "totalCurrentPriceProp", "totalOriginalPriceProp", "primaryButtonTextProp", "primaryButtonFunProp", "secondaryButtonTextProp", "secondaryButtonFunProp", "className", "children", "props", "ref", "context", "classNames", "totalPriceLabel", "totalCurrentPrice", "totalOriginalPrice", "primaryButtonText", "primaryButtonFun", "secondaryButtonText", "secondaryButtonFun", "selectedProducts", "onLearnMore", "onShopNow", "onAddToCart", "showOriginalPrice", "primaryLoading", "setPrimaryLoading", "secondaryLoading", "setSecondaryLoading", "childrenArray", "handleButtonClick", "buttonFun", "buttonType", "setLoading", "isButtonDisabled", "child", "index"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { FreeMode, Mousewheel } from 'swiper/modules'\nimport { cn } from '../../helpers/index.js'\nimport { Heading, Button, Text } from '../../components/index.js'\nimport { useSceneShelfContext } from './context.js'\nimport type { PriceData, ButtonFunctionType, SceneProductCardData } from './types.js'\nimport 'swiper/css'\n\nexport interface SceneShelfProductsPanelProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u6807\u9898 */\n title?: string\n /** \u603B\u4EF7\u6807\u7B7E */\n totalPriceLabel?: string\n /** \u5F53\u524D\u603B\u4EF7 */\n totalCurrentPrice?: PriceData\n /** \u539F\u603B\u4EF7 */\n totalOriginalPrice?: PriceData\n /** \u4E3B\u8981\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u4E3B\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n primaryButtonFun?: ButtonFunctionType\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u6B21\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n secondaryButtonFun?: ButtonFunctionType\n /**\n * \u5957\u9910\u6298\u6263\u6807\u7B7E\uFF0C\u652F\u6301 string \u6216 render prop\n * @param selectedProducts \u5F53\u524D\u9009\u4E2D\u7684\u4EA7\u54C1\u5217\u8868\n */\n bundleDiscountLabel?: string | ((selectedProducts: SceneProductCardData[]) => React.ReactNode)\n /** \u5B50\u7EC4\u4EF6\uFF08ProductCard \u6216\u81EA\u5B9A\u4E49\u5361\u7247\uFF09 */\n children: React.ReactNode\n}\n\n/**\n * SceneShelf ProductsPanel \u7EC4\u4EF6\n *\n * @description \u4EA7\u54C1\u9762\u677F\u7EC4\u4EF6\uFF0C\u5305\u542B\u4EA7\u54C1\u5217\u8868\uFF08Swiper\uFF09\u548C\u5E95\u90E8\u64CD\u4F5C\u533A\u57DF\uFF08\u603B\u4EF7 + \u6309\u94AE\uFF09\n */\nconst SceneShelfProductsPanel = React.forwardRef<HTMLDivElement, SceneShelfProductsPanelProps>(\n (\n {\n title,\n totalPriceLabel: totalPriceLabelProp,\n totalCurrentPrice: totalCurrentPriceProp,\n totalOriginalPrice: totalOriginalPriceProp,\n primaryButtonText: primaryButtonTextProp,\n primaryButtonFun: primaryButtonFunProp,\n secondaryButtonText: secondaryButtonTextProp,\n secondaryButtonFun: secondaryButtonFunProp,\n bundleDiscountLabel: bundleDiscountLabelProp,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const context = useSceneShelfContext()\n const classNames = context?.classNames\n\n // Props \u4F18\u5148\u7EA7\u9AD8\u4E8E Context\n const totalPriceLabel = totalPriceLabelProp ?? context?.totalPriceLabel ?? 'Total Price:'\n const totalCurrentPrice = totalCurrentPriceProp ?? context?.totalCurrentPrice\n const totalOriginalPrice = totalOriginalPriceProp ?? context?.totalOriginalPrice\n const primaryButtonText = primaryButtonTextProp ?? context?.primaryButtonText ?? 'Shop Now'\n const primaryButtonFun = primaryButtonFunProp ?? context?.primaryButtonFun ?? 'buyNow'\n const secondaryButtonText = secondaryButtonTextProp ?? context?.secondaryButtonText ?? 'Add to Cart'\n const secondaryButtonFun = secondaryButtonFunProp ?? context?.secondaryButtonFun ?? 'addCart'\n const bundleDiscountLabel = bundleDiscountLabelProp ?? context?.bundleDiscountLabel\n\n const selectedProducts = context?.selectedProducts ?? []\n const onLearnMore = context?.onLearnMore\n const onShopNow = context?.onShopNow\n const onAddToCart = context?.onAddToCart\n const showOriginalPrice = context?.showOriginalPrice ?? true\n\n // \u6309\u94AE loading \u72B6\u6001\n const [primaryLoading, setPrimaryLoading] = React.useState(false)\n const [secondaryLoading, setSecondaryLoading] = React.useState(false)\n\n // \u5C06 children \u8F6C\u6362\u4E3A\u6570\u7EC4\n const childrenArray = React.Children.toArray(children)\n\n // \u6839\u636E\u6309\u94AE\u529F\u80FD\u7C7B\u578B\u8C03\u7528\u76F8\u5E94\u7684\u56DE\u8C03\u51FD\u6570\n const handleButtonClick = async (buttonFun?: ButtonFunctionType, buttonType?: 'primary' | 'secondary') => {\n if (!buttonFun) return\n\n const setLoading = buttonType === 'primary' ? setPrimaryLoading : setSecondaryLoading\n setLoading(true)\n\n try {\n switch (buttonFun) {\n case 'buyNow':\n await onShopNow?.(selectedProducts)\n break\n case 'addCart':\n await onAddToCart?.(selectedProducts)\n break\n case 'learnMore':\n await onLearnMore?.(selectedProducts)\n break\n default:\n break\n }\n } finally {\n setLoading(false)\n }\n }\n\n // \u5224\u65AD\u6309\u94AE\u662F\u5426\u5E94\u8BE5\u88AB\u7981\u7528\uFF08learnMore \u4E0D\u9700\u8981\u68C0\u67E5\u9009\u4E2D\u4EA7\u54C1\u6570\u91CF\uFF09\n const isButtonDisabled = (buttonFun?: ButtonFunctionType) => {\n if (buttonFun === 'learnMore') return false\n return selectedProducts.length === 0\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4',\n className,\n classNames?.content\n )}\n {...props}\n >\n {/* \u6807\u9898 */}\n {title && (\n <Heading\n as=\"h2\"\n size={3}\n className={cn('text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0', classNames?.title)}\n html={title}\n />\n )}\n\n {/* \u4EA7\u54C1\u5217\u8868 - Swiper \u5BB9\u5668 */}\n <div className={cn('lg-desktop:mb-[24px] mb-[16px] flex-1 ', classNames?.productList)}>\n <Swiper\n modules={[FreeMode, Mousewheel]}\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n slidesPerView=\"auto\"\n spaceBetween={10}\n breakpoints={{\n 0: {\n slidesPerView: 1.5,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: 2.8,\n },\n 1024: {\n slidesPerView: 2.3,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: childrenArray.length <= 3 ? 3 : 3.2,\n },\n }}\n >\n {childrenArray.map((child, index) => (\n <SwiperSlide key={index} className=\"h-fit shrink-0\">\n {child}\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n\n {/* \u5E95\u90E8\u533A\u57DF - \u603B\u4EF7 + \u6309\u94AE */}\n <div\n className={cn(\n 'tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2',\n classNames?.footer\n )}\n >\n <div className=\"flex flex-col\">\n {/* \u603B\u4EF7 */}\n <div className={cn('flex flex-wrap items-center gap-1', classNames?.totalPrice)}>\n {totalPriceLabel && (\n <Text as=\"span\" size={2} className=\"text-info-primary lg-desktop:text-[24px] text-[20px]\">\n {totalPriceLabel}\n </Text>\n )}\n {totalCurrentPrice && (\n <Text\n as=\"span\"\n size={2}\n className={cn('text-info-primary lg-desktop:text-[24px] text-[20px]', classNames?.currentTotalPrice)}\n >\n {totalCurrentPrice.formatted}\n </Text>\n )}\n {showOriginalPrice &&\n totalOriginalPrice &&\n totalCurrentPrice &&\n totalOriginalPrice.value > totalCurrentPrice.value && (\n <Text\n as=\"span\"\n size={2}\n className={cn(\n 'text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through',\n classNames?.originalTotalPrice\n )}\n >\n {totalOriginalPrice.formatted}\n </Text>\n )}\n </div>\n {bundleDiscountLabel && (\n <Text\n as=\"span\"\n size={2}\n className={cn(\n 'lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]',\n classNames?.bundleDiscountLabel\n )}\n >\n {typeof bundleDiscountLabel === 'function'\n ? bundleDiscountLabel(selectedProducts)\n : bundleDiscountLabel}\n </Text>\n )}\n </div>\n\n {/* \u6309\u94AE\u7EC4 */}\n <div className={cn('flex gap-3', classNames?.buttonGroup)}>\n {secondaryButtonText && (\n <Button\n variant=\"secondary\"\n onClick={() => handleButtonClick(secondaryButtonFun, 'secondary')}\n disabled={isButtonDisabled(secondaryButtonFun)}\n loading={secondaryLoading}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button\n variant=\"primary\"\n onClick={() => handleButtonClick(primaryButtonFun, 'primary')}\n disabled={isButtonDisabled(primaryButtonFun)}\n loading={primaryLoading}\n >\n {primaryButtonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n )\n }\n)\n\nSceneShelfProductsPanel.displayName = 'SceneShelf.ProductsPanel'\n\nexport { SceneShelfProductsPanel }\n"],
|
|
5
|
+
"mappings": "ykBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,6BAAAE,IAAA,eAAAC,GAAAH,IAkIU,IAAAI,EAAA,6BAhIVC,EAAuB,qBACvBC,EAAoC,wBACpCC,EAAqC,0BACrCC,EAAmB,kCACnBC,EAAsC,qCACtCC,EAAqC,wBAErCC,GAAO,sBAiCP,MAAMT,EAA0BG,EAAM,WACpC,CACE,CACE,MAAAO,EACA,gBAAiBC,EACjB,kBAAmBC,EACnB,mBAAoBC,EACpB,kBAAmBC,EACnB,iBAAkBC,EAClB,oBAAqBC,EACrB,mBAAoBC,EACpB,oBAAqBC,EACrB,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,MAAMC,KAAU,wBAAqB,EAC/BC,EAAaD,GAAS,WAGtBE,EAAkBd,GAAuBY,GAAS,iBAAmB,eACrEG,EAAoBd,GAAyBW,GAAS,kBACtDI,EAAqBd,GAA0BU,GAAS,mBACxDK,EAAoBd,GAAyBS,GAAS,mBAAqB,WAC3EM,EAAmBd,GAAwBQ,GAAS,kBAAoB,SACxEO,EAAsBd,GAA2BO,GAAS,qBAAuB,cACjFQ,EAAqBd,GAA0BM,GAAS,oBAAsB,UAC9ES,EAAsBd,GAA2BK,GAAS,oBAE1DU,EAAmBV,GAAS,kBAAoB,CAAC,EACjDW,EAAcX,GAAS,YACvBY,EAAYZ,GAAS,UACrBa,EAAcb,GAAS,YACvBc,EAAoBd,GAAS,mBAAqB,GAGlD,CAACe,EAAgBC,CAAiB,EAAIpC,EAAM,SAAS,EAAK,EAC1D,CAACqC,EAAkBC,CAAmB,EAAItC,EAAM,SAAS,EAAK,EAG9DuC,EAAgBvC,EAAM,SAAS,QAAQiB,CAAQ,EAG/CuB,EAAoB,MAAOC,EAAgCC,IAAyC,CACxG,GAAI,CAACD,EAAW,OAEhB,MAAME,EAAaD,IAAe,UAAYN,EAAoBE,EAClEK,EAAW,EAAI,EAEf,GAAI,CACF,OAAQF,EAAW,CACjB,IAAK,SACH,MAAMT,IAAYF,CAAgB,EAClC,MACF,IAAK,UACH,MAAMG,IAAcH,CAAgB,EACpC,MACF,IAAK,YACH,MAAMC,IAAcD,CAAgB,EACpC,MACF,QACE,KACJ,CACF,QAAE,CACAa,EAAW,EAAK,CAClB,CACF,EAGMC,EAAoBH,GACpBA,IAAc,YAAoB,GAC/BX,EAAiB,SAAW,EAGrC,SACE,QAAC,OACC,IAAKX,EACL,aAAW,MACT,kHACAH,EACAK,GAAY,OACd,EACC,GAAGH,EAGH,UAAAX,MACC,OAAC,WACC,GAAG,KACH,KAAM,EACN,aAAW,MAAG,2DAA4Dc,GAAY,KAAK,EAC3F,KAAMd,EACR,KAIF,OAAC,OAAI,aAAW,MAAG,yCAA0Cc,GAAY,WAAW,EAClF,mBAAC,UACC,QAAS,CAAC,WAAU,YAAU,EAC9B,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,cAAc,OACd,aAAc,GACd,YAAa,CACX,EAAG,CACD,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,cAAe,GACjB,EACA,KAAM,CACJ,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,cAAekB,EAAc,QAAU,EAAI,EAAI,GACjD,CACF,EAEC,SAAAA,EAAc,IAAI,CAACM,EAAOC,OACzB,OAAC,eAAwB,UAAU,iBAChC,SAAAD,GADeC,CAElB,CACD,EACH,EACF,KAGA,QAAC,OACC,aAAW,MACT,0FACAzB,GAAY,MACd,EAEA,qBAAC,OAAI,UAAU,gBAEb,qBAAC,OAAI,aAAW,MAAG,oCAAqCA,GAAY,UAAU,EAC3E,UAAAC,MACC,OAAC,QAAK,GAAG,OAAO,KAAM,EAAG,UAAU,uDAChC,SAAAA,EACH,EAEDC,MACC,OAAC,QACC,GAAG,OACH,KAAM,EACN,aAAW,MAAG,uDAAwDF,GAAY,iBAAiB,EAElG,SAAAE,EAAkB,UACrB,EAEDW,GACCV,GACAD,GACAC,EAAmB,MAAQD,EAAkB,UAC3C,OAAC,QACC,GAAG,OACH,KAAM,EACN,aAAW,MACT,uEACAF,GAAY,kBACd,EAEC,SAAAG,EAAmB,UACtB,GAEN,EACCK,MACC,OAAC,QACC,GAAG,OACH,KAAM,EACN,aAAW,MACT,sEACAR,GAAY,mBACd,EAEC,gBAAOQ,GAAwB,WAC5BA,EAAoBC,CAAgB,EACpCD,EACN,GAEJ,KAGA,QAAC,OAAI,aAAW,MAAG,aAAcR,GAAY,WAAW,EACrD,UAAAM,MACC,OAAC,UACC,QAAQ,YACR,QAAS,IAAMa,EAAkBZ,EAAoB,WAAW,EAChE,SAAUgB,EAAiBhB,CAAkB,EAC7C,QAASS,EAER,SAAAV,EACH,EAEDF,MACC,OAAC,UACC,QAAQ,UACR,QAAS,IAAMe,EAAkBd,EAAkB,SAAS,EAC5D,SAAUkB,EAAiBlB,CAAgB,EAC3C,QAASS,EAER,SAAAV,EACH,GAEJ,GACF,GACF,CAEJ,CACF,EAEA5B,EAAwB,YAAc",
|
|
6
|
+
"names": ["ProductsPanel_exports", "__export", "SceneShelfProductsPanel", "__toCommonJS", "import_jsx_runtime", "React", "import_react", "import_modules", "import_helpers", "import_components", "import_context", "import_css", "title", "totalPriceLabelProp", "totalCurrentPriceProp", "totalOriginalPriceProp", "primaryButtonTextProp", "primaryButtonFunProp", "secondaryButtonTextProp", "secondaryButtonFunProp", "bundleDiscountLabelProp", "className", "children", "props", "ref", "context", "classNames", "totalPriceLabel", "totalCurrentPrice", "totalOriginalPrice", "primaryButtonText", "primaryButtonFun", "secondaryButtonText", "secondaryButtonFun", "bundleDiscountLabel", "selectedProducts", "onLearnMore", "onShopNow", "onAddToCart", "showOriginalPrice", "primaryLoading", "setPrimaryLoading", "secondaryLoading", "setSecondaryLoading", "childrenArray", "handleButtonClick", "buttonFun", "buttonType", "setLoading", "isButtonDisabled", "child", "index"]
|
|
7
7
|
}
|
|
@@ -32,6 +32,8 @@ export interface SceneShelfSceneProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
32
32
|
totalCurrentPrice?: PriceData;
|
|
33
33
|
/** 原总价 */
|
|
34
34
|
totalOriginalPrice?: PriceData;
|
|
35
|
+
/** 折扣提示,支持 string 或 render prop */
|
|
36
|
+
bundleDiscountLabel?: string | ((selectedProducts: SceneProductCardData[]) => React.ReactNode);
|
|
35
37
|
/** 初始选中的产品列表(通过 defaultSelected 标记) */
|
|
36
38
|
products?: SceneProductCardData[];
|
|
37
39
|
/** 子组件 */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var A=Object.create;var s=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var G=(e,t)=>{for(var o in t)s(e,o,{get:t[o],enumerable:!0})},T=(e,t,o,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of j(t))!z.call(e,c)&&c!==o&&s(e,c,{get:()=>t[c],enumerable:!(d=I(t,c))||d.enumerable});return e};var J=(e,t,o)=>(o=e!=null?A(q(e)):{},T(t||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e)),K=e=>T(s({},"__esModule",{value:!0}),e);var O={};G(O,{SceneShelfScene:()=>f});module.exports=K(O);var P=require("react/jsx-runtime"),a=J(require("react")),N=require("../../helpers/index.js"),M=require("./context.js");const f=a.forwardRef(({showTags:e=!0,showOriginalPrice:t=!0,classNames:o,onSelectionChange:d,onProductImageClick:c,onLearnMore:p,onShopNow:h,onAddToCart:m,primaryButtonText:C="Shop Now",primaryButtonFun:v="buyNow",secondaryButtonText:x="Add to Cart",secondaryButtonFun:D="addCart",totalPriceLabel:g="Total Price:",totalCurrentPrice:w,totalOriginalPrice:y,bundleDiscountLabel:b,products:S=[],className:E,children:V,defaultSelect:Q,...k},B)=>{const[l,F]=a.useState(()=>{const n=new Set;return S.forEach(r=>{r.defaultSelected&&n.add(r.id)}),n}),i=a.useMemo(()=>S.filter(n=>l.has(n.id)),[S,l]),R=a.useCallback((n,r)=>{F(L=>{const u=new Set(L);return n?u.add(r.id):u.delete(r.id),u})},[]);a.useEffect(()=>{d?.(i)},[i,d]);const H=a.useMemo(()=>({showTags:e,showOriginalPrice:t,classNames:o,selectedIds:l,selectedProducts:i,onSelectChange:R,onProductImageClick:c,onLearnMore:p,onShopNow:h,onAddToCart:m,primaryButtonText:C,primaryButtonFun:v,secondaryButtonText:x,secondaryButtonFun:D,totalPriceLabel:g,totalCurrentPrice:w,totalOriginalPrice:y,bundleDiscountLabel:b}),[e,t,o,l,i,R,c,p,h,m,C,v,x,D,g,w,y,b]);return(0,P.jsx)(M.SceneShelfContext.Provider,{value:H,children:(0,P.jsx)("div",{ref:B,className:(0,N.cn)("rounded-box laptop:flex-row lg-desktop:min-h-[560px] desktop:h-[448px] laptop:min-h-[448px] flex min-h-[560px] w-full flex-col items-stretch gap-0 overflow-hidden",E,o?.scene),...k,children:V})})});f.displayName="SceneShelf.Scene";
|
|
2
2
|
//# sourceMappingURL=Scene.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/SceneShelf/Scene.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { SceneShelfContext, type SceneShelfContextValue } from './context.js'\nimport type { SceneProductCardData, PriceData, ButtonFunctionType } from './types.js'\n\nexport interface SceneShelfSceneProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u662F\u5426\u5C55\u793A\u6807\u7B7E */\n showTags?: boolean\n /** \u662F\u5426\u5C55\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: SceneShelfContextValue['classNames']\n /** \u4EA7\u54C1\u9009\u4E2D\u72B6\u6001\u53D8\u5316\u56DE\u8C03 */\n onSelectionChange?: (selectedProducts: SceneProductCardData[]) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: SceneProductCardData) => void\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u70B9\u51FB\u6DFB\u52A0\u5230\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u4E3B\u8981\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u4E3B\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n primaryButtonFun?: ButtonFunctionType\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u6B21\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n secondaryButtonFun?: ButtonFunctionType\n /** \u603B\u4EF7\u6807\u7B7E */\n totalPriceLabel?: string\n /** \u5F53\u524D\u603B\u4EF7 */\n totalCurrentPrice?: PriceData\n /** \u539F\u603B\u4EF7 */\n totalOriginalPrice?: PriceData\n /** \u521D\u59CB\u9009\u4E2D\u7684\u4EA7\u54C1\u5217\u8868\uFF08\u901A\u8FC7 defaultSelected \u6807\u8BB0\uFF09 */\n products?: SceneProductCardData[]\n /** \u5B50\u7EC4\u4EF6 */\n children: React.ReactNode\n /** \u9ED8\u8BA4\u9009\u4E2D\u7B56\u7565 first|all|none */\n defaultSelect?: 'first' | 'all' | 'none'\n}\n\n/**\n * SceneShelf Scene \u7EC4\u4EF6\n *\n * @description \u5355\u4E2A\u573A\u666F\u5BB9\u5668\uFF0C\u63D0\u4F9B Context \u914D\u7F6E\u548C\u9009\u62E9\u72B6\u6001\u7BA1\u7406\n */\nconst SceneShelfScene = React.forwardRef<HTMLDivElement, SceneShelfSceneProps>(\n (\n {\n showTags = true,\n showOriginalPrice = true,\n classNames,\n onSelectionChange,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onAddToCart,\n primaryButtonText = 'Shop Now',\n primaryButtonFun = 'buyNow',\n secondaryButtonText = 'Add to Cart',\n secondaryButtonFun = 'addCart',\n totalPriceLabel = 'Total Price:',\n totalCurrentPrice,\n totalOriginalPrice,\n products = [],\n className,\n children,\n defaultSelect,\n ...props\n },\n ref\n ) => {\n // \u7BA1\u7406\u9009\u4E2D\u72B6\u6001\n const [selectedIds, setSelectedIds] = React.useState<Set<string>>(() => {\n const initialSelected = new Set<string>()\n products.forEach(product => {\n if (product.defaultSelected) {\n initialSelected.add(product.id)\n }\n })\n return initialSelected\n })\n\n // \u8BA1\u7B97\u9009\u4E2D\u7684\u4EA7\u54C1\n const selectedProducts = React.useMemo(() => {\n return products.filter(product => selectedIds.has(product.id))\n }, [products, selectedIds])\n\n // \u5904\u7406\u9009\u4E2D\u72B6\u6001\u53D8\u5316\n const handleSelectChange = React.useCallback((selected: boolean, product: SceneProductCardData) => {\n setSelectedIds(prev => {\n const newSet = new Set(prev)\n if (selected) {\n newSet.add(product.id)\n } else {\n newSet.delete(product.id)\n }\n return newSet\n })\n }, [])\n\n // \u901A\u77E5\u7236\u7EC4\u4EF6\u9009\u4E2D\u72B6\u6001\u53D8\u5316\n React.useEffect(() => {\n onSelectionChange?.(selectedProducts)\n }, [selectedProducts, onSelectionChange])\n\n const contextValue = React.useMemo<SceneShelfContextValue>(\n () => ({\n showTags,\n showOriginalPrice,\n classNames,\n selectedIds,\n selectedProducts,\n onSelectChange: handleSelectChange,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onAddToCart,\n primaryButtonText,\n primaryButtonFun,\n secondaryButtonText,\n secondaryButtonFun,\n totalPriceLabel,\n totalCurrentPrice,\n totalOriginalPrice,\n }),\n [\n showTags,\n showOriginalPrice,\n classNames,\n selectedIds,\n selectedProducts,\n handleSelectChange,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onAddToCart,\n primaryButtonText,\n primaryButtonFun,\n secondaryButtonText,\n secondaryButtonFun,\n totalPriceLabel,\n totalCurrentPrice,\n totalOriginalPrice,\n ]\n )\n\n return (\n <SceneShelfContext.Provider value={contextValue}>\n <div\n ref={ref}\n className={cn(\n 'rounded-box laptop:flex-row lg-desktop:min-h-[560px] desktop:h-[448px] laptop:min-h-[448px] flex min-h-[560px] w-full flex-col items-stretch gap-0 overflow-hidden',\n className,\n classNames?.scene\n )}\n {...props}\n >\n {children}\n </div>\n </SceneShelfContext.Provider>\n )\n }\n)\n\nSceneShelfScene.displayName = 'SceneShelf.Scene'\n\nexport { SceneShelfScene }\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["Scene_exports", "__export", "SceneShelfScene", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_context", "showTags", "showOriginalPrice", "classNames", "onSelectionChange", "onProductImageClick", "onLearnMore", "onShopNow", "onAddToCart", "primaryButtonText", "primaryButtonFun", "secondaryButtonText", "secondaryButtonFun", "totalPriceLabel", "totalCurrentPrice", "totalOriginalPrice", "products", "className", "children", "defaultSelect", "props", "ref", "selectedIds", "setSelectedIds", "initialSelected", "product", "selectedProducts", "handleSelectChange", "selected", "prev", "newSet", "contextValue"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { SceneShelfContext, type SceneShelfContextValue } from './context.js'\nimport type { SceneProductCardData, PriceData, ButtonFunctionType } from './types.js'\n\nexport interface SceneShelfSceneProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u662F\u5426\u5C55\u793A\u6807\u7B7E */\n showTags?: boolean\n /** \u662F\u5426\u5C55\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: SceneShelfContextValue['classNames']\n /** \u4EA7\u54C1\u9009\u4E2D\u72B6\u6001\u53D8\u5316\u56DE\u8C03 */\n onSelectionChange?: (selectedProducts: SceneProductCardData[]) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: SceneProductCardData) => void\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u70B9\u51FB\u6DFB\u52A0\u5230\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u4E3B\u8981\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u4E3B\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n primaryButtonFun?: ButtonFunctionType\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u6B21\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n secondaryButtonFun?: ButtonFunctionType\n /** \u603B\u4EF7\u6807\u7B7E */\n totalPriceLabel?: string\n /** \u5F53\u524D\u603B\u4EF7 */\n totalCurrentPrice?: PriceData\n /** \u539F\u603B\u4EF7 */\n totalOriginalPrice?: PriceData\n /** \u6298\u6263\u63D0\u793A\uFF0C\u652F\u6301 string \u6216 render prop */\n bundleDiscountLabel?: string | ((selectedProducts: SceneProductCardData[]) => React.ReactNode)\n /** \u521D\u59CB\u9009\u4E2D\u7684\u4EA7\u54C1\u5217\u8868\uFF08\u901A\u8FC7 defaultSelected \u6807\u8BB0\uFF09 */\n products?: SceneProductCardData[]\n /** \u5B50\u7EC4\u4EF6 */\n children: React.ReactNode\n /** \u9ED8\u8BA4\u9009\u4E2D\u7B56\u7565 first|all|none */\n defaultSelect?: 'first' | 'all' | 'none'\n}\n\n/**\n * SceneShelf Scene \u7EC4\u4EF6\n *\n * @description \u5355\u4E2A\u573A\u666F\u5BB9\u5668\uFF0C\u63D0\u4F9B Context \u914D\u7F6E\u548C\u9009\u62E9\u72B6\u6001\u7BA1\u7406\n */\nconst SceneShelfScene = React.forwardRef<HTMLDivElement, SceneShelfSceneProps>(\n (\n {\n showTags = true,\n showOriginalPrice = true,\n classNames,\n onSelectionChange,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onAddToCart,\n primaryButtonText = 'Shop Now',\n primaryButtonFun = 'buyNow',\n secondaryButtonText = 'Add to Cart',\n secondaryButtonFun = 'addCart',\n totalPriceLabel = 'Total Price:',\n totalCurrentPrice,\n totalOriginalPrice,\n bundleDiscountLabel,\n products = [],\n className,\n children,\n defaultSelect,\n ...props\n },\n ref\n ) => {\n // \u7BA1\u7406\u9009\u4E2D\u72B6\u6001\n const [selectedIds, setSelectedIds] = React.useState<Set<string>>(() => {\n const initialSelected = new Set<string>()\n products.forEach(product => {\n if (product.defaultSelected) {\n initialSelected.add(product.id)\n }\n })\n return initialSelected\n })\n\n // \u8BA1\u7B97\u9009\u4E2D\u7684\u4EA7\u54C1\n const selectedProducts = React.useMemo(() => {\n return products.filter(product => selectedIds.has(product.id))\n }, [products, selectedIds])\n\n // \u5904\u7406\u9009\u4E2D\u72B6\u6001\u53D8\u5316\n const handleSelectChange = React.useCallback((selected: boolean, product: SceneProductCardData) => {\n setSelectedIds(prev => {\n const newSet = new Set(prev)\n if (selected) {\n newSet.add(product.id)\n } else {\n newSet.delete(product.id)\n }\n return newSet\n })\n }, [])\n\n // \u901A\u77E5\u7236\u7EC4\u4EF6\u9009\u4E2D\u72B6\u6001\u53D8\u5316\n React.useEffect(() => {\n onSelectionChange?.(selectedProducts)\n }, [selectedProducts, onSelectionChange])\n\n const contextValue = React.useMemo<SceneShelfContextValue>(\n () => ({\n showTags,\n showOriginalPrice,\n classNames,\n selectedIds,\n selectedProducts,\n onSelectChange: handleSelectChange,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onAddToCart,\n primaryButtonText,\n primaryButtonFun,\n secondaryButtonText,\n secondaryButtonFun,\n totalPriceLabel,\n totalCurrentPrice,\n totalOriginalPrice,\n bundleDiscountLabel,\n }),\n [\n showTags,\n showOriginalPrice,\n classNames,\n selectedIds,\n selectedProducts,\n handleSelectChange,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onAddToCart,\n primaryButtonText,\n primaryButtonFun,\n secondaryButtonText,\n secondaryButtonFun,\n totalPriceLabel,\n totalCurrentPrice,\n totalOriginalPrice,\n bundleDiscountLabel,\n ]\n )\n\n return (\n <SceneShelfContext.Provider value={contextValue}>\n <div\n ref={ref}\n className={cn(\n 'rounded-box laptop:flex-row lg-desktop:min-h-[560px] desktop:h-[448px] laptop:min-h-[448px] flex min-h-[560px] w-full flex-col items-stretch gap-0 overflow-hidden',\n className,\n classNames?.scene\n )}\n {...props}\n >\n {children}\n </div>\n </SceneShelfContext.Provider>\n )\n }\n)\n\nSceneShelfScene.displayName = 'SceneShelf.Scene'\n\nexport { SceneShelfScene }\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GA+JQ,IAAAI,EAAA,6BA7JRC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAA+D,wBAiD/D,MAAML,EAAkBG,EAAM,WAC5B,CACE,CACE,SAAAG,EAAW,GACX,kBAAAC,EAAoB,GACpB,WAAAC,EACA,kBAAAC,EACA,oBAAAC,EACA,YAAAC,EACA,UAAAC,EACA,YAAAC,EACA,kBAAAC,EAAoB,WACpB,iBAAAC,EAAmB,SACnB,oBAAAC,EAAsB,cACtB,mBAAAC,EAAqB,UACrB,gBAAAC,EAAkB,eAClB,kBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,SAAAC,EAAW,CAAC,EACZ,UAAAC,EACA,SAAAC,EACA,cAAAC,EACA,GAAGC,CACL,EACAC,IACG,CAEH,KAAM,CAACC,EAAaC,CAAc,EAAI1B,EAAM,SAAsB,IAAM,CACtE,MAAM2B,EAAkB,IAAI,IAC5B,OAAAR,EAAS,QAAQS,GAAW,CACtBA,EAAQ,iBACVD,EAAgB,IAAIC,EAAQ,EAAE,CAElC,CAAC,EACMD,CACT,CAAC,EAGKE,EAAmB7B,EAAM,QAAQ,IAC9BmB,EAAS,OAAOS,GAAWH,EAAY,IAAIG,EAAQ,EAAE,CAAC,EAC5D,CAACT,EAAUM,CAAW,CAAC,EAGpBK,EAAqB9B,EAAM,YAAY,CAAC+B,EAAmBH,IAAkC,CACjGF,EAAeM,GAAQ,CACrB,MAAMC,EAAS,IAAI,IAAID,CAAI,EAC3B,OAAID,EACFE,EAAO,IAAIL,EAAQ,EAAE,EAErBK,EAAO,OAAOL,EAAQ,EAAE,EAEnBK,CACT,CAAC,CACH,EAAG,CAAC,CAAC,EAGLjC,EAAM,UAAU,IAAM,CACpBM,IAAoBuB,CAAgB,CACtC,EAAG,CAACA,EAAkBvB,CAAiB,CAAC,EAExC,MAAM4B,EAAelC,EAAM,QACzB,KAAO,CACL,SAAAG,EACA,kBAAAC,EACA,WAAAC,EACA,YAAAoB,EACA,iBAAAI,EACA,eAAgBC,EAChB,oBAAAvB,EACA,YAAAC,EACA,UAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,iBAAAC,EACA,oBAAAC,EACA,mBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,oBAAAC,CACF,GACA,CACEf,EACAC,EACAC,EACAoB,EACAI,EACAC,EACAvB,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CACF,CACF,EAEA,SACE,OAAC,oBAAkB,SAAlB,CAA2B,MAAOgB,EACjC,mBAAC,OACC,IAAKV,EACL,aAAW,MACT,sKACAJ,EACAf,GAAY,KACd,EACC,GAAGkB,EAEH,SAAAF,EACH,EACF,CAEJ,CACF,EAEAxB,EAAgB,YAAc",
|
|
6
|
+
"names": ["Scene_exports", "__export", "SceneShelfScene", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_context", "showTags", "showOriginalPrice", "classNames", "onSelectionChange", "onProductImageClick", "onLearnMore", "onShopNow", "onAddToCart", "primaryButtonText", "primaryButtonFun", "secondaryButtonText", "secondaryButtonFun", "totalPriceLabel", "totalCurrentPrice", "totalOriginalPrice", "bundleDiscountLabel", "products", "className", "children", "defaultSelect", "props", "ref", "selectedIds", "setSelectedIds", "initialSelected", "product", "selectedProducts", "handleSelectChange", "selected", "prev", "newSet", "contextValue"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SceneShelfSemanticName, SceneProductCardData, PriceData, ButtonFunctionType } from './types.js';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
3
4
|
/**
|
|
4
5
|
* SceneShelf Context 值类型
|
|
5
6
|
*/
|
|
@@ -38,6 +39,8 @@ export interface SceneShelfContextValue {
|
|
|
38
39
|
totalCurrentPrice?: PriceData;
|
|
39
40
|
/** 原总价 */
|
|
40
41
|
totalOriginalPrice?: PriceData;
|
|
42
|
+
/** 折扣提示,支持 string 或 render prop */
|
|
43
|
+
bundleDiscountLabel?: string | ((selectedProducts: SceneProductCardData[]) => ReactNode);
|
|
41
44
|
}
|
|
42
45
|
declare const SceneShelfContext: React.Context<SceneShelfContextValue | null>;
|
|
43
46
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var u=Object.create;var
|
|
1
|
+
"use strict";"use client";var u=Object.create;var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},d=(e,t,o,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l(t))!S.call(e,r)&&r!==o&&n(e,r,{get:()=>t[r],enumerable:!(c=s(t,r))||c.enumerable});return e};var m=(e,t,o)=>(o=e!=null?u(P(e)):{},d(t||!e||!e.__esModule?n(o,"default",{value:e,enumerable:!0}):o,e)),p=e=>d(n({},"__esModule",{value:!0}),e);var f={};C(f,{SceneShelfContext:()=>a,useSceneShelfContext:()=>D});module.exports=p(f);var i=m(require("react"));const a=i.createContext(null);function D(){return i.useContext(a)}
|
|
2
2
|
//# sourceMappingURL=context.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/SceneShelf/context.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport type { SceneShelfSemanticName, SceneProductCardData, PriceData, ButtonFunctionType } from './types.js'\n\n/**\n * SceneShelf Context \u503C\u7C7B\u578B\n */\nexport interface SceneShelfContextValue {\n /** \u662F\u5426\u5C55\u793A\u6807\u7B7E */\n showTags?: boolean\n /** \u662F\u5426\u5C55\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<SceneShelfSemanticName, string>>\n /** \u9009\u4E2D\u7684\u4EA7\u54C1 ID \u96C6\u5408 */\n selectedIds: Set<string>\n /** \u9009\u4E2D\u7684\u4EA7\u54C1\u5217\u8868 */\n selectedProducts: SceneProductCardData[]\n /** \u9009\u4E2D\u72B6\u6001\u53D8\u5316\u56DE\u8C03 */\n onSelectChange: (selected: boolean, product: SceneProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: SceneProductCardData) => void\n /** \u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u6DFB\u52A0\u5230\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u4E3B\u8981\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u4E3B\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n primaryButtonFun?: ButtonFunctionType\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u6B21\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n secondaryButtonFun?: ButtonFunctionType\n /** \u603B\u4EF7\u6807\u7B7E */\n totalPriceLabel?: string\n /** \u5F53\u524D\u603B\u4EF7 */\n totalCurrentPrice?: PriceData\n /** \u539F\u603B\u4EF7 */\n totalOriginalPrice?: PriceData\n}\n\nconst SceneShelfContext = React.createContext<SceneShelfContextValue | null>(null)\n\n/**\n * \u83B7\u53D6 SceneShelf Context\n * @returns Context \u503C\uFF0C\u5982\u679C\u5728 Root \u5916\u4F7F\u7528\u5219\u8FD4\u56DE null\n */\nexport function useSceneShelfContext() {\n return React.useContext(SceneShelfContext)\n}\n\nexport { SceneShelfContext }\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,yBAAAC,IAAA,eAAAC,EAAAJ,GAEA,IAAAK,EAAuB,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport type { SceneShelfSemanticName, SceneProductCardData, PriceData, ButtonFunctionType } from './types.js'\nimport type { ReactNode } from 'react'\n\n/**\n * SceneShelf Context \u503C\u7C7B\u578B\n */\nexport interface SceneShelfContextValue {\n /** \u662F\u5426\u5C55\u793A\u6807\u7B7E */\n showTags?: boolean\n /** \u662F\u5426\u5C55\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<SceneShelfSemanticName, string>>\n /** \u9009\u4E2D\u7684\u4EA7\u54C1 ID \u96C6\u5408 */\n selectedIds: Set<string>\n /** \u9009\u4E2D\u7684\u4EA7\u54C1\u5217\u8868 */\n selectedProducts: SceneProductCardData[]\n /** \u9009\u4E2D\u72B6\u6001\u53D8\u5316\u56DE\u8C03 */\n onSelectChange: (selected: boolean, product: SceneProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: SceneProductCardData) => void\n /** \u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u6DFB\u52A0\u5230\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (selectedProducts: SceneProductCardData[]) => void | Promise<void>\n /** \u4E3B\u8981\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u4E3B\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n primaryButtonFun?: ButtonFunctionType\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u6B21\u8981\u6309\u94AE\u529F\u80FD\u7C7B\u578B */\n secondaryButtonFun?: ButtonFunctionType\n /** \u603B\u4EF7\u6807\u7B7E */\n totalPriceLabel?: string\n /** \u5F53\u524D\u603B\u4EF7 */\n totalCurrentPrice?: PriceData\n /** \u539F\u603B\u4EF7 */\n totalOriginalPrice?: PriceData\n /** \u6298\u6263\u63D0\u793A\uFF0C\u652F\u6301 string \u6216 render prop */\n bundleDiscountLabel?: string | ((selectedProducts: SceneProductCardData[]) => ReactNode)\n}\n\nconst SceneShelfContext = React.createContext<SceneShelfContextValue | null>(null)\n\n/**\n * \u83B7\u53D6 SceneShelf Context\n * @returns Context \u503C\uFF0C\u5982\u679C\u5728 Root \u5916\u4F7F\u7528\u5219\u8FD4\u56DE null\n */\nexport function useSceneShelfContext() {\n return React.useContext(SceneShelfContext)\n}\n\nexport { SceneShelfContext }\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,yBAAAC,IAAA,eAAAC,EAAAJ,GAEA,IAAAK,EAAuB,oBA8CvB,MAAMH,EAAoBG,EAAM,cAA6C,IAAI,EAM1E,SAASF,GAAuB,CACrC,OAAOE,EAAM,WAAWH,CAAiB,CAC3C",
|
|
6
6
|
"names": ["context_exports", "__export", "SceneShelfContext", "useSceneShelfContext", "__toCommonJS", "React"]
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ export type SceneProductCardSemanticName = 'card' | 'cardSelected' | 'tags' | 'c
|
|
|
9
9
|
/**
|
|
10
10
|
* SceneShelf 语义化类名
|
|
11
11
|
*/
|
|
12
|
-
export type SceneShelfSemanticName = 'root' | 'header' | 'title' | 'subtitle' | 'sceneList' | 'scene' | 'content' | 'productList' | 'footer' | 'totalPrice' | 'currentTotalPrice' | 'originalTotalPrice' | 'buttonGroup' | SceneProductCardSemanticName;
|
|
12
|
+
export type SceneShelfSemanticName = 'root' | 'header' | 'title' | 'subtitle' | 'sceneList' | 'scene' | 'content' | 'productList' | 'footer' | 'totalPrice' | 'currentTotalPrice' | 'originalTotalPrice' | 'bundleDiscountLabel' | 'buttonGroup' | SceneProductCardSemanticName;
|
|
13
13
|
/**
|
|
14
14
|
* 产品标签数据
|
|
15
15
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var i=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(t,e,c,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of o(e))!l.call(t,r)&&r!==c&&i(t,r,{get:()=>e[r],enumerable:!(a=n(e,r))||a.enumerable});return t};var d=t=>u(i({},"__esModule",{value:!0}),t);var
|
|
1
|
+
"use strict";"use client";var i=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(t,e,c,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of o(e))!l.call(t,r)&&r!==c&&i(t,r,{get:()=>e[r],enumerable:!(a=n(e,r))||a.enumerable});return t};var d=t=>u(i({},"__esModule",{value:!0}),t);var s={};module.exports=d(s);
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/SceneShelf/types.ts"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\n/**\n * \u6309\u94AE\u529F\u80FD\u7C7B\u578B\n */\nexport type ButtonFunctionType = 'buyNow' | 'addCart' | 'learnMore'\n\n/**\n * \u4EA7\u54C1\u5361\u7247\u8BED\u4E49\u5316\u540D\u79F0\n */\nexport type SceneProductCardSemanticName =\n | 'card'\n | 'cardSelected'\n | 'tags'\n | 'checkbox'\n | 'image'\n | 'title'\n | 'priceWrapper'\n | 'currentPrice'\n | 'originalPrice'\n | 'productPriceLabel'\n\n/**\n * SceneShelf \u8BED\u4E49\u5316\u7C7B\u540D\n */\nexport type SceneShelfSemanticName =\n | 'root'\n | 'header'\n | 'title'\n | 'subtitle'\n | 'sceneList'\n | 'scene'\n | 'content'\n | 'productList'\n | 'footer'\n | 'totalPrice'\n | 'currentTotalPrice'\n | 'originalTotalPrice'\n | 'buttonGroup'\n | SceneProductCardSemanticName\n\n/**\n * \u4EA7\u54C1\u6807\u7B7E\u6570\u636E\n */\nexport interface ProductTag {\n /** \u6807\u7B7E\u6587\u672C */\n label: string\n /** \u6807\u7B7E\u6837\u5F0F\u53D8\u4F53 */\n variant?: 'outline' | 'fill'\n}\n\n/**\n * \u4EF7\u683C\u6570\u636E\u63A5\u53E3\n */\nexport interface PriceData {\n /** \u4EF7\u683C\u6570\u503C */\n value: number\n /** \u683C\u5F0F\u5316\u540E\u7684\u4EF7\u683C\u5B57\u7B26\u4E32 */\n formatted: string\n}\n\n/**\n * \u4EA7\u54C1\u5361\u7247\u6570\u636E\u63A5\u53E3\n */\nexport interface SceneProductCardData {\n /** \u4EA7\u54C1\u552F\u4E00\u6807\u8BC6 */\n id: string\n /** \u4EA7\u54C1\u540D\u79F0 */\n title: string\n /** \u81EA\u5B9A\u4E49\u4EA7\u54C1\u540D\u79F0 */\n custom_name?: string\n /** \u4EA7\u54C1\u56FE\u7247 URL */\n imageUrl: string\n /** \u4EA7\u54C1\u56FE\u7247 Alt */\n imageAlt?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice: PriceData\n /** \u4EF7\u683C\u6807\u7B7E\u6587\u672C\uFF08\u5982 \"Plus Member Price\"\uFF09 */\n priceLabel?: string\n /** \u539F\u4EF7\uFF08\u53EF\u9009\uFF0C\u7528\u4E8E\u663E\u793A\u5220\u9664\u7EBF\u4EF7\u683C\uFF09 */\n originalPrice?: PriceData\n /** \u4EA7\u54C1\u6807\u7B7E\u5217\u8868 */\n tags?: ProductTag[]\n /** \u662F\u5426\u9ED8\u8BA4\u9009\u4E2D */\n defaultSelected?: boolean\n /** \u4EA7\u54C1\u94FE\u63A5 */\n href?: string\n /** \u662F\u5426\u552E\u7F44 */\n soldOut?: boolean\n}\n"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\n/**\n * \u6309\u94AE\u529F\u80FD\u7C7B\u578B\n */\nexport type ButtonFunctionType = 'buyNow' | 'addCart' | 'learnMore'\n\n/**\n * \u4EA7\u54C1\u5361\u7247\u8BED\u4E49\u5316\u540D\u79F0\n */\nexport type SceneProductCardSemanticName =\n | 'card'\n | 'cardSelected'\n | 'tags'\n | 'checkbox'\n | 'image'\n | 'title'\n | 'priceWrapper'\n | 'currentPrice'\n | 'originalPrice'\n | 'productPriceLabel'\n\n/**\n * SceneShelf \u8BED\u4E49\u5316\u7C7B\u540D\n */\nexport type SceneShelfSemanticName =\n | 'root'\n | 'header'\n | 'title'\n | 'subtitle'\n | 'sceneList'\n | 'scene'\n | 'content'\n | 'productList'\n | 'footer'\n | 'totalPrice'\n | 'currentTotalPrice'\n | 'originalTotalPrice'\n | 'bundleDiscountLabel'\n | 'buttonGroup'\n | SceneProductCardSemanticName\n\n/**\n * \u4EA7\u54C1\u6807\u7B7E\u6570\u636E\n */\nexport interface ProductTag {\n /** \u6807\u7B7E\u6587\u672C */\n label: string\n /** \u6807\u7B7E\u6837\u5F0F\u53D8\u4F53 */\n variant?: 'outline' | 'fill'\n}\n\n/**\n * \u4EF7\u683C\u6570\u636E\u63A5\u53E3\n */\nexport interface PriceData {\n /** \u4EF7\u683C\u6570\u503C */\n value: number\n /** \u683C\u5F0F\u5316\u540E\u7684\u4EF7\u683C\u5B57\u7B26\u4E32 */\n formatted: string\n}\n\n/**\n * \u4EA7\u54C1\u5361\u7247\u6570\u636E\u63A5\u53E3\n */\nexport interface SceneProductCardData {\n /** \u4EA7\u54C1\u552F\u4E00\u6807\u8BC6 */\n id: string\n /** \u4EA7\u54C1\u540D\u79F0 */\n title: string\n /** \u81EA\u5B9A\u4E49\u4EA7\u54C1\u540D\u79F0 */\n custom_name?: string\n /** \u4EA7\u54C1\u56FE\u7247 URL */\n imageUrl: string\n /** \u4EA7\u54C1\u56FE\u7247 Alt */\n imageAlt?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice: PriceData\n /** \u4EF7\u683C\u6807\u7B7E\u6587\u672C\uFF08\u5982 \"Plus Member Price\"\uFF09 */\n priceLabel?: string\n /** \u539F\u4EF7\uFF08\u53EF\u9009\uFF0C\u7528\u4E8E\u663E\u793A\u5220\u9664\u7EBF\u4EF7\u683C\uFF09 */\n originalPrice?: PriceData\n /** \u4EA7\u54C1\u6807\u7B7E\u5217\u8868 */\n tags?: ProductTag[]\n /** \u662F\u5426\u9ED8\u8BA4\u9009\u4E2D */\n defaultSelected?: boolean\n /** \u4EA7\u54C1\u94FE\u63A5 */\n href?: string\n /** \u662F\u5426\u552E\u7F44 */\n soldOut?: boolean\n}\n"],
|
|
5
5
|
"mappings": "4XAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
6
|
"names": ["types_exports", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -115,7 +115,7 @@ interface ProductCardInnerProps {
|
|
|
115
115
|
index?: number;
|
|
116
116
|
}
|
|
117
117
|
declare const ProductCardInner: React.MemoExoticComponent<({ product, isShowTag, onImageClick, onProductImageClick, onLearnMore, onShopNow, onAddToCart, secondaryButtonText, secondaryButtonFun, primaryButtonText, primaryButtonFun, classNames, className, theme, index, }: ProductCardInnerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
118
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SceneShelfV2Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
118
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SceneShelfV2Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
119
119
|
readonly $$typeof: symbol;
|
|
120
120
|
};
|
|
121
121
|
export default _default;
|
|
@@ -73,7 +73,7 @@ export interface SceneShelfV3Props extends React.HTMLAttributes<HTMLDivElement>
|
|
|
73
73
|
export interface SceneShelfV3Component extends React.ForwardRefExoticComponent<SceneShelfV3Props & React.RefAttributes<HTMLDivElement>> {
|
|
74
74
|
ProductCard: typeof ProductCard;
|
|
75
75
|
}
|
|
76
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SceneShelfV3Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
76
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SceneShelfV3Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
77
77
|
readonly $$typeof: symbol;
|
|
78
78
|
ProductCard: typeof ProductCard;
|
|
79
79
|
};
|
|
@@ -160,7 +160,7 @@ export interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement>
|
|
|
160
160
|
*/
|
|
161
161
|
isActive?: boolean;
|
|
162
162
|
}
|
|
163
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SecondaryBannerProps & React.RefAttributes<HTMLElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
163
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SecondaryBannerProps & React.RefAttributes<HTMLElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
164
164
|
readonly $$typeof: symbol;
|
|
165
165
|
};
|
|
166
166
|
export default _default;
|
|
@@ -13,5 +13,5 @@ interface SelectStoreType extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
list: SelectStoreDataType[];
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SelectStoreType, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
16
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SelectStoreType, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {};
|
|
17
17
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ShelfDisplayProps } from './shelfDisplay.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<ShelfDisplayProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<ShelfDisplayProps & 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;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { SloganProps } from './types.js';
|
|
3
3
|
export declare const componentType = "copy";
|
|
4
4
|
export declare const componentName = "brand_slogan";
|
|
5
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SloganProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SloganProps & 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,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SpacerProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SpacerProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SpacerProps & 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;
|
|
@@ -5,7 +5,7 @@ export interface SpecsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
5
5
|
onChange?: (product: any, index: number) => void;
|
|
6
6
|
onSecondaryChange?: (data: any) => void;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SpecsProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
8
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SpecsProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
9
9
|
readonly $$typeof: symbol;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SpecsComparisonProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<SpecsComparisonProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SpecsComparisonProps & 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,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TabWithImageProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<TabWithImageProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<TabWithImageProps & 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;
|