@anker-in/headless-ui 1.1.16 → 1.1.17-alpha-1765978730
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/AccordionCards/index.d.ts +17 -0
- package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
- package/dist/cjs/biz-components/AccordionCards/index.js.map +3 -3
- package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +22 -0
- package/dist/cjs/biz-components/AnchorNavigation/index.js +2 -0
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +7 -0
- package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.d.ts +2 -0
- package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.js +2 -0
- package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.js.map +7 -0
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +83 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.d.ts +40 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +2 -2
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
- package/dist/cjs/biz-components/EventSchedule/index.d.ts +39 -0
- package/dist/cjs/biz-components/EventSchedule/index.js +2 -0
- package/dist/cjs/biz-components/EventSchedule/index.js.map +7 -0
- package/dist/cjs/biz-components/FooterNavigation/icons/Subtract.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/icons/Subtract.js.map +2 -2
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.js +1 -1
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/icons/Close.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/Close.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/icons/DownArrow.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/DownArrow.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/icons/LeftArrow.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/LeftArrow.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/icons/RightArrow.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/RightArrow.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +2 -2
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +4 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
- package/dist/cjs/biz-components/Media/index.d.ts +32 -0
- package/dist/cjs/biz-components/Media/index.js +2 -0
- package/dist/cjs/biz-components/Media/index.js.map +7 -0
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +2 -2
- 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/MemberEquity/index.js +2 -2
- package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +35 -0
- package/dist/cjs/biz-components/PromotionalBar/index.js +2 -0
- package/dist/cjs/biz-components/PromotionalBar/index.js.map +7 -0
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js.map +3 -3
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +61 -0
- package/dist/cjs/biz-components/SecondaryBanner/index.js +2 -0
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +2 -2
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/Specs/index.js.map +2 -2
- package/dist/cjs/biz-components/StockShelf/index.d.ts +21 -0
- package/dist/cjs/biz-components/StockShelf/index.js +2 -0
- package/dist/cjs/biz-components/StockShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
- package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/cjs/biz-components/TabsGroup/index.js +1 -1
- package/dist/cjs/biz-components/TabsGroup/index.js.map +2 -2
- package/dist/cjs/biz-components/TextModal/index.js +1 -1
- package/dist/cjs/biz-components/TextModal/index.js.map +2 -2
- package/dist/cjs/biz-components/VideoModal/index.js +1 -1
- package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +5 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/container.js.map +2 -2
- package/dist/cjs/components/drop-down.js +1 -1
- package/dist/cjs/components/drop-down.js.map +2 -2
- package/dist/cjs/components/picture.d.ts +2 -0
- package/dist/cjs/components/picture.js +1 -1
- package/dist/cjs/components/picture.js.map +3 -3
- package/dist/cjs/helpers/ScrollLoadVideo.d.ts +5 -1
- package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
- package/dist/cjs/helpers/ScrollLoadVideo.js.map +3 -3
- package/dist/cjs/stories/HeroBanner.stories.d.ts +4 -1
- package/dist/cjs/stories/HeroBanner.stories.js +2 -2
- package/dist/cjs/stories/HeroBanner.stories.js.map +3 -3
- package/dist/cjs/stories/accordionCards.stories.d.ts +21 -0
- package/dist/cjs/stories/accordionCards.stories.js +1 -1
- package/dist/cjs/stories/accordionCards.stories.js.map +3 -3
- package/dist/cjs/stories/anchorNavigation.stories.d.ts +27 -0
- package/dist/cjs/stories/anchorNavigation.stories.js +2 -0
- package/dist/cjs/stories/anchorNavigation.stories.js.map +7 -0
- package/dist/cjs/stories/buyOneGetOneShelf.stories.d.ts +56 -0
- package/dist/cjs/stories/buyOneGetOneShelf.stories.js +2 -0
- package/dist/cjs/stories/buyOneGetOneShelf.stories.js.map +7 -0
- package/dist/cjs/stories/eventSchedule.stories.d.ts +47 -0
- package/dist/cjs/stories/eventSchedule.stories.js +2 -0
- package/dist/cjs/stories/eventSchedule.stories.js.map +7 -0
- package/dist/cjs/stories/promotionalBar.stories.d.ts +26 -0
- package/dist/cjs/stories/promotionalBar.stories.js +2 -0
- package/dist/cjs/stories/promotionalBar.stories.js.map +7 -0
- package/dist/cjs/stories/secondaryBanner.stories.d.ts +47 -0
- package/dist/cjs/stories/secondaryBanner.stories.js +2 -0
- package/dist/cjs/stories/secondaryBanner.stories.js.map +7 -0
- package/dist/cjs/stories/stockShelf.stories.d.ts +27 -0
- package/dist/cjs/stories/stockShelf.stories.js +2 -0
- package/dist/cjs/stories/stockShelf.stories.js.map +7 -0
- package/dist/esm/biz-components/AccordionCards/index.d.ts +17 -0
- package/dist/esm/biz-components/AccordionCards/index.js +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +22 -0
- package/dist/esm/biz-components/AnchorNavigation/index.js +2 -0
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +7 -0
- package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.d.ts +2 -0
- package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.js +2 -0
- package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.js.map +7 -0
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +83 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.d.ts +40 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js.map +7 -0
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +2 -2
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
- package/dist/esm/biz-components/EventSchedule/index.d.ts +39 -0
- package/dist/esm/biz-components/EventSchedule/index.js +2 -0
- package/dist/esm/biz-components/EventSchedule/index.js.map +7 -0
- package/dist/esm/biz-components/FooterNavigation/icons/Subtract.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/icons/Subtract.js.map +2 -2
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicAttractionBlock/index.js +1 -1
- package/dist/esm/biz-components/GraphicAttractionBlock/index.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/icons/Close.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/Close.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/icons/DownArrow.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/DownArrow.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/icons/LeftArrow.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/LeftArrow.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/icons/RightArrow.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/RightArrow.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/esm/biz-components/HeroBanner/Countdown.js.map +2 -2
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +4 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
- package/dist/esm/biz-components/Media/index.d.ts +32 -0
- package/dist/esm/biz-components/Media/index.js +2 -0
- package/dist/esm/biz-components/Media/index.js.map +7 -0
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +2 -2
- 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/MemberEquity/index.js +2 -2
- package/dist/esm/biz-components/MemberEquity/index.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +35 -0
- package/dist/esm/biz-components/PromotionalBar/index.js +2 -0
- package/dist/esm/biz-components/PromotionalBar/index.js.map +7 -0
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js.map +3 -3
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +61 -0
- package/dist/esm/biz-components/SecondaryBanner/index.js +2 -0
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +2 -2
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/Specs/index.js.map +2 -2
- package/dist/esm/biz-components/StockShelf/index.d.ts +21 -0
- package/dist/esm/biz-components/StockShelf/index.js +2 -0
- package/dist/esm/biz-components/StockShelf/index.js.map +7 -0
- package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
- package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/esm/biz-components/TabsGroup/index.js +1 -1
- package/dist/esm/biz-components/TabsGroup/index.js.map +2 -2
- package/dist/esm/biz-components/TextModal/index.js +1 -1
- package/dist/esm/biz-components/TextModal/index.js.map +2 -2
- package/dist/esm/biz-components/VideoModal/index.js +1 -1
- package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +5 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +2 -2
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.js.map +2 -2
- package/dist/esm/components/drop-down.js +1 -1
- package/dist/esm/components/drop-down.js.map +2 -2
- package/dist/esm/components/picture.d.ts +2 -0
- package/dist/esm/components/picture.js +1 -1
- package/dist/esm/components/picture.js.map +3 -3
- package/dist/esm/helpers/ScrollLoadVideo.d.ts +5 -1
- package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
- package/dist/esm/helpers/ScrollLoadVideo.js.map +3 -3
- package/dist/esm/stories/HeroBanner.stories.d.ts +4 -1
- package/dist/esm/stories/HeroBanner.stories.js +2 -2
- package/dist/esm/stories/HeroBanner.stories.js.map +3 -3
- package/dist/esm/stories/accordionCards.stories.d.ts +21 -0
- package/dist/esm/stories/accordionCards.stories.js +1 -1
- package/dist/esm/stories/accordionCards.stories.js.map +3 -3
- package/dist/esm/stories/anchorNavigation.stories.d.ts +27 -0
- package/dist/esm/stories/anchorNavigation.stories.js +2 -0
- package/dist/esm/stories/anchorNavigation.stories.js.map +7 -0
- package/dist/esm/stories/buyOneGetOneShelf.stories.d.ts +56 -0
- package/dist/esm/stories/buyOneGetOneShelf.stories.js +2 -0
- package/dist/esm/stories/buyOneGetOneShelf.stories.js.map +7 -0
- package/dist/esm/stories/eventSchedule.stories.d.ts +47 -0
- package/dist/esm/stories/eventSchedule.stories.js +2 -0
- package/dist/esm/stories/eventSchedule.stories.js.map +7 -0
- package/dist/esm/stories/promotionalBar.stories.d.ts +26 -0
- package/dist/esm/stories/promotionalBar.stories.js +2 -0
- package/dist/esm/stories/promotionalBar.stories.js.map +7 -0
- package/dist/esm/stories/secondaryBanner.stories.d.ts +47 -0
- package/dist/esm/stories/secondaryBanner.stories.js +2 -0
- package/dist/esm/stories/secondaryBanner.stories.js.map +7 -0
- package/dist/esm/stories/stockShelf.stories.d.ts +27 -0
- package/dist/esm/stories/stockShelf.stories.js +2 -0
- package/dist/esm/stories/stockShelf.stories.js.map +7 -0
- package/package.json +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import{useRef as a,useEffect as S,useState as k}from"react";import{cn as c}from"../helpers/utils.js";const N=({src:d,poster:f,className:p="",videoClassName:m="",autoplay:b=!0,muted:v=!0,loop:g=!0,controls:h=!1,playsInline:y=!0,videoRef:L,intersectionObserverConfig:R={threshold:0,rootMargin:"200px"},...M})=>{const[o,V]=k(!1),E=a(null),t=a(null),e=L||E,{threshold:s,rootMargin:l}=R;return S(()=>{const i=new IntersectionObserver(w=>{w.forEach(I=>{if(I.isIntersecting){if(o||V(!0),e.current){const n=e.current;n.muted=!0,n.currentTime=0,n.play().catch(P=>{console.warn("\u89C6\u9891\u81EA\u52A8\u64AD\u653E\u5931\u8D25:",P)})}}else e.current&&e.current.pause()})},{threshold:s,rootMargin:l}),r=t.current;return r&&i.observe(r),()=>{r&&i.unobserve(r)}},[e,l,o,s]),u("div",{ref:t,className:c("relative size-full",p),children:u("video",{ref:e,src:o?d:void 0,poster:o?f:void 0,className:c("size-full object-cover",m),loop:g,muted:v,controls:h,playsInline:y,preload:"metadata",disablePictureInPicture:!0,"webkit-playsinline":!0,autoPlay:b,...M})})};var x=N;export{x as default};
|
|
2
2
|
//# sourceMappingURL=ScrollLoadVideo.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/ScrollLoadVideo.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useRef, useEffect, useState } from 'react'\nimport { cn } from '../helpers/utils.js'\n\ninterface ScrollLoadVideoProps {\n src: string\n poster?: string\n className?: string\n videoClassName?: string\n autoplay?: boolean\n muted?: boolean\n loop?: boolean\n controls?: boolean\n playsInline?: boolean\n videoRef?: React.RefObject<HTMLVideoElement>\n [key: string]: any\n}\n\nconst ScrollLoadVideo = ({\n src,\n poster,\n className = '',\n videoClassName = '',\n autoplay = true,\n muted = true,\n loop = true,\n controls = false,\n playsInline = true,\n videoRef,\n ...attr\n}: ScrollLoadVideoProps) => {\n const [shouldLoad, setShouldLoad] = useState(false)\n const internalVideoRef = useRef<HTMLVideoElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n\n const currentVideoRef = videoRef || internalVideoRef\n\n // IntersectionObserver \u771F\u6B63\u7684\u61D2\u52A0\u8F7D + \u89C6\u7A97\u64AD\u653E\u63A7\u5236\n useEffect(() => {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // \u7B2C\u4E00\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u624D\u5F00\u59CB\u52A0\u8F7D\u89C6\u9891\n if (!shouldLoad) {\n setShouldLoad(true)\n }\n\n // \u5982\u679C\u5141\u8BB8\u81EA\u52A8\u64AD\u653E\u4E14\u89C6\u9891\u5DF2\u52A0\u8F7D\n if (currentVideoRef.current) {\n const video = currentVideoRef.current\n video.muted = true\n video.currentTime = 0 // \u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u4ECE\u5934\u64AD\u653E\n video.play().catch((error: unknown) => {\n console.warn('\u89C6\u9891\u81EA\u52A8\u64AD\u653E\u5931\u8D25:', error)\n })\n }\n } else if (currentVideoRef.current) {\n // \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u89C6\u9891\n currentVideoRef.current.pause()\n }\n })\n },\n {\n threshold:
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "useRef", "useEffect", "useState", "cn", "ScrollLoadVideo", "src", "poster", "className", "videoClassName", "autoplay", "muted", "loop", "controls", "playsInline", "videoRef", "attr", "shouldLoad", "setShouldLoad", "internalVideoRef", "containerRef", "currentVideoRef", "observer", "entries", "entry", "video", "error", "currentElement", "ScrollLoadVideo_default"]
|
|
4
|
+
"sourcesContent": ["import React, { useRef, useEffect, useState } from 'react'\nimport { cn } from '../helpers/utils.js'\n\ninterface ScrollLoadVideoProps {\n src: string\n poster?: string\n className?: string\n videoClassName?: string\n autoplay?: boolean\n muted?: boolean\n loop?: boolean\n controls?: boolean\n playsInline?: boolean\n videoRef?: React.RefObject<HTMLVideoElement>\n intersectionObserverConfig?: {\n threshold?: number | number[]\n rootMargin?: string\n }\n [key: string]: any\n}\n\nconst ScrollLoadVideo = ({\n src,\n poster,\n className = '',\n videoClassName = '',\n autoplay = true,\n muted = true,\n loop = true,\n controls = false,\n playsInline = true,\n videoRef,\n intersectionObserverConfig = {\n threshold: 0, // \u5F53\u5143\u7D20\u8FDB\u5165\u89C6\u7A97\u65F6\u89E6\u53D1\n rootMargin: '200px', // \u63D0\u524D 200px \u89E6\u53D1\n },\n ...attr\n}: ScrollLoadVideoProps) => {\n const [shouldLoad, setShouldLoad] = useState(false)\n const internalVideoRef = useRef<HTMLVideoElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n\n const currentVideoRef = videoRef || internalVideoRef\n const { threshold, rootMargin } = intersectionObserverConfig\n\n // IntersectionObserver \u771F\u6B63\u7684\u61D2\u52A0\u8F7D + \u89C6\u7A97\u64AD\u653E\u63A7\u5236\n useEffect(() => {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // \u7B2C\u4E00\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u624D\u5F00\u59CB\u52A0\u8F7D\u89C6\u9891\n if (!shouldLoad) {\n setShouldLoad(true)\n }\n\n // \u5982\u679C\u5141\u8BB8\u81EA\u52A8\u64AD\u653E\u4E14\u89C6\u9891\u5DF2\u52A0\u8F7D\n if (currentVideoRef.current) {\n const video = currentVideoRef.current\n video.muted = true\n video.currentTime = 0 // \u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u4ECE\u5934\u64AD\u653E\n video.play().catch((error: unknown) => {\n console.warn('\u89C6\u9891\u81EA\u52A8\u64AD\u653E\u5931\u8D25:', error)\n })\n }\n } else if (currentVideoRef.current) {\n // \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u89C6\u9891\n currentVideoRef.current.pause()\n }\n })\n },\n {\n threshold: threshold,\n rootMargin: rootMargin,\n }\n )\n\n const currentElement = containerRef.current\n if (currentElement) {\n observer.observe(currentElement)\n }\n\n return () => {\n if (currentElement) {\n observer.unobserve(currentElement)\n }\n }\n }, [currentVideoRef, rootMargin, shouldLoad, threshold])\n\n return (\n <div ref={containerRef} className={cn('relative size-full', className)}>\n {/* \u89C6\u9891 */}\n <video\n ref={currentVideoRef}\n src={shouldLoad ? src : undefined} // \u53EA\u6709\u5728\u9700\u8981\u65F6\u624D\u8BBE\u7F6E src\n poster={shouldLoad ? poster : undefined}\n className={cn('size-full object-cover', videoClassName)}\n loop={loop}\n muted={muted}\n controls={controls}\n playsInline={playsInline}\n preload=\"metadata\" // \u5B8C\u5168\u4E0D\u9884\u52A0\u8F7D\n disablePictureInPicture\n // eslint-disable-next-line react/no-unknown-property\n webkit-playsinline\n autoPlay={autoplay}\n {...attr}\n />\n </div>\n )\n}\n\nexport default ScrollLoadVideo\n"],
|
|
5
|
+
"mappings": "AA4FM,cAAAA,MAAA,oBA5FN,OAAgB,UAAAC,EAAQ,aAAAC,EAAW,YAAAC,MAAgB,QACnD,OAAS,MAAAC,MAAU,sBAoBnB,MAAMC,EAAkB,CAAC,CACvB,IAAAC,EACA,OAAAC,EACA,UAAAC,EAAY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B,GAEvB,qBAAkB,GAClB,SAAUJ,EACT,GAAGO,EACN,EACF,CAEJ,EAEA,IAAOc,EAAQ1B",
|
|
6
|
+
"names": ["jsx", "useRef", "useEffect", "useState", "cn", "ScrollLoadVideo", "src", "poster", "className", "videoClassName", "autoplay", "muted", "loop", "controls", "playsInline", "videoRef", "intersectionObserverConfig", "attr", "shouldLoad", "setShouldLoad", "internalVideoRef", "containerRef", "currentVideoRef", "threshold", "rootMargin", "observer", "entries", "entry", "video", "error", "currentElement", "ScrollLoadVideo_default"]
|
|
7
7
|
}
|
|
@@ -3,7 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import HeroBanner from '../biz-components/HeroBanner/HeroBanner.js';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: React.ForwardRefExoticComponent<Omit<Omit<import("../biz-components/HeroBanner/types.js").HeroBannerProps &
|
|
6
|
+
component: React.ForwardRefExoticComponent<Omit<Omit<import("../biz-components/HeroBanner/types.js").HeroBannerProps & {
|
|
7
|
+
classNames?: Partial<Record<import("../biz-components/HeroBanner/HeroBanner.js").HeroBannerSemanticName, string>>;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps & import("../shared/Styles.js").ContainerProps> & {
|
|
7
9
|
className?: string;
|
|
8
10
|
data?: Record<string, any>;
|
|
9
11
|
}, "ref"> & React.RefAttributes<any>>;
|
|
@@ -25,4 +27,5 @@ export declare const MultiBanner: () => import("react/jsx-runtime").JSX.Element;
|
|
|
25
27
|
export declare const WithoutSecondaryButton: Story;
|
|
26
28
|
export declare const WithVideoModal: Story;
|
|
27
29
|
export declare const WithYoutubeVideo: Story;
|
|
30
|
+
export declare const WithSemanticClassNames: Story;
|
|
28
31
|
export declare const ScrollableBackgroundVideo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as t,jsxs as a}from"react/jsx-runtime";import"react";import i from"../biz-components/HeroBanner/HeroBanner.js";const
|
|
1
|
+
import{jsx as t,jsxs as a}from"react/jsx-runtime";import"react";import i from"../biz-components/HeroBanner/HeroBanner.js";const m={title:"Biz-Components/HeroBanner",component:i,parameters:{layout:"fullscreen",docs:{description:{component:`
|
|
2
2
|
HeroBanner \u7EC4\u4EF6\u7528\u4E8E\u5C55\u793A\u7F51\u7AD9\u7684\u4E3B\u8981\u5185\u5BB9\u533A\u57DF\uFF0C\u901A\u5E38\u5305\u542B\u6807\u9898\u3001\u526F\u6807\u9898\u548C\u884C\u52A8\u6309\u94AE\u3002
|
|
3
3
|
|
|
4
4
|
### \u7279\u70B9
|
|
@@ -7,5 +7,5 @@ HeroBanner \u7EC4\u4EF6\u7528\u4E8E\u5C55\u793A\u7F51\u7AD9\u7684\u4E3B\u8981\u5
|
|
|
7
7
|
- \u53EF\u914D\u7F6E\u4E3B\u6309\u94AE\u548C\u6B21\u8981\u6309\u94AE
|
|
8
8
|
- \u53EF\u914D\u7F6E\u6A21\u5757\u8DF3\u8F6C\u94FE\u63A5
|
|
9
9
|
- \u652F\u6301\u5E95\u90E8\u7279\u6027\u5217\u8868
|
|
10
|
-
`}}},tags:["autodocs"]};var p=r;const e="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206",c="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206",o="https://cdn.shopify.com/s/files/1/0517/6767/3016/files/87e32d61fc407d5e6c8aff00f3453072.jpg?v=1745999899",m={args:{data:{title:"Anker Laptop Power",subtitle:"Anker Prime 240W GaN Desktop Charger (4 Ports)",pcImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},theme:"light",blockLink:"/this-is-block-link",primaryButton:{text:"Shop Now",link:"/this-is-shop-now-link"},secondaryButton:{text:"Learn More",link:"/this-is-learn-more-link"},caption:[{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"},{title:"Anker Prime 27,650mAh Power Bank (250W)"},{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"}],endDate:"2025-11-15T03:32:00.000Z",endDate_tz:"America/Sao_Paulo",dateFormat:'{"day":"Day","hour":"Hours","minute":"Mins","second":"Secs"}'}}},l={args:{data:{title:"Power Your Life",subtitle:"Experience the next generation of charging technology with our innovative solutions designed for modern life.",pcImage:{url:o,alt:"dark background",thumbnailURL:o,mimeType:"image/jpeg"},mobileImage:{url:o,alt:"dark background",thumbnailURL:o,mimeType:"image/jpeg"},theme:"dark",primaryButton:{text:"Shop Now"},secondaryButton:{text:"Learn More"},caption:[{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"},{title:"Anker Prime 27,650mAh Power Bank (250W)"},{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"}]}}},b=()=>a("div",{className:"flex flex-col",children:[t(i,{data:{...m.args.data,size:"sm"}}),t(i,{data:{...l.args.data,size:"sm"},className:"mt-[8px]"})]}),u={args:{data:{title:"Future of Charging",subtitle:"Step into the future with our revolutionary charging solutions that redefine the way you power your devices.",pcImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},theme:"light",primaryButton:{text:"Shop Now"},caption:[{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"},{title:"Anker Prime 27,650mAh Power Bank (250W)"},{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"}]}}},h={args:{data:{title:"Experience Anker Innovation",subtitle:"Watch our latest product demo and discover the future of charging technology",pcImage:{url:e,alt:"tech background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"tech background mobile",thumbnailURL:e,mimeType:"image/jpeg"},theme:"dark",primaryButton:{text:"Shop Now",link:"/shop"},secondaryButton:{text:"Learn More",link:"/learn-more",isShowPlayVideoButton:!0,playVideoButtonText:"Watch Demo",playIcon:!0,videoUrl:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"product demo video",thumbnailURL:e,mimeType:"video/mp4"}},caption:[{title:"Anker Prime 240W GaN Desktop Charger"},{title:"Anker PowerCore 27,650mAh Power Bank"},{title:"Anker Wireless Charging Station"}]}}},g={args:{data:{title:"Anker Prime Series",subtitle:"See our Prime series in action. Experience the power that drives innovation.",pcImage:{url:e,alt:"anker products",thumbnailURL:e,mimeType:"image/jpeg"},padImage:{url:e,alt:"anker products pad",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"anker products mobile",thumbnailURL:e,mimeType:"image/jpeg"},theme:"light",primaryButton:{text:"Buy Now",link:"/buy"},secondaryButton:{text:"Explore",link:"/explore",isShowPlayVideoButton:!0,playVideoButtonText:"Watch on YouTube",youtubeId:"dQw4w9WgXcQ"},caption:[{title:"Prime 240W Desktop Charger"},{title:"Prime 27,650mAh Power Bank"},{title:"Prime 100W Wireless Charger"}]}}},y=()=>a("div",{className:"min-h-[500vh]",children:[t(i,{data:{theme:"dark",title:"Powered by Innovation",subtitle:"Scroll down to test IntersectionObserver - videos play only when in viewport and restart from beginning each time.",pcImage:{url:e,alt:"fallback background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"fallback background mobile",thumbnailURL:e,mimeType:"image/jpeg"},pcVideo:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"background video desktop",thumbnailURL:e,mimeType:"video/mp4"},padVideo:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"background video tablet",thumbnailURL:e,mimeType:"video/mp4"},mobileVideo:{url:"https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4",alt:"background video mobile",thumbnailURL:e,mimeType:"video/mp4"},isShowVideo:!0,primaryButton:{text:"First Video",link:"/first"},secondaryButton:{text:"Learn More",link:"/learn"},caption:[{title:"IntersectionObserver Controlled"},{title:"Auto Play on Viewport Entry"},{title:"Restart from Beginning"}]}}),t("div",{className:"bg-gradient-to-b from-gray-900 to-black py-20 text-white",children:a("div",{className:"container mx-auto max-w-4xl px-4",children:[t("h2",{className:"mb-8 text-center text-4xl font-bold",children:"IntersectionObserver \u89C6\u9891\u63A7\u5236"}),a("div",{className:"space-y-8",children:[a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u667A\u80FD\u89C6\u9891\u64AD\u653E"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u89C6\u9891\u53EA\u5728\u8FDB\u5165\u89C6\u7A97\u65F6\u64AD\u653E\uFF0C\u79BB\u5F00\u89C6\u7A97\u65F6\u81EA\u52A8\u6682\u505C\u3002\u6BCF\u6B21\u91CD\u65B0\u8FDB\u5165\u89C6\u7A97\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u4E00\u81F4\u7684\u89C2\u770B\u4F53\u9A8C\u3002\u4F7F\u7528 IntersectionObserver API \u5B9E\u73B0\u7CBE\u51C6\u7684\u89C6\u7A97\u68C0\u6D4B\u3002"})]}),a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u6027\u80FD\u4F18\u5316"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u6682\u505C\u64AD\u653E\uFF0C\u51CF\u5C11CPU\u548C\u5185\u5B58\u5360\u7528\u3002\u63D0\u524D50px\u5F00\u59CB\u68C0\u6D4B\uFF0C \u786E\u4FDD\u89C6\u9891\u5728\u7528\u6237\u770B\u5230\u65F6\u5DF2\u7ECF\u51C6\u5907\u5C31\u7EEA\u3002threshold\u8BBE\u7F6E\u4E3A0.1\uFF0C\u5F5310%\u5143\u7D20\u53EF\u89C1\u65F6\u89E6\u53D1\u3002"})]})]})]})}),t(i,{data:{title:"Second Video Banner",subtitle:"This is the second video to test multiple banners with IntersectionObserver.",pcImage:{url:o,alt:"second banner background",thumbnailURL:o,mimeType:"image/jpeg"},mobileImage:{url:o,alt:"second banner mobile",thumbnailURL:o,mimeType:"image/jpeg"},pcVideo:{url:"https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_2mb.mp4",alt:"second video desktop",thumbnailURL:o,mimeType:"video/mp4"},padVideo:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"second video tablet",thumbnailURL:o,mimeType:"video/mp4"},mobileVideo:{url:"https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4",alt:"second video mobile",thumbnailURL:o,mimeType:"video/mp4"},isShowVideo:!0,primaryButton:{text:"Second Video",link:"/second"},secondaryButton:{text:"Explore More",link:"/explore"},caption:[{title:"Independent Video Control"},{title:"Pause When Out of View"},{title:"Resource Efficient"}]}}),t("div",{className:"bg-gradient-to-b from-black to-gray-900 py-20 text-white",children:a("div",{className:"container mx-auto max-w-4xl px-4",children:[t("h2",{className:"mb-8 text-center text-4xl font-bold",children:"\u591A\u89C6\u9891\u7BA1\u7406"}),a("div",{className:"space-y-8",children:[a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u72EC\u7ACB\u63A7\u5236"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u6BCF\u4E2A\u89C6\u9891banner\u90FD\u6709\u72EC\u7ACB\u7684IntersectionObserver\uFF0C\u4E92\u4E0D\u5E72\u6270\u3002 \u5F53\u4E00\u4E2A\u89C6\u9891\u64AD\u653E\u65F6\uFF0C\u5176\u4ED6\u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u4FDD\u6301\u6682\u505C\u72B6\u6001\u3002"})]}),a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u7528\u6237\u4F53\u9A8C"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u6EDA\u52A8\u65F6\u7528\u6237\u770B\u5230\u7684\u6BCF\u4E2A\u89C6\u9891\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u5B8C\u6574\u7684\u89C2\u770B\u4F53\u9A8C\u3002 \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u53EF\u4EE5\u8282\u7701\u8BBE\u5907\u8D44\u6E90\u548C\u7F51\u7EDC\u6D41\u91CF\u3002"})]})]})]})}),t(i,{data:{title:"Third Video Experience",subtitle:"Final banner to demonstrate seamless video management across multiple sections.",pcImage:{url:e,alt:"third banner background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"third banner mobile",thumbnailURL:e,mimeType:"image/jpeg"},pcVideo:{url:"https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4",alt:"third video desktop",thumbnailURL:e,mimeType:"video/mp4"},padVideo:{url:"https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4",alt:"third video tablet",thumbnailURL:e,mimeType:"video/mp4"},mobileVideo:{url:"https://cdn.shopify.com/videos/c/o/v/50981dfe2910408fa76436ca394cbc6f.mp4",alt:"third video mobile",thumbnailURL:e,mimeType:"video/mp4"},theme:"dark",isShowVideo:!0,primaryButton:{text:"Third Video",link:"/third"},secondaryButton:{text:"Complete Test",link:"/complete"},caption:[{title:"Seamless Performance"},{title:"Multiple Video Management"},{title:"Optimized for All Devices"}]}}),t("div",{className:"bg-black py-20 text-white",children:a("div",{className:"container mx-auto px-4 text-center",children:[t("h2",{className:"mb-4 text-3xl font-bold",children:"IntersectionObserver \u6D4B\u8BD5\u5B8C\u6210"}),t("p",{className:"mb-8 text-gray-400",children:"\u6EDA\u52A8\u56DE\u9876\u90E8\u518D\u6B21\u6D4B\u8BD5\u89C6\u9891\u8FDB\u5165\u548C\u79BB\u5F00\u89C6\u7A97\u7684\u6548\u679C"}),a("div",{className:"mx-auto grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-3",children:[a("div",{className:"rounded border border-gray-700 p-6",children:[t("h4",{className:"mb-2 text-lg font-semibold",children:"\u667A\u80FD\u64AD\u653E"}),t("p",{className:"text-sm text-gray-400",children:"\u8FDB\u5165\u89C6\u7A97\u81EA\u52A8\u64AD\u653E\uFF0C\u79BB\u5F00\u81EA\u52A8\u6682\u505C"})]}),a("div",{className:"rounded border border-gray-700 p-6",children:[t("h4",{className:"mb-2 text-lg font-semibold",children:"\u4ECE\u5934\u64AD\u653E"}),t("p",{className:"text-sm text-gray-400",children:"\u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u90FD\u4ECE\u89C6\u9891\u5F00\u5934\u5F00\u59CB"})]}),a("div",{className:"rounded border border-gray-700 p-6",children:[t("h4",{className:"mb-2 text-lg font-semibold",children:"\u6027\u80FD\u4F18\u5316"}),t("p",{className:"text-sm text-gray-400",children:"\u591A\u89C6\u9891\u72EC\u7ACB\u63A7\u5236\uFF0C\u8D44\u6E90\u9AD8\u6548\u5229\u7528"})]})]})]})})]});export{l as DarkTheme,m as LightTheme,b as MultiBanner,y as ScrollableBackgroundVideo,h as WithVideoModal,g as WithYoutubeVideo,u as WithoutSecondaryButton,p as default};
|
|
10
|
+
`}}},tags:["autodocs"]};var p=m;const e="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206",c="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206",o="https://cdn.shopify.com/s/files/1/0517/6767/3016/files/87e32d61fc407d5e6c8aff00f3453072.jpg?v=1745999899",r={args:{data:{title:"Anker Laptop Power",subtitle:"Anker Prime 240W GaN Desktop Charger (4 Ports)",pcImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},theme:"light",blockLink:"/this-is-block-link",primaryButton:{text:"Shop Now",link:"/this-is-shop-now-link"},secondaryButton:{text:"Learn More",link:"/this-is-learn-more-link"},caption:[{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"},{title:"Anker Prime 27,650mAh Power Bank (250W)"},{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"}],endDate:"2025-11-15T03:32:00.000Z",endDate_tz:"America/Sao_Paulo",dateFormat:'{"day":"Day","hour":"Hours","minute":"Mins","second":"Secs"}'}}},n={args:{data:{title:"Power Your Life",subtitle:"Experience the next generation of charging technology with our innovative solutions designed for modern life.",pcImage:{url:o,alt:"dark background",thumbnailURL:o,mimeType:"image/jpeg"},mobileImage:{url:o,alt:"dark background",thumbnailURL:o,mimeType:"image/jpeg"},theme:"dark",primaryButton:{text:"Shop Now"},secondaryButton:{text:"Learn More"},caption:[{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"},{title:"Anker Prime 27,650mAh Power Bank (250W)"},{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"}]}}},b=()=>a("div",{className:"flex flex-col",children:[t(i,{data:{...r.args.data,size:"sm"}}),t(i,{data:{...n.args.data,size:"sm"},className:"mt-[8px]"})]}),u={args:{data:{title:"Future of Charging",subtitle:"Step into the future with our revolutionary charging solutions that redefine the way you power your devices.",pcImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"default background",thumbnailURL:e,mimeType:"image/jpeg"},theme:"light",primaryButton:{text:"Shop Now"},caption:[{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"},{title:"Anker Prime 27,650mAh Power Bank (250W)"},{title:"Anker Prime 240W GaN Desktop Charger (4 Ports)"}]}}},g={args:{data:{title:"Experience Anker Innovation",subtitle:"Watch our latest product demo and discover the future of charging technology",pcImage:{url:e,alt:"tech background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"tech background mobile",thumbnailURL:e,mimeType:"image/jpeg"},theme:"dark",primaryButton:{text:"Shop Now",link:"/shop"},secondaryButton:{text:"Learn More",link:"/learn-more",isShowPlayVideoButton:!0,playVideoButtonText:"Watch Demo",playIcon:!0,videoUrl:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"product demo video",thumbnailURL:e,mimeType:"video/mp4"}},caption:[{title:"Anker Prime 240W GaN Desktop Charger"},{title:"Anker PowerCore 27,650mAh Power Bank"},{title:"Anker Wireless Charging Station"}]}}},h={args:{data:{title:"Anker Prime Series",subtitle:"See our Prime series in action. Experience the power that drives innovation.",pcImage:{url:e,alt:"anker products",thumbnailURL:e,mimeType:"image/jpeg"},padImage:{url:e,alt:"anker products pad",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"anker products mobile",thumbnailURL:e,mimeType:"image/jpeg"},theme:"light",primaryButton:{text:"Buy Now",link:"/buy"},secondaryButton:{text:"Explore",link:"/explore",isShowPlayVideoButton:!0,playVideoButtonText:"Watch on YouTube",youtubeId:"dQw4w9WgXcQ"},caption:[{title:"Prime 240W Desktop Charger"},{title:"Prime 27,650mAh Power Bank"},{title:"Prime 100W Wireless Charger"}]}}},y={args:{data:r.args.data,classNames:{root:"",title:" text-red-500",subtitle:"text-blue-500",buttonGroup:"justify-left mt-[200px]",primaryButton:"shadow-lg",secondaryButton:"custom-secondary-btn",captionGroup:"bg-black/40"}}},v=()=>a("div",{className:"min-h-[500vh]",children:[t(i,{data:{theme:"dark",title:"Powered by Innovation",subtitle:"Scroll down to test IntersectionObserver - videos play only when in viewport and restart from beginning each time.",pcImage:{url:e,alt:"fallback background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"fallback background mobile",thumbnailURL:e,mimeType:"image/jpeg"},pcVideo:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"background video desktop",thumbnailURL:e,mimeType:"video/mp4"},padVideo:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"background video tablet",thumbnailURL:e,mimeType:"video/mp4"},mobileVideo:{url:"https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4",alt:"background video mobile",thumbnailURL:e,mimeType:"video/mp4"},isShowVideo:!0,primaryButton:{text:"First Video",link:"/first"},secondaryButton:{text:"Learn More",link:"/learn"},caption:[{title:"IntersectionObserver Controlled"},{title:"Auto Play on Viewport Entry"},{title:"Restart from Beginning"}]}}),t("div",{className:"bg-gradient-to-b from-gray-900 to-black py-20 text-white",children:a("div",{className:"container mx-auto max-w-4xl px-4",children:[t("h2",{className:"mb-8 text-center text-4xl font-bold",children:"IntersectionObserver \u89C6\u9891\u63A7\u5236"}),a("div",{className:"space-y-8",children:[a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u667A\u80FD\u89C6\u9891\u64AD\u653E"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u89C6\u9891\u53EA\u5728\u8FDB\u5165\u89C6\u7A97\u65F6\u64AD\u653E\uFF0C\u79BB\u5F00\u89C6\u7A97\u65F6\u81EA\u52A8\u6682\u505C\u3002\u6BCF\u6B21\u91CD\u65B0\u8FDB\u5165\u89C6\u7A97\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u4E00\u81F4\u7684\u89C2\u770B\u4F53\u9A8C\u3002\u4F7F\u7528 IntersectionObserver API \u5B9E\u73B0\u7CBE\u51C6\u7684\u89C6\u7A97\u68C0\u6D4B\u3002"})]}),a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u6027\u80FD\u4F18\u5316"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u6682\u505C\u64AD\u653E\uFF0C\u51CF\u5C11CPU\u548C\u5185\u5B58\u5360\u7528\u3002\u63D0\u524D50px\u5F00\u59CB\u68C0\u6D4B\uFF0C \u786E\u4FDD\u89C6\u9891\u5728\u7528\u6237\u770B\u5230\u65F6\u5DF2\u7ECF\u51C6\u5907\u5C31\u7EEA\u3002threshold\u8BBE\u7F6E\u4E3A0.1\uFF0C\u5F5310%\u5143\u7D20\u53EF\u89C1\u65F6\u89E6\u53D1\u3002"})]})]})]})}),t(i,{data:{title:"Second Video Banner",subtitle:"This is the second video to test multiple banners with IntersectionObserver.",pcImage:{url:o,alt:"second banner background",thumbnailURL:o,mimeType:"image/jpeg"},mobileImage:{url:o,alt:"second banner mobile",thumbnailURL:o,mimeType:"image/jpeg"},pcVideo:{url:"https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_2mb.mp4",alt:"second video desktop",thumbnailURL:o,mimeType:"video/mp4"},padVideo:{url:"https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4",alt:"second video tablet",thumbnailURL:o,mimeType:"video/mp4"},mobileVideo:{url:"https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4",alt:"second video mobile",thumbnailURL:o,mimeType:"video/mp4"},isShowVideo:!0,primaryButton:{text:"Second Video",link:"/second"},secondaryButton:{text:"Explore More",link:"/explore"},caption:[{title:"Independent Video Control"},{title:"Pause When Out of View"},{title:"Resource Efficient"}]}}),t("div",{className:"bg-gradient-to-b from-black to-gray-900 py-20 text-white",children:a("div",{className:"container mx-auto max-w-4xl px-4",children:[t("h2",{className:"mb-8 text-center text-4xl font-bold",children:"\u591A\u89C6\u9891\u7BA1\u7406"}),a("div",{className:"space-y-8",children:[a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u72EC\u7ACB\u63A7\u5236"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u6BCF\u4E2A\u89C6\u9891banner\u90FD\u6709\u72EC\u7ACB\u7684IntersectionObserver\uFF0C\u4E92\u4E0D\u5E72\u6270\u3002 \u5F53\u4E00\u4E2A\u89C6\u9891\u64AD\u653E\u65F6\uFF0C\u5176\u4ED6\u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u4FDD\u6301\u6682\u505C\u72B6\u6001\u3002"})]}),a("div",{className:"rounded-lg bg-gray-800 p-8",children:[t("h3",{className:"mb-4 text-2xl font-semibold",children:"\u7528\u6237\u4F53\u9A8C"}),t("p",{className:"leading-relaxed text-gray-300",children:"\u6EDA\u52A8\u65F6\u7528\u6237\u770B\u5230\u7684\u6BCF\u4E2A\u89C6\u9891\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u5B8C\u6574\u7684\u89C2\u770B\u4F53\u9A8C\u3002 \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u53EF\u4EE5\u8282\u7701\u8BBE\u5907\u8D44\u6E90\u548C\u7F51\u7EDC\u6D41\u91CF\u3002"})]})]})]})}),t(i,{data:{title:"Third Video Experience",subtitle:"Final banner to demonstrate seamless video management across multiple sections.",pcImage:{url:e,alt:"third banner background",thumbnailURL:e,mimeType:"image/jpeg"},mobileImage:{url:e,alt:"third banner mobile",thumbnailURL:e,mimeType:"image/jpeg"},pcVideo:{url:"https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4",alt:"third video desktop",thumbnailURL:e,mimeType:"video/mp4"},padVideo:{url:"https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4",alt:"third video tablet",thumbnailURL:e,mimeType:"video/mp4"},mobileVideo:{url:"https://cdn.shopify.com/videos/c/o/v/50981dfe2910408fa76436ca394cbc6f.mp4",alt:"third video mobile",thumbnailURL:e,mimeType:"video/mp4"},theme:"dark",isShowVideo:!0,primaryButton:{text:"Third Video",link:"/third"},secondaryButton:{text:"Complete Test",link:"/complete"},caption:[{title:"Seamless Performance"},{title:"Multiple Video Management"},{title:"Optimized for All Devices"}]}}),t("div",{className:"bg-black py-20 text-white",children:a("div",{className:"container mx-auto px-4 text-center",children:[t("h2",{className:"mb-4 text-3xl font-bold",children:"IntersectionObserver \u6D4B\u8BD5\u5B8C\u6210"}),t("p",{className:"mb-8 text-gray-400",children:"\u6EDA\u52A8\u56DE\u9876\u90E8\u518D\u6B21\u6D4B\u8BD5\u89C6\u9891\u8FDB\u5165\u548C\u79BB\u5F00\u89C6\u7A97\u7684\u6548\u679C"}),a("div",{className:"mx-auto grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-3",children:[a("div",{className:"rounded border border-gray-700 p-6",children:[t("h4",{className:"mb-2 text-lg font-semibold",children:"\u667A\u80FD\u64AD\u653E"}),t("p",{className:"text-sm text-gray-400",children:"\u8FDB\u5165\u89C6\u7A97\u81EA\u52A8\u64AD\u653E\uFF0C\u79BB\u5F00\u81EA\u52A8\u6682\u505C"})]}),a("div",{className:"rounded border border-gray-700 p-6",children:[t("h4",{className:"mb-2 text-lg font-semibold",children:"\u4ECE\u5934\u64AD\u653E"}),t("p",{className:"text-sm text-gray-400",children:"\u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u90FD\u4ECE\u89C6\u9891\u5F00\u5934\u5F00\u59CB"})]}),a("div",{className:"rounded border border-gray-700 p-6",children:[t("h4",{className:"mb-2 text-lg font-semibold",children:"\u6027\u80FD\u4F18\u5316"}),t("p",{className:"text-sm text-gray-400",children:"\u591A\u89C6\u9891\u72EC\u7ACB\u63A7\u5236\uFF0C\u8D44\u6E90\u9AD8\u6548\u5229\u7528"})]})]})]})})]});export{n as DarkTheme,r as LightTheme,b as MultiBanner,v as ScrollableBackgroundVideo,y as WithSemanticClassNames,g as WithVideoModal,h as WithYoutubeVideo,u as WithoutSecondaryButton,p as default};
|
|
11
11
|
//# sourceMappingURL=HeroBanner.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/HeroBanner.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\nimport HeroBanner from '../biz-components/HeroBanner/HeroBanner.js'\n\nconst meta = {\n title: 'Biz-Components/HeroBanner',\n component: HeroBanner,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component: `\nHeroBanner \u7EC4\u4EF6\u7528\u4E8E\u5C55\u793A\u7F51\u7AD9\u7684\u4E3B\u8981\u5185\u5BB9\u533A\u57DF\uFF0C\u901A\u5E38\u5305\u542B\u6807\u9898\u3001\u526F\u6807\u9898\u548C\u884C\u52A8\u6309\u94AE\u3002\n\n### \u7279\u70B9\n- \u652F\u6301\u4EAE\u8272\u548C\u6697\u8272\u4E3B\u9898\n- \u4F7F\u7528 Mont For Anker \u5B57\u4F53\u4F5C\u4E3A\u6807\u9898\n- \u53EF\u914D\u7F6E\u4E3B\u6309\u94AE\u548C\u6B21\u8981\u6309\u94AE\n- \u53EF\u914D\u7F6E\u6A21\u5757\u8DF3\u8F6C\u94FE\u63A5\n- \u652F\u6301\u5E95\u90E8\u7279\u6027\u5217\u8868\n `,\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof HeroBanner>\n\nexport default meta\ntype Story = StoryObj<typeof HeroBanner>\n\nconst defaultBackground =\n 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206'\n\nconst padBackground =\n 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206'\n\nconst darkBackground =\n 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/87e32d61fc407d5e6c8aff00f3453072.jpg?v=1745999899'\n\nexport const LightTheme: Story = {\n args: {\n data: {\n title: 'Anker Laptop Power',\n subtitle: 'Anker Prime 240W GaN Desktop Charger (4 Ports)',\n pcImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'light',\n blockLink: '/this-is-block-link',\n primaryButton: {\n text: 'Shop Now',\n link: '/this-is-shop-now-link',\n },\n secondaryButton: {\n text: 'Learn More',\n link: '/this-is-learn-more-link',\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n { title: 'Anker Prime 27,650mAh Power Bank (250W)' },\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n ],\n endDate: '2025-11-15T03:32:00.000Z',\n endDate_tz: 'America/Sao_Paulo',\n dateFormat: '{\"day\":\"Day\",\"hour\":\"Hours\",\"minute\":\"Mins\",\"second\":\"Secs\"}',\n },\n },\n}\n\nexport const DarkTheme: Story = {\n args: {\n data: {\n title: 'Power Your Life',\n subtitle:\n 'Experience the next generation of charging technology with our innovative solutions designed for modern life.',\n pcImage: {\n url: darkBackground,\n alt: 'dark background',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: darkBackground,\n alt: 'dark background',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'dark',\n primaryButton: {\n text: 'Shop Now',\n },\n secondaryButton: {\n text: 'Learn More',\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n { title: 'Anker Prime 27,650mAh Power Bank (250W)' },\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n ],\n },\n },\n}\n\nexport const MultiBanner = () => {\n return (\n <div className=\"flex flex-col\">\n {/* @ts-ignore */}\n <HeroBanner data={{ ...LightTheme!.args!.data, size: 'sm' }} />\n {/* @ts-ignore */}\n <HeroBanner data={{ ...DarkTheme!.args!.data, size: 'sm' }} className=\"mt-[8px]\" />\n </div>\n )\n}\n\nexport const WithoutSecondaryButton: Story = {\n args: {\n data: {\n title: 'Future of Charging',\n subtitle:\n 'Step into the future with our revolutionary charging solutions that redefine the way you power your devices.',\n pcImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'light',\n primaryButton: {\n text: 'Shop Now',\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n { title: 'Anker Prime 27,650mAh Power Bank (250W)' },\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n ],\n },\n },\n}\n\nexport const WithVideoModal: Story = {\n args: {\n data: {\n title: 'Experience Anker Innovation',\n subtitle: 'Watch our latest product demo and discover the future of charging technology',\n pcImage: {\n url: defaultBackground,\n alt: 'tech background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'tech background mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'dark',\n primaryButton: {\n text: 'Shop Now',\n link: '/shop',\n },\n secondaryButton: {\n text: 'Learn More',\n link: '/learn-more',\n isShowPlayVideoButton: true,\n playVideoButtonText: 'Watch Demo',\n playIcon: true,\n videoUrl: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'product demo video',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger' },\n { title: 'Anker PowerCore 27,650mAh Power Bank' },\n { title: 'Anker Wireless Charging Station' },\n ],\n },\n },\n}\n\nexport const WithYoutubeVideo: Story = {\n args: {\n data: {\n title: 'Anker Prime Series',\n subtitle: 'See our Prime series in action. Experience the power that drives innovation.',\n pcImage: {\n url: defaultBackground,\n alt: 'anker products',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n padImage: {\n url: defaultBackground,\n alt: 'anker products pad',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'anker products mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'light',\n primaryButton: {\n text: 'Buy Now',\n link: '/buy',\n },\n secondaryButton: {\n text: 'Explore',\n link: '/explore',\n isShowPlayVideoButton: true,\n playVideoButtonText: 'Watch on YouTube',\n youtubeId: 'dQw4w9WgXcQ', // Example YouTube ID\n },\n caption: [\n { title: 'Prime 240W Desktop Charger' },\n { title: 'Prime 27,650mAh Power Bank' },\n { title: 'Prime 100W Wireless Charger' },\n ],\n },\n },\n}\n\nexport const ScrollableBackgroundVideo = () => {\n return (\n <div className=\"min-h-[500vh]\">\n {/* \u7B2C\u4E00\u4E2A\u89C6\u9891 Banner */}\n <HeroBanner\n data={{\n theme: 'dark',\n title: 'Powered by Innovation',\n subtitle:\n 'Scroll down to test IntersectionObserver - videos play only when in viewport and restart from beginning each time.',\n pcImage: {\n url: defaultBackground,\n alt: 'fallback background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'fallback background mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n pcVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'background video desktop',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n padVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'background video tablet',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n mobileVideo: {\n url: 'https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4',\n alt: 'background video mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n isShowVideo: true,\n primaryButton: {\n text: 'First Video',\n link: '/first',\n },\n secondaryButton: {\n text: 'Learn More',\n link: '/learn',\n },\n caption: [\n { title: 'IntersectionObserver Controlled' },\n { title: 'Auto Play on Viewport Entry' },\n { title: 'Restart from Beginning' },\n ],\n }}\n />\n\n {/* \u4E2D\u95F4\u95F4\u9694\u5185\u5BB9 */}\n <div className=\"bg-gradient-to-b from-gray-900 to-black py-20 text-white\">\n <div className=\"container mx-auto max-w-4xl px-4\">\n <h2 className=\"mb-8 text-center text-4xl font-bold\">IntersectionObserver \u89C6\u9891\u63A7\u5236</h2>\n <div className=\"space-y-8\">\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u667A\u80FD\u89C6\u9891\u64AD\u653E</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u89C6\u9891\u53EA\u5728\u8FDB\u5165\u89C6\u7A97\u65F6\u64AD\u653E\uFF0C\u79BB\u5F00\u89C6\u7A97\u65F6\u81EA\u52A8\u6682\u505C\u3002\u6BCF\u6B21\u91CD\u65B0\u8FDB\u5165\u89C6\u7A97\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u4E00\u81F4\u7684\u89C2\u770B\u4F53\u9A8C\u3002\u4F7F\u7528\n IntersectionObserver API \u5B9E\u73B0\u7CBE\u51C6\u7684\u89C6\u7A97\u68C0\u6D4B\u3002\n </p>\n </div>\n\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u6027\u80FD\u4F18\u5316</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u6682\u505C\u64AD\u653E\uFF0C\u51CF\u5C11CPU\u548C\u5185\u5B58\u5360\u7528\u3002\u63D0\u524D50px\u5F00\u59CB\u68C0\u6D4B\uFF0C\n \u786E\u4FDD\u89C6\u9891\u5728\u7528\u6237\u770B\u5230\u65F6\u5DF2\u7ECF\u51C6\u5907\u5C31\u7EEA\u3002threshold\u8BBE\u7F6E\u4E3A0.1\uFF0C\u5F5310%\u5143\u7D20\u53EF\u89C1\u65F6\u89E6\u53D1\u3002\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* \u7B2C\u4E8C\u4E2A\u89C6\u9891 Banner */}\n <HeroBanner\n data={{\n title: 'Second Video Banner',\n subtitle: 'This is the second video to test multiple banners with IntersectionObserver.',\n pcImage: {\n url: darkBackground,\n alt: 'second banner background',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: darkBackground,\n alt: 'second banner mobile',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n pcVideo: {\n url: 'https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_2mb.mp4',\n alt: 'second video desktop',\n thumbnailURL: darkBackground,\n mimeType: 'video/mp4',\n },\n padVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'second video tablet',\n thumbnailURL: darkBackground,\n mimeType: 'video/mp4',\n },\n mobileVideo: {\n url: 'https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4',\n alt: 'second video mobile',\n thumbnailURL: darkBackground,\n mimeType: 'video/mp4',\n },\n isShowVideo: true,\n primaryButton: {\n text: 'Second Video',\n link: '/second',\n },\n secondaryButton: {\n text: 'Explore More',\n link: '/explore',\n },\n caption: [\n { title: 'Independent Video Control' },\n { title: 'Pause When Out of View' },\n { title: 'Resource Efficient' },\n ],\n }}\n />\n\n {/* \u66F4\u591A\u95F4\u9694\u5185\u5BB9 */}\n <div className=\"bg-gradient-to-b from-black to-gray-900 py-20 text-white\">\n <div className=\"container mx-auto max-w-4xl px-4\">\n <h2 className=\"mb-8 text-center text-4xl font-bold\">\u591A\u89C6\u9891\u7BA1\u7406</h2>\n <div className=\"space-y-8\">\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u72EC\u7ACB\u63A7\u5236</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u6BCF\u4E2A\u89C6\u9891banner\u90FD\u6709\u72EC\u7ACB\u7684IntersectionObserver\uFF0C\u4E92\u4E0D\u5E72\u6270\u3002\n \u5F53\u4E00\u4E2A\u89C6\u9891\u64AD\u653E\u65F6\uFF0C\u5176\u4ED6\u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u4FDD\u6301\u6682\u505C\u72B6\u6001\u3002\n </p>\n </div>\n\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u7528\u6237\u4F53\u9A8C</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u6EDA\u52A8\u65F6\u7528\u6237\u770B\u5230\u7684\u6BCF\u4E2A\u89C6\u9891\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u5B8C\u6574\u7684\u89C2\u770B\u4F53\u9A8C\u3002\n \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u53EF\u4EE5\u8282\u7701\u8BBE\u5907\u8D44\u6E90\u548C\u7F51\u7EDC\u6D41\u91CF\u3002\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* \u7B2C\u4E09\u4E2A\u89C6\u9891 Banner */}\n <HeroBanner\n data={{\n title: 'Third Video Experience',\n subtitle: 'Final banner to demonstrate seamless video management across multiple sections.',\n pcImage: {\n url: defaultBackground,\n alt: 'third banner background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'third banner mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n pcVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4',\n alt: 'third video desktop',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n padVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4',\n alt: 'third video tablet',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n mobileVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/50981dfe2910408fa76436ca394cbc6f.mp4',\n alt: 'third video mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n theme: 'dark',\n isShowVideo: true,\n primaryButton: {\n text: 'Third Video',\n link: '/third',\n },\n secondaryButton: {\n text: 'Complete Test',\n link: '/complete',\n },\n caption: [\n { title: 'Seamless Performance' },\n { title: 'Multiple Video Management' },\n { title: 'Optimized for All Devices' },\n ],\n }}\n />\n\n {/* \u5E95\u90E8\u603B\u7ED3\u5185\u5BB9 */}\n <div className=\"bg-black py-20 text-white\">\n <div className=\"container mx-auto px-4 text-center\">\n <h2 className=\"mb-4 text-3xl font-bold\">IntersectionObserver \u6D4B\u8BD5\u5B8C\u6210</h2>\n <p className=\"mb-8 text-gray-400\">\u6EDA\u52A8\u56DE\u9876\u90E8\u518D\u6B21\u6D4B\u8BD5\u89C6\u9891\u8FDB\u5165\u548C\u79BB\u5F00\u89C6\u7A97\u7684\u6548\u679C</p>\n <div className=\"mx-auto grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-3\">\n <div className=\"rounded border border-gray-700 p-6\">\n <h4 className=\"mb-2 text-lg font-semibold\">\u667A\u80FD\u64AD\u653E</h4>\n <p className=\"text-sm text-gray-400\">\u8FDB\u5165\u89C6\u7A97\u81EA\u52A8\u64AD\u653E\uFF0C\u79BB\u5F00\u81EA\u52A8\u6682\u505C</p>\n </div>\n <div className=\"rounded border border-gray-700 p-6\">\n <h4 className=\"mb-2 text-lg font-semibold\">\u4ECE\u5934\u64AD\u653E</h4>\n <p className=\"text-sm text-gray-400\">\u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u90FD\u4ECE\u89C6\u9891\u5F00\u5934\u5F00\u59CB</p>\n </div>\n <div className=\"rounded border border-gray-700 p-6\">\n <h4 className=\"mb-2 text-lg font-semibold\">\u6027\u80FD\u4F18\u5316</h4>\n <p className=\"text-sm text-gray-400\">\u591A\u89C6\u9891\u72EC\u7ACB\u63A7\u5236\uFF0C\u8D44\u6E90\u9AD8\u6548\u5229\u7528</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAkHI,OAEE,OAAAA,EAFF,QAAAC,MAAA,oBAjHJ,MAAkB,QAClB,OAAOC,MAAgB,6CAEvB,MAAMC,EAAO,CACX,MAAO,4BACP,UAAWD,EACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAUb,CACF,CACF,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOE,EAAQD,EAGf,MAAME,EACJ,gJAEIC,EACJ,gJAEIC,EACJ,2GAEWC,EAAoB,CAC/B,KAAM,CACJ,KAAM,CACJ,MAAO,qBACP,SAAU,iDACV,QAAS,CACP,IAAKH,EACL,IAAK,qBACL,aAAcA,EACd,SAAU,YACZ,EACA,YAAa,CACX,IAAKA,EACL,IAAK,qBACL,aAAcA,EACd,SAAU,YACZ,EACA,MAAO,QACP,UAAW,sBACX,cAAe,CACb,KAAM,WACN,KAAM,wBACR,EACA,gBAAiB,CACf,KAAM,aACN,KAAM,0BACR,EACA,QAAS,CACP,CAAE,MAAO,gDAAiD,EAC1D,CAAE,MAAO,yCAA0C,EACnD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b,KAAM,WACN,KAAM,OACR,EACA,gBAAiB,CACf,KAAM,aACN,KAAM,cACN,sBAAuB,GACvB,oBAAqB,aACrB,SAAU,GACV,SAAU,CACR,IAAK,4EACL,IAAK,qBACL,aAAcA,EACd,SAAU,WACZ,CACF,EACA,QAAS,CACP,CAAE,MAAO,sCAAuC,EAChD,CAAE,MAAO,sCAAuC,EAChD,CAAE,MAAO,iCAAkC,CAC7C,CACF,CACF,CACF,EAEaQ,EAA0B,CACrC,KAAM,CACJ,KAAM,CACJ,MAAO,qBACP,SAAU,+EACV,QAAS,CACP,IAAKR,EACL,IAAK,iBACL,aAAcA,EACd,SAAU,YACZ,EACA,SAAU,CACR,IAAKA,EACL,IAAK,qBACL,aAAcA,EACd,SAAU,YACZ,EACA,YAAa,CACX,IAAKA,EACL,IAAK,wBACL,aAAcA,EACd,SAAU,YACZ,EACA,MAAO,QACP,cAAe,CACb,KAAM,UACN,KAAM,MACR,EACA,gBAAiB,CACf,KAAM,UACN,KAAM,WACN,sBAAuB,GACvB,oBAAqB,mBACrB,UAAW,aACb,EACA,QAAS,CACP,CAAE,MAAO,4BAA6B,EACtC,CAAE,MAAO,4BAA6B,EACtC,CAAE,MAAO,6BAA8B,CACzC,CACF,CACF,CACF,
|
|
6
|
-
"names": ["jsx", "jsxs", "HeroBanner", "meta", "HeroBanner_stories_default", "defaultBackground", "padBackground", "darkBackground", "LightTheme", "DarkTheme", "MultiBanner", "WithoutSecondaryButton", "WithVideoModal", "WithYoutubeVideo", "ScrollableBackgroundVideo"]
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\nimport HeroBanner from '../biz-components/HeroBanner/HeroBanner.js'\n\nconst meta = {\n title: 'Biz-Components/HeroBanner',\n component: HeroBanner,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component: `\nHeroBanner \u7EC4\u4EF6\u7528\u4E8E\u5C55\u793A\u7F51\u7AD9\u7684\u4E3B\u8981\u5185\u5BB9\u533A\u57DF\uFF0C\u901A\u5E38\u5305\u542B\u6807\u9898\u3001\u526F\u6807\u9898\u548C\u884C\u52A8\u6309\u94AE\u3002\n\n### \u7279\u70B9\n- \u652F\u6301\u4EAE\u8272\u548C\u6697\u8272\u4E3B\u9898\n- \u4F7F\u7528 Mont For Anker \u5B57\u4F53\u4F5C\u4E3A\u6807\u9898\n- \u53EF\u914D\u7F6E\u4E3B\u6309\u94AE\u548C\u6B21\u8981\u6309\u94AE\n- \u53EF\u914D\u7F6E\u6A21\u5757\u8DF3\u8F6C\u94FE\u63A5\n- \u652F\u6301\u5E95\u90E8\u7279\u6027\u5217\u8868\n `,\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof HeroBanner>\n\nexport default meta\ntype Story = StoryObj<typeof HeroBanner>\n\nconst defaultBackground =\n 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206'\n\nconst padBackground =\n 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/aee13b30b2c77fc8d0a46e4f19fa48cb_6a25debf-f95e-4ca6-990b-babcad65216c.png?v=1745468206'\n\nconst darkBackground =\n 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/87e32d61fc407d5e6c8aff00f3453072.jpg?v=1745999899'\n\nexport const LightTheme: Story = {\n args: {\n data: {\n title: 'Anker Laptop Power',\n subtitle: 'Anker Prime 240W GaN Desktop Charger (4 Ports)',\n pcImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'light',\n blockLink: '/this-is-block-link',\n primaryButton: {\n text: 'Shop Now',\n link: '/this-is-shop-now-link',\n },\n secondaryButton: {\n text: 'Learn More',\n link: '/this-is-learn-more-link',\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n { title: 'Anker Prime 27,650mAh Power Bank (250W)' },\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n ],\n endDate: '2025-11-15T03:32:00.000Z',\n endDate_tz: 'America/Sao_Paulo',\n dateFormat: '{\"day\":\"Day\",\"hour\":\"Hours\",\"minute\":\"Mins\",\"second\":\"Secs\"}',\n },\n },\n}\n\nexport const DarkTheme: Story = {\n args: {\n data: {\n title: 'Power Your Life',\n subtitle:\n 'Experience the next generation of charging technology with our innovative solutions designed for modern life.',\n pcImage: {\n url: darkBackground,\n alt: 'dark background',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: darkBackground,\n alt: 'dark background',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'dark',\n primaryButton: {\n text: 'Shop Now',\n },\n secondaryButton: {\n text: 'Learn More',\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n { title: 'Anker Prime 27,650mAh Power Bank (250W)' },\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n ],\n },\n },\n}\n\nexport const MultiBanner = () => {\n return (\n <div className=\"flex flex-col\">\n {/* @ts-ignore */}\n <HeroBanner data={{ ...LightTheme!.args!.data, size: 'sm' }} />\n {/* @ts-ignore */}\n <HeroBanner data={{ ...DarkTheme!.args!.data, size: 'sm' }} className=\"mt-[8px]\" />\n </div>\n )\n}\n\nexport const WithoutSecondaryButton: Story = {\n args: {\n data: {\n title: 'Future of Charging',\n subtitle:\n 'Step into the future with our revolutionary charging solutions that redefine the way you power your devices.',\n pcImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'default background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'light',\n primaryButton: {\n text: 'Shop Now',\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n { title: 'Anker Prime 27,650mAh Power Bank (250W)' },\n { title: 'Anker Prime 240W GaN Desktop Charger (4 Ports)' },\n ],\n },\n },\n}\n\nexport const WithVideoModal: Story = {\n args: {\n data: {\n title: 'Experience Anker Innovation',\n subtitle: 'Watch our latest product demo and discover the future of charging technology',\n pcImage: {\n url: defaultBackground,\n alt: 'tech background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'tech background mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'dark',\n primaryButton: {\n text: 'Shop Now',\n link: '/shop',\n },\n secondaryButton: {\n text: 'Learn More',\n link: '/learn-more',\n isShowPlayVideoButton: true,\n playVideoButtonText: 'Watch Demo',\n playIcon: true,\n videoUrl: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'product demo video',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n },\n caption: [\n { title: 'Anker Prime 240W GaN Desktop Charger' },\n { title: 'Anker PowerCore 27,650mAh Power Bank' },\n { title: 'Anker Wireless Charging Station' },\n ],\n },\n },\n}\n\nexport const WithYoutubeVideo: Story = {\n args: {\n data: {\n title: 'Anker Prime Series',\n subtitle: 'See our Prime series in action. Experience the power that drives innovation.',\n pcImage: {\n url: defaultBackground,\n alt: 'anker products',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n padImage: {\n url: defaultBackground,\n alt: 'anker products pad',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'anker products mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n theme: 'light',\n primaryButton: {\n text: 'Buy Now',\n link: '/buy',\n },\n secondaryButton: {\n text: 'Explore',\n link: '/explore',\n isShowPlayVideoButton: true,\n playVideoButtonText: 'Watch on YouTube',\n youtubeId: 'dQw4w9WgXcQ', // Example YouTube ID\n },\n caption: [\n { title: 'Prime 240W Desktop Charger' },\n { title: 'Prime 27,650mAh Power Bank' },\n { title: 'Prime 100W Wireless Charger' },\n ],\n },\n },\n}\n\n// \u8BED\u4E49\u5316 ClassNames \u793A\u4F8B\nexport const WithSemanticClassNames: Story = {\n args: {\n data: LightTheme.args!.data,\n classNames: {\n root: '',\n title: ' text-red-500',\n subtitle: 'text-blue-500',\n buttonGroup: 'justify-left mt-[200px]',\n primaryButton: 'shadow-lg',\n secondaryButton: 'custom-secondary-btn',\n captionGroup: 'bg-black/40',\n },\n },\n}\n\nexport const ScrollableBackgroundVideo = () => {\n return (\n <div className=\"min-h-[500vh]\">\n {/* \u7B2C\u4E00\u4E2A\u89C6\u9891 Banner */}\n <HeroBanner\n data={{\n theme: 'dark',\n title: 'Powered by Innovation',\n subtitle:\n 'Scroll down to test IntersectionObserver - videos play only when in viewport and restart from beginning each time.',\n pcImage: {\n url: defaultBackground,\n alt: 'fallback background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'fallback background mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n pcVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'background video desktop',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n padVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'background video tablet',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n mobileVideo: {\n url: 'https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4',\n alt: 'background video mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n isShowVideo: true,\n primaryButton: {\n text: 'First Video',\n link: '/first',\n },\n secondaryButton: {\n text: 'Learn More',\n link: '/learn',\n },\n caption: [\n { title: 'IntersectionObserver Controlled' },\n { title: 'Auto Play on Viewport Entry' },\n { title: 'Restart from Beginning' },\n ],\n }}\n />\n\n {/* \u4E2D\u95F4\u95F4\u9694\u5185\u5BB9 */}\n <div className=\"bg-gradient-to-b from-gray-900 to-black py-20 text-white\">\n <div className=\"container mx-auto max-w-4xl px-4\">\n <h2 className=\"mb-8 text-center text-4xl font-bold\">IntersectionObserver \u89C6\u9891\u63A7\u5236</h2>\n <div className=\"space-y-8\">\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u667A\u80FD\u89C6\u9891\u64AD\u653E</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u89C6\u9891\u53EA\u5728\u8FDB\u5165\u89C6\u7A97\u65F6\u64AD\u653E\uFF0C\u79BB\u5F00\u89C6\u7A97\u65F6\u81EA\u52A8\u6682\u505C\u3002\u6BCF\u6B21\u91CD\u65B0\u8FDB\u5165\u89C6\u7A97\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u4E00\u81F4\u7684\u89C2\u770B\u4F53\u9A8C\u3002\u4F7F\u7528\n IntersectionObserver API \u5B9E\u73B0\u7CBE\u51C6\u7684\u89C6\u7A97\u68C0\u6D4B\u3002\n </p>\n </div>\n\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u6027\u80FD\u4F18\u5316</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u6682\u505C\u64AD\u653E\uFF0C\u51CF\u5C11CPU\u548C\u5185\u5B58\u5360\u7528\u3002\u63D0\u524D50px\u5F00\u59CB\u68C0\u6D4B\uFF0C\n \u786E\u4FDD\u89C6\u9891\u5728\u7528\u6237\u770B\u5230\u65F6\u5DF2\u7ECF\u51C6\u5907\u5C31\u7EEA\u3002threshold\u8BBE\u7F6E\u4E3A0.1\uFF0C\u5F5310%\u5143\u7D20\u53EF\u89C1\u65F6\u89E6\u53D1\u3002\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* \u7B2C\u4E8C\u4E2A\u89C6\u9891 Banner */}\n <HeroBanner\n data={{\n title: 'Second Video Banner',\n subtitle: 'This is the second video to test multiple banners with IntersectionObserver.',\n pcImage: {\n url: darkBackground,\n alt: 'second banner background',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: darkBackground,\n alt: 'second banner mobile',\n thumbnailURL: darkBackground,\n mimeType: 'image/jpeg',\n },\n pcVideo: {\n url: 'https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_2mb.mp4',\n alt: 'second video desktop',\n thumbnailURL: darkBackground,\n mimeType: 'video/mp4',\n },\n padVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/8b833ba483e64ba5839f55c455d91f2c.mp4',\n alt: 'second video tablet',\n thumbnailURL: darkBackground,\n mimeType: 'video/mp4',\n },\n mobileVideo: {\n url: 'https://sample-videos.com/zip/10/mp4/SampleVideo_640x360_1mb.mp4',\n alt: 'second video mobile',\n thumbnailURL: darkBackground,\n mimeType: 'video/mp4',\n },\n isShowVideo: true,\n primaryButton: {\n text: 'Second Video',\n link: '/second',\n },\n secondaryButton: {\n text: 'Explore More',\n link: '/explore',\n },\n caption: [\n { title: 'Independent Video Control' },\n { title: 'Pause When Out of View' },\n { title: 'Resource Efficient' },\n ],\n }}\n />\n\n {/* \u66F4\u591A\u95F4\u9694\u5185\u5BB9 */}\n <div className=\"bg-gradient-to-b from-black to-gray-900 py-20 text-white\">\n <div className=\"container mx-auto max-w-4xl px-4\">\n <h2 className=\"mb-8 text-center text-4xl font-bold\">\u591A\u89C6\u9891\u7BA1\u7406</h2>\n <div className=\"space-y-8\">\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u72EC\u7ACB\u63A7\u5236</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u6BCF\u4E2A\u89C6\u9891banner\u90FD\u6709\u72EC\u7ACB\u7684IntersectionObserver\uFF0C\u4E92\u4E0D\u5E72\u6270\u3002\n \u5F53\u4E00\u4E2A\u89C6\u9891\u64AD\u653E\u65F6\uFF0C\u5176\u4ED6\u4E0D\u5728\u89C6\u7A97\u5185\u7684\u89C6\u9891\u4F1A\u4FDD\u6301\u6682\u505C\u72B6\u6001\u3002\n </p>\n </div>\n\n <div className=\"rounded-lg bg-gray-800 p-8\">\n <h3 className=\"mb-4 text-2xl font-semibold\">\u7528\u6237\u4F53\u9A8C</h3>\n <p className=\"leading-relaxed text-gray-300\">\n \u6EDA\u52A8\u65F6\u7528\u6237\u770B\u5230\u7684\u6BCF\u4E2A\u89C6\u9891\u90FD\u4F1A\u4ECE\u5934\u5F00\u59CB\u64AD\u653E\uFF0C\u63D0\u4F9B\u5B8C\u6574\u7684\u89C2\u770B\u4F53\u9A8C\u3002\n \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u53EF\u4EE5\u8282\u7701\u8BBE\u5907\u8D44\u6E90\u548C\u7F51\u7EDC\u6D41\u91CF\u3002\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* \u7B2C\u4E09\u4E2A\u89C6\u9891 Banner */}\n <HeroBanner\n data={{\n title: 'Third Video Experience',\n subtitle: 'Final banner to demonstrate seamless video management across multiple sections.',\n pcImage: {\n url: defaultBackground,\n alt: 'third banner background',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n mobileImage: {\n url: defaultBackground,\n alt: 'third banner mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'image/jpeg',\n },\n pcVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4',\n alt: 'third video desktop',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n padVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/c84b5ba3176f47a79d843d334812d645.mp4',\n alt: 'third video tablet',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n mobileVideo: {\n url: 'https://cdn.shopify.com/videos/c/o/v/50981dfe2910408fa76436ca394cbc6f.mp4',\n alt: 'third video mobile',\n thumbnailURL: defaultBackground,\n mimeType: 'video/mp4',\n },\n theme: 'dark',\n isShowVideo: true,\n primaryButton: {\n text: 'Third Video',\n link: '/third',\n },\n secondaryButton: {\n text: 'Complete Test',\n link: '/complete',\n },\n caption: [\n { title: 'Seamless Performance' },\n { title: 'Multiple Video Management' },\n { title: 'Optimized for All Devices' },\n ],\n }}\n />\n\n {/* \u5E95\u90E8\u603B\u7ED3\u5185\u5BB9 */}\n <div className=\"bg-black py-20 text-white\">\n <div className=\"container mx-auto px-4 text-center\">\n <h2 className=\"mb-4 text-3xl font-bold\">IntersectionObserver \u6D4B\u8BD5\u5B8C\u6210</h2>\n <p className=\"mb-8 text-gray-400\">\u6EDA\u52A8\u56DE\u9876\u90E8\u518D\u6B21\u6D4B\u8BD5\u89C6\u9891\u8FDB\u5165\u548C\u79BB\u5F00\u89C6\u7A97\u7684\u6548\u679C</p>\n <div className=\"mx-auto grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-3\">\n <div className=\"rounded border border-gray-700 p-6\">\n <h4 className=\"mb-2 text-lg font-semibold\">\u667A\u80FD\u64AD\u653E</h4>\n <p className=\"text-sm text-gray-400\">\u8FDB\u5165\u89C6\u7A97\u81EA\u52A8\u64AD\u653E\uFF0C\u79BB\u5F00\u81EA\u52A8\u6682\u505C</p>\n </div>\n <div className=\"rounded border border-gray-700 p-6\">\n <h4 className=\"mb-2 text-lg font-semibold\">\u4ECE\u5934\u64AD\u653E</h4>\n <p className=\"text-sm text-gray-400\">\u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u90FD\u4ECE\u89C6\u9891\u5F00\u5934\u5F00\u59CB</p>\n </div>\n <div className=\"rounded border border-gray-700 p-6\">\n <h4 className=\"mb-2 text-lg font-semibold\">\u6027\u80FD\u4F18\u5316</h4>\n <p className=\"text-sm text-gray-400\">\u591A\u89C6\u9891\u72EC\u7ACB\u63A7\u5236\uFF0C\u8D44\u6E90\u9AD8\u6548\u5229\u7528</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAkHI,OAEE,OAAAA,EAFF,QAAAC,MAAA,oBAjHJ,MAAkB,QAClB,OAAOC,MAAgB,6CAEvB,MAAMC,EAAO,CACX,MAAO,4BACP,UAAWD,EACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAUb,CACF,CACF,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOE,EAAQD,EAGf,MAAME,EACJ,gJAEIC,EACJ,gJAEIC,EACJ,2GAEWC,EAAoB,CAC/B,KAAM,CACJ,KAAM,CACJ,MAAO,qBACP,SAAU,iDACV,QAAS,CACP,IAAKH,EACL,IAAK,qBACL,aAAcA,EACd,SAAU,YACZ,EACA,YAAa,CACX,IAAKA,EACL,IAAK,qBACL,aAAcA,EACd,SAAU,YACZ,EACA,MAAO,QACP,UAAW,sBACX,cAAe,CACb,KAAM,WACN,KAAM,wBACR,EACA,gBAAiB,CACf,KAAM,aACN,KAAM,0BACR,EACA,QAAS,CACP,CAAE,MAAO,gDAAiD,EAC1D,CAAE,MAAO,yCAA0C,EACnD,CAAE,MAAO,gDAAiD,CAC5D,EACA,QAAS,2BACT,WAAY,oBACZ,WAAY,8DACd,CACF,CACF,EAEaI,EAAmB,CAC9B,KAAM,CACJ,KAAM,CACJ,MAAO,kBACP,SACE,gHACF,QAAS,CACP,IAAKF,EACL,IAAK,kBACL,aAAcA,EACd,SAAU,YACZ,EACA,YAAa,CACX,IAAKA,EACL,IAAK,kBACL,aAAcA,EACd,SAAU,YACZ,EACA,M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/CA,EAAC,KAAE,UAAU,wBAAwB,gGAAc,GACrD,GACF,GACF,EACF,GACF",
|
|
6
|
+
"names": ["jsx", "jsxs", "HeroBanner", "meta", "HeroBanner_stories_default", "defaultBackground", "padBackground", "darkBackground", "LightTheme", "DarkTheme", "MultiBanner", "WithoutSecondaryButton", "WithVideoModal", "WithYoutubeVideo", "WithSemanticClassNames", "ScrollableBackgroundVideo"]
|
|
7
7
|
}
|
|
@@ -15,3 +15,24 @@ type Story = StoryObj<typeof meta>;
|
|
|
15
15
|
export declare const Default: Story;
|
|
16
16
|
export declare const Round: Story;
|
|
17
17
|
export declare const CustomLayout: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Autoplay: {
|
|
19
|
+
args: {
|
|
20
|
+
data: {
|
|
21
|
+
products: {
|
|
22
|
+
title: string;
|
|
23
|
+
img: {
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
subTitle: string;
|
|
27
|
+
}[];
|
|
28
|
+
shape: string;
|
|
29
|
+
itemShape: string;
|
|
30
|
+
theme: string;
|
|
31
|
+
};
|
|
32
|
+
autoplay: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
loop: boolean;
|
|
35
|
+
interval: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import o from"../biz-components/AccordionCards/index.js";import{Container as s}from"../components/container.js";const r={title:"Biz-Components/AccordionCards",component:o,parameters:{layout:"fullscreen"},tags:["autodocs"]};var i=r;const e=[{title:"Apple Charging Solutions",img:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768"},subTitle:"Dependable Charging for Your Entire Apple Ecosystem."},{title:"Apple Charging Solutions",img:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768"},subTitle:"Dependable Charging for Your Entire Apple Ecosystem."},{title:"Apple Charging Solutions",img:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768"},subTitle:"Dependable Charging for Your Entire Apple Ecosystem."},{title:"Apple Charging Solutions",img:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768"},subTitle:"Dependable Charging for Your Entire Apple Ecosystem."}],n={args:{data:{products:e,primaryButton:"Learn More",theme:"dark",shape:"round",itemShape:"round"}}},d={args:{data:{products:e,shape:"round",itemShape:"round",primaryButton:"Learn More"}}},l=()=>t("div",{className:"py-10",children:t(s,{children:t(o,{data:{products:e,shape:"round",itemShape:"round",primaryButton:"Learn More",theme:"dark"}})})}),c={args:{data:{products:e,shape:"round",itemShape:"round",theme:"dark"},autoplay:{enabled:!0,loop:!0,interval:1500}}};export{c as Autoplay,l as CustomLayout,n as Default,d as Round,i as default};
|
|
2
2
|
//# sourceMappingURL=accordionCards.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/accordionCards.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport AccordionCards from '../biz-components/AccordionCards/index.js'\nimport { Container } from '../components/container.js'\n\nconst meta = {\n title: 'Biz-Components/AccordionCards',\n component: AccordionCards,\n parameters: {\n layout: 'fullscreen',\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof AccordionCards>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mock = [\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n]\n\nexport const Default: Story = {\n args: {\n data: {\n products: mock,\n primaryButton: 'Learn More',\n theme: 'dark',\n shape: 'round',\n itemShape: 'round',\n },\n },\n}\n\nexport const Round: Story = {\n args: {\n data: {\n products: mock,\n shape: 'round',\n itemShape: 'round',\n primaryButton: 'Learn More',\n },\n },\n}\n\nexport const CustomLayout = () => {\n return (\n <div className=\"py-10\">\n <Container>\n <AccordionCards\n data={{ products: mock, shape: 'round', itemShape: 'round', primaryButton: 'Learn More', theme: 'dark' }}\n />\n </Container>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "AA0EQ,cAAAA,MAAA,oBAzER,OAAOC,MAAoB,4CAC3B,OAAS,aAAAC,MAAiB,6BAE1B,MAAMC,EAAO,CACX,MAAO,gCACP,UAAWF,EACX,WAAY,CACV,OAAQ,YACV,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOG,EAAQD,EAGf,MAAME,EAAO,CACX,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,EACA,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,EACA,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,EACA,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,CACF,EAEaC,EAAiB,CAC5B,KAAM,CACJ,KAAM,CACJ,SAAUD,EACV,cAAe,aACf,MAAO,OACP,MAAO,QACP,UAAW,OACb,CACF,CACF,EAEaE,EAAe,CAC1B,KAAM,CACJ,KAAM,CACJ,SAAUF,EACV,MAAO,QACP,UAAW,QACX,cAAe,YACjB,CACF,CACF,EAEaG,EAAe,IAExBR,EAAC,OAAI,UAAU,QACb,SAAAA,EAACE,EAAA,CACC,SAAAF,EAACC,EAAA,CACC,KAAM,CAAE,SAAUI,EAAM,MAAO,QAAS,UAAW,QAAS,cAAe,aAAc,MAAO,MAAO,EACzG,EACF,EACF",
|
|
6
|
-
"names": ["jsx", "AccordionCards", "Container", "meta", "accordionCards_stories_default", "mock", "Default", "Round", "CustomLayout"]
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport AccordionCards from '../biz-components/AccordionCards/index.js'\nimport { Container } from '../components/container.js'\n\nconst meta = {\n title: 'Biz-Components/AccordionCards',\n component: AccordionCards,\n parameters: {\n layout: 'fullscreen',\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof AccordionCards>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mock = [\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n {\n title: 'Apple Charging Solutions',\n img: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219, https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627 768',\n },\n subTitle: 'Dependable Charging for Your Entire Apple Ecosystem.',\n },\n]\n\nexport const Default: Story = {\n args: {\n data: {\n products: mock,\n primaryButton: 'Learn More',\n theme: 'dark',\n shape: 'round',\n itemShape: 'round',\n },\n },\n}\n\nexport const Round: Story = {\n args: {\n data: {\n products: mock,\n shape: 'round',\n itemShape: 'round',\n primaryButton: 'Learn More',\n },\n },\n}\n\nexport const CustomLayout = () => {\n return (\n <div className=\"py-10\">\n <Container>\n <AccordionCards\n data={{ products: mock, shape: 'round', itemShape: 'round', primaryButton: 'Learn More', theme: 'dark' }}\n />\n </Container>\n </div>\n )\n}\n\nexport const Autoplay = {\n args: {\n data: {\n products: mock,\n shape: 'round',\n itemShape: 'round',\n theme: 'dark',\n },\n autoplay: { enabled: true, loop: true, interval: 1500 },\n },\n}"],
|
|
5
|
+
"mappings": "AA0EQ,cAAAA,MAAA,oBAzER,OAAOC,MAAoB,4CAC3B,OAAS,aAAAC,MAAiB,6BAE1B,MAAMC,EAAO,CACX,MAAO,gCACP,UAAWF,EACX,WAAY,CACV,OAAQ,YACV,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOG,EAAQD,EAGf,MAAME,EAAO,CACX,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,EACA,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,EACA,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,EACA,CACE,MAAO,2BACP,IAAK,CACH,IAAK,+OACP,EACA,SAAU,sDACZ,CACF,EAEaC,EAAiB,CAC5B,KAAM,CACJ,KAAM,CACJ,SAAUD,EACV,cAAe,aACf,MAAO,OACP,MAAO,QACP,UAAW,OACb,CACF,CACF,EAEaE,EAAe,CAC1B,KAAM,CACJ,KAAM,CACJ,SAAUF,EACV,MAAO,QACP,UAAW,QACX,cAAe,YACjB,CACF,CACF,EAEaG,EAAe,IAExBR,EAAC,OAAI,UAAU,QACb,SAAAA,EAACE,EAAA,CACC,SAAAF,EAACC,EAAA,CACC,KAAM,CAAE,SAAUI,EAAM,MAAO,QAAS,UAAW,QAAS,cAAe,aAAc,MAAO,MAAO,EACzG,EACF,EACF,EAISI,EAAW,CACtB,KAAM,CACJ,KAAM,CACJ,SAAUJ,EACV,MAAO,QACP,UAAW,QACX,MAAO,MACT,EACA,SAAU,CAAE,QAAS,GAAM,KAAM,GAAM,SAAU,IAAK,CACxD,CACF",
|
|
6
|
+
"names": ["jsx", "AccordionCards", "Container", "meta", "accordionCards_stories_default", "mock", "Default", "Round", "CustomLayout", "Autoplay"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type AnchorNavigationData } from '../biz-components/AnchorNavigation/index.js';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("../biz-components/AnchorNavigation/index.js").AnchorNavigationProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
tags: string[];
|
|
16
|
+
argTypes: {
|
|
17
|
+
data: {
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
args: {
|
|
22
|
+
data: AnchorNavigationData;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import"react";import t from"../biz-components/AnchorNavigation/index.js";const o={sectionIds:[{id:"section1",label:"Section 1"},{id:"section2",label:"Section 2"},{id:"section3",label:"Section 3"}]},e={title:"Biz Components/AnchorNavigation",component:t,parameters:{layout:"centered",docs:{description:{component:"\u951A\u70B9\u5BFC\u822A - \u951A\u70B9\u5BFC\u822A"}}},tags:["autodocs"],argTypes:{data:{description:"\u4E1A\u52A1\u6570\u636E"}},args:{data:o}};var s=e;const p={args:{data:o},render:a=>i(t,{...a})};export{p as Default,s as default};
|
|
2
|
+
//# sourceMappingURL=anchorNavigation.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/stories/anchorNavigation.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport React from 'react'\n\nimport AnchorNavigation, { type AnchorNavigationData } from '../biz-components/AnchorNavigation/index.js'\n\n// \u6A21\u62DF\u4E1A\u52A1\u6570\u636E\nconst mockData: AnchorNavigationData = {\n sectionIds: [\n {\n id: 'section1',\n label: 'Section 1',\n },\n {\n id: 'section2',\n label: 'Section 2',\n },\n {\n id: 'section3',\n label: 'Section 3',\n },\n ],\n} satisfies AnchorNavigationData\n\nconst meta = {\n title: 'Biz Components/AnchorNavigation',\n component: AnchorNavigation,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u951A\u70B9\u5BFC\u822A - \u951A\u70B9\u5BFC\u822A',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n data: {\n description: '\u4E1A\u52A1\u6570\u636E',\n },\n },\n args: {\n data: mockData,\n },\n} satisfies Meta<typeof AnchorNavigation>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n data: mockData,\n },\n render: (args: { data: AnchorNavigationData }) => <AnchorNavigation {...args} />,\n}\n"],
|
|
5
|
+
"mappings": "AAqDoD,cAAAA,MAAA,oBAnDpD,MAAkB,QAElB,OAAOC,MAAqD,8CAG5D,MAAMC,EAAiC,CACrC,WAAY,CACV,CACE,GAAI,WACJ,MAAO,WACT,EACA,CACE,GAAI,WACJ,MAAO,WACT,EACA,CACE,GAAI,WACJ,MAAO,WACT,CACF,CACF,EAEMC,EAAO,CACX,MAAO,kCACP,UAAWF,EACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,qDACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,YAAa,0BACf,CACF,EACA,KAAM,CACJ,KAAMC,CACR,CACF,EAEA,IAAOE,EAAQD,EAGR,MAAME,EAAiB,CAC5B,KAAM,CACJ,KAAMH,CACR,EACA,OAASI,GAAyCN,EAACC,EAAA,CAAkB,GAAGK,EAAM,CAChF",
|
|
6
|
+
"names": ["jsx", "AnchorNavigation", "mockData", "meta", "anchorNavigation_stories_default", "Default", "args"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../biz-components/BuyOneGetOneShelf/index.js").BuyOneGetOneShelfProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
argTypes: {
|
|
16
|
+
data: {
|
|
17
|
+
control: "object";
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
onProductClick: {
|
|
21
|
+
action: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
onProductImageClick: {
|
|
25
|
+
action: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
onLearnMore: {
|
|
29
|
+
action: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
onShopNow: {
|
|
33
|
+
action: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
onGiftClick: {
|
|
37
|
+
action: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
onGiftSelectionChange: {
|
|
41
|
+
action: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
48
|
+
export declare const Default: Story;
|
|
49
|
+
export declare const SingleLayout: Story;
|
|
50
|
+
export declare const DoubleLayout: Story;
|
|
51
|
+
export declare const NoHeader: Story;
|
|
52
|
+
export declare const MinimalProduct: Story;
|
|
53
|
+
export declare const WithCustomActions: Story;
|
|
54
|
+
export declare const SingleGiftSelection: Story;
|
|
55
|
+
export declare const MultipleGiftSelection: Story;
|
|
56
|
+
export declare const ComposableDesign: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"react";import r from"../biz-components/BuyOneGetOneShelf/index.js";const t={title:"\u4E70\u8D60\u6D3B\u52A8\u4E13\u533A",description:"\u7CBE\u9009\u4F18\u8D28\u4EA7\u54C1\uFF0C\u4E70\u4E3B\u5546\u54C1\u5373\u53EF\u83B7\u5F97\u8D85\u503C\u8D60\u54C1",layout:"single",products:[{image:"https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?ixlib=rb-4.0.3&auto=format&fit=crop&w=964&h=560&q=80",tags:[{text:"20% OFF",type:"discount",variant:"filled"},{text:"New",type:"new",variant:"outlined"}],name:"eufyCam 3 Security Camera System",description:"4K Ultra HD wireless security camera with advanced AI detection",freeGiftLabel:"\u514D\u8D39\u8D60\u54C1",freeGifts:[{id:"gift-1",image:"https://images.unsplash.com/photo-1558618666-fcd25c85cd64?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80",name:"eufyCam Solar Panel Charger",currentPrice:"Free",originalPrice:"$199.00",isNew:!0,selected:!0},{id:"gift-2",image:"https://images.unsplash.com/photo-1572569511254-d8f925fe2cbb?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80",name:"eufy HomeBase 3 Hub",currentPrice:"Free",originalPrice:"$149.00",isNew:!0,selected:!1}],giftSelectionMode:"multiple",currentPrice:"$1,999.00",originalPrice:"$2,999.00",learnMoreText:"Learn More",shopNowText:"Shop Now"}]},a={...t,layout:"double",products:[{...t.products[0],image:"https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?ixlib=rb-4.0.3&auto=format&fit=crop&w=482&h=560&q=80"},{image:"https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=482&h=560&q=80",tags:[{text:"30% OFF",type:"discount",variant:"filled"}],name:"Anker PowerCore Portable Charger",description:"High-capacity portable charger with fast charging technology",freeGiftLabel:"\u514D\u8D39\u8D60\u54C1",freeGifts:[{id:"gift-3",image:"https://images.unsplash.com/photo-1583394838336-acd977736f90?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80",name:"USB-C Cable Premium",currentPrice:"Free",originalPrice:"$29.00",isNew:!1,selected:!0}],giftSelectionMode:"single",currentPrice:"$79.99",originalPrice:"$119.99",learnMoreText:"Learn More",shopNowText:"Shop Now"}]},c={title:"Biz Components/BuyOneGetOneShelf",component:r,parameters:{layout:"fullscreen",docs:{description:{component:"\u4E70\u8D60\u8D27\u67B6 - \u5C55\u793A\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u7EC4\u4EF6\uFF0C\u652F\u6301\u5355\u5217\u548C\u53CC\u5217\u5E03\u5C40\uFF0C\u5305\u542B\u4EA7\u54C1\u4FE1\u606F\u3001\u6807\u7B7E\u3001\u8D60\u54C1\u5217\u8868\u548C\u8D2D\u4E70\u6309\u94AE"}}},tags:["autodocs"],argTypes:{data:{control:"object",description:"\u4E70\u8D60\u8D27\u67B6\u6570\u636E\u914D\u7F6E"},onProductClick:{action:"product-clicked",description:"\u4EA7\u54C1\u5361\u7247\u70B9\u51FB\u4E8B\u4EF6"},onProductImageClick:{action:"product-image-clicked",description:"\u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u4E8B\u4EF6"},onLearnMore:{action:"learn-more-clicked",description:"Learn More\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6"},onShopNow:{action:"shop-now-clicked",description:"Shop Now\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6"},onGiftClick:{action:"gift-clicked",description:"\u8D60\u54C1\u70B9\u51FB\u4E8B\u4EF6"},onGiftSelectionChange:{action:"gift-selection-changed",description:"\u8D60\u54C1\u9009\u62E9\u53D8\u5316\u4E8B\u4EF6"}}};var p=c;const d={args:{data:t,onProductClick:e=>console.log("Product clicked:",e.name),onProductImageClick:e=>console.log("Product image clicked:",e.name),onLearnMore:e=>console.log("Learn More clicked:",e.name),onShopNow:e=>console.log("Shop Now clicked:",e.name),onGiftClick:(e,o)=>console.log("Gift clicked:",e.name,"for product:",o.name),onGiftSelectionChange:(e,o)=>console.log("Gift selection changed:",e.length,"gifts selected for",o.name)}},m={args:{data:t},parameters:{docs:{description:{story:"\u5355\u5217\u5E03\u5C40\uFF1A\u4E00\u6392\u663E\u793A\u4E00\u4E2A\u4EA7\u54C1\uFF0C\u9002\u5408\u91CD\u70B9\u63A8\u8350\u5355\u4E2A\u4EA7\u54C1\u7684\u573A\u666F\u3002"}}}},f={args:{data:a},parameters:{docs:{description:{story:"\u53CC\u5217\u5E03\u5C40\uFF1A\u4E00\u6392\u663E\u793A\u4E24\u4E2A\u4EA7\u54C1\uFF0C\u9002\u5408\u5C55\u793A\u591A\u4E2A\u4EA7\u54C1\u7684\u5BF9\u6BD4\u573A\u666F\u3002"}}}},g={args:{data:{layout:"single",products:[t.products[0]]}},parameters:{docs:{description:{story:"\u65E0\u6807\u9898\u63CF\u8FF0\u7248\u672C\uFF1A\u53EA\u663E\u793A\u4EA7\u54C1\u5361\u7247\uFF0C\u9002\u5408\u5D4C\u5165\u5230\u5176\u4ED6\u9875\u9762\u4E2D\u7684\u573A\u666F\u3002"}}}},u={args:{data:{layout:"single",products:[{image:"https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?ixlib=rb-4.0.3&auto=format&fit=crop&w=964&h=560&q=80",tags:[{text:"Limited",type:"new",variant:"filled"}],name:"Smart Home Device Collection",description:"Complete smart home automation solution",currentPrice:"$599.00",originalPrice:"$799.00"}]}},parameters:{docs:{description:{story:"\u6700\u5C0F\u5316\u4EA7\u54C1\uFF1A\u65E0\u8D60\u54C1\u5217\u8868\uFF0C\u53EA\u663E\u793A\u57FA\u672C\u4EA7\u54C1\u4FE1\u606F\u548C\u4EF7\u683C\u3002"}}}},h={args:{data:{...t,products:[{...t.products[0],learnMoreText:"\u4E86\u89E3\u8BE6\u60C5",shopNowText:"\u7ACB\u5373\u8D2D\u4E70"}]},onLearnMore:e=>alert(`\u8DF3\u8F6C\u5230\u4EA7\u54C1\u8BE6\u60C5\u9875\u9762: ${e.name}`),onShopNow:e=>alert(`\u6DFB\u52A0\u5230\u8D2D\u7269\u8F66: ${e.name}`),onGiftClick:(e,o)=>alert(`\u9009\u62E9\u8D60\u54C1: ${e.name}`)},parameters:{docs:{description:{story:"\u81EA\u5B9A\u4E49\u6309\u94AE\u6587\u6848\u548C\u70B9\u51FB\u4E8B\u4EF6\uFF1A\u53EF\u4EE5\u81EA\u5B9A\u4E49\u6309\u94AE\u6587\u5B57\u548C\u5904\u7406\u51FD\u6570\u3002"}}}},y={args:{data:{...t,products:[{...t.products[0],giftSelectionMode:"single",freeGifts:[{id:"gift-a",image:"https://images.unsplash.com/photo-1558618666-fcd25c85cd64?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80",name:"eufyCam Solar Panel Charger",currentPrice:"Free",originalPrice:"$199.00",isNew:!0,selected:!1},{id:"gift-b",image:"https://images.unsplash.com/photo-1572569511254-d8f925fe2cbb?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80",name:"eufy HomeBase 3 Hub",currentPrice:"Free",originalPrice:"$149.00",isNew:!0,selected:!0},{id:"gift-c",image:"https://images.unsplash.com/photo-1583394838336-acd977736f90?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80",name:"USB-C Cable Premium",currentPrice:"Free",originalPrice:"$29.00",isNew:!1,selected:!1}]}]},onGiftClick:(e,o)=>console.log("Single gift selection:",e.name),onGiftSelectionChange:(e,o)=>console.log("Single selection changed:",e)},parameters:{docs:{description:{story:"\u5355\u9009\u6A21\u5F0F\uFF1A\u7528\u6237\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u8D60\u54C1\uFF0C\u4F7F\u7528Radio\u6309\u94AE\u3002"}}}},S={args:{data:{...t,products:[{...t.products[0],giftSelectionMode:"multiple"}]},onGiftClick:(e,o)=>console.log("Multiple gift selection:",e.name,"for",o.name),onGiftSelectionChange:(e,o)=>console.log("Multiple selection changed:",e.map(i=>i.name),"for",o.name)},parameters:{docs:{description:{story:"\u591A\u9009\u6A21\u5F0F\uFF1A\u7528\u6237\u53EF\u4EE5\u9009\u62E9\u591A\u4E2A\u8D60\u54C1\uFF0C\u4F7F\u7528Checkbox\u3002"}}}},b={args:{data:t,onProductClick:e=>{console.log("\u{1F3AF} Product card clicked:",e.name)},onProductImageClick:e=>{console.log("\u{1F5BC}\uFE0F Product image clicked - opening gallery for:",e.name)},onLearnMore:e=>{console.log("\u{1F4DA} Learn More - navigating to product details:",e.name)},onShopNow:e=>{console.log("\u{1F6D2} Shop Now - adding to cart:",e.name)},onGiftClick:(e,o)=>{console.log("\u{1F381} Gift clicked:",e.name,"for product:",o.name)},onGiftSelectionChange:(e,o)=>{console.log("\u2705 Gift selection changed for",o.name+":",e.map(i=>i.name).join(", "))}},parameters:{docs:{description:{story:"\u7EC4\u5408\u5F0F\u8BBE\u8BA1\u793A\u4F8B\uFF1A\u6240\u6709\u4E8B\u4EF6\u90FD\u901A\u8FC7 props \u900F\u4F20\uFF0C\u5916\u90E8\u53EF\u4EE5\u5B8C\u5168\u63A7\u5236\u4EA4\u4E92\u903B\u8F91\u3002\u6253\u5F00\u6D4F\u89C8\u5668\u63A7\u5236\u53F0\u67E5\u770B\u4E8B\u4EF6\u65E5\u5FD7\u3002"}}}};export{b as ComposableDesign,d as Default,f as DoubleLayout,u as MinimalProduct,S as MultipleGiftSelection,g as NoHeader,y as SingleGiftSelection,m as SingleLayout,h as WithCustomActions,p as default};
|
|
2
|
+
//# sourceMappingURL=buyOneGetOneShelf.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/stories/buyOneGetOneShelf.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\n\nimport BuyOneGetOneShelf, { type BuyOneGetOneShelfData } from '../biz-components/BuyOneGetOneShelf/index.js'\n\n// \u57FA\u7840\u6570\u636E\u914D\u7F6E\nconst basicShelfData: BuyOneGetOneShelfData = {\n title: '\u4E70\u8D60\u6D3B\u52A8\u4E13\u533A',\n description: '\u7CBE\u9009\u4F18\u8D28\u4EA7\u54C1\uFF0C\u4E70\u4E3B\u5546\u54C1\u5373\u53EF\u83B7\u5F97\u8D85\u503C\u8D60\u54C1',\n layout: 'single',\n products: [\n {\n image: 'https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?ixlib=rb-4.0.3&auto=format&fit=crop&w=964&h=560&q=80',\n tags: [\n { text: '20% OFF', type: 'discount', variant: 'filled' },\n { text: 'New', type: 'new', variant: 'outlined' },\n ],\n name: 'eufyCam 3 Security Camera System',\n description: '4K Ultra HD wireless security camera with advanced AI detection',\n freeGiftLabel: '\u514D\u8D39\u8D60\u54C1',\n freeGifts: [\n {\n id: 'gift-1',\n image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80',\n name: 'eufyCam Solar Panel Charger',\n currentPrice: 'Free',\n originalPrice: '$199.00',\n isNew: true,\n selected: true,\n },\n {\n id: 'gift-2',\n image: 'https://images.unsplash.com/photo-1572569511254-d8f925fe2cbb?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80',\n name: 'eufy HomeBase 3 Hub',\n currentPrice: 'Free',\n originalPrice: '$149.00',\n isNew: true,\n selected: false,\n },\n ],\n giftSelectionMode: 'multiple',\n currentPrice: '$1,999.00',\n originalPrice: '$2,999.00',\n learnMoreText: 'Learn More',\n shopNowText: 'Shop Now',\n },\n ],\n}\n\n// \u53CC\u5217\u5E03\u5C40\u6570\u636E\nconst doubleLayoutData: BuyOneGetOneShelfData = {\n ...basicShelfData,\n layout: 'double',\n products: [\n {\n ...basicShelfData.products![0],\n image: 'https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?ixlib=rb-4.0.3&auto=format&fit=crop&w=482&h=560&q=80',\n },\n {\n image: 'https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=482&h=560&q=80',\n tags: [\n { text: '30% OFF', type: 'discount', variant: 'filled' },\n ],\n name: 'Anker PowerCore Portable Charger',\n description: 'High-capacity portable charger with fast charging technology',\n freeGiftLabel: '\u514D\u8D39\u8D60\u54C1',\n freeGifts: [\n {\n id: 'gift-3',\n image: 'https://images.unsplash.com/photo-1583394838336-acd977736f90?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80',\n name: 'USB-C Cable Premium',\n currentPrice: 'Free',\n originalPrice: '$29.00',\n isNew: false,\n selected: true,\n },\n ],\n giftSelectionMode: 'single',\n currentPrice: '$79.99',\n originalPrice: '$119.99',\n learnMoreText: 'Learn More',\n shopNowText: 'Shop Now',\n },\n ],\n}\n\nconst meta = {\n title: 'Biz Components/BuyOneGetOneShelf',\n component: BuyOneGetOneShelf,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component: '\u4E70\u8D60\u8D27\u67B6 - \u5C55\u793A\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u7EC4\u4EF6\uFF0C\u652F\u6301\u5355\u5217\u548C\u53CC\u5217\u5E03\u5C40\uFF0C\u5305\u542B\u4EA7\u54C1\u4FE1\u606F\u3001\u6807\u7B7E\u3001\u8D60\u54C1\u5217\u8868\u548C\u8D2D\u4E70\u6309\u94AE',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n data: {\n control: 'object',\n description: '\u4E70\u8D60\u8D27\u67B6\u6570\u636E\u914D\u7F6E',\n },\n onProductClick: {\n action: 'product-clicked',\n description: '\u4EA7\u54C1\u5361\u7247\u70B9\u51FB\u4E8B\u4EF6',\n },\n onProductImageClick: {\n action: 'product-image-clicked',\n description: '\u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u4E8B\u4EF6',\n },\n onLearnMore: {\n action: 'learn-more-clicked',\n description: 'Learn More\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6',\n },\n onShopNow: {\n action: 'shop-now-clicked',\n description: 'Shop Now\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6',\n },\n onGiftClick: {\n action: 'gift-clicked',\n description: '\u8D60\u54C1\u70B9\u51FB\u4E8B\u4EF6',\n },\n onGiftSelectionChange: {\n action: 'gift-selection-changed',\n description: '\u8D60\u54C1\u9009\u62E9\u53D8\u5316\u4E8B\u4EF6',\n },\n },\n} satisfies Meta<typeof BuyOneGetOneShelf>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n data: basicShelfData,\n onProductClick: (product) => console.log('Product clicked:', product.name),\n onProductImageClick: (product) => console.log('Product image clicked:', product.name),\n onLearnMore: (product) => console.log('Learn More clicked:', product.name),\n onShopNow: (product) => console.log('Shop Now clicked:', product.name),\n onGiftClick: (gift, product) => console.log('Gift clicked:', gift.name, 'for product:', product.name),\n onGiftSelectionChange: (selectedGifts, product) => console.log('Gift selection changed:', selectedGifts.length, 'gifts selected for', product.name),\n },\n}\n\nexport const SingleLayout: Story = {\n args: {\n data: basicShelfData,\n },\n parameters: {\n docs: {\n description: {\n story: '\u5355\u5217\u5E03\u5C40\uFF1A\u4E00\u6392\u663E\u793A\u4E00\u4E2A\u4EA7\u54C1\uFF0C\u9002\u5408\u91CD\u70B9\u63A8\u8350\u5355\u4E2A\u4EA7\u54C1\u7684\u573A\u666F\u3002',\n },\n },\n },\n}\n\nexport const DoubleLayout: Story = {\n args: {\n data: doubleLayoutData,\n },\n parameters: {\n docs: {\n description: {\n story: '\u53CC\u5217\u5E03\u5C40\uFF1A\u4E00\u6392\u663E\u793A\u4E24\u4E2A\u4EA7\u54C1\uFF0C\u9002\u5408\u5C55\u793A\u591A\u4E2A\u4EA7\u54C1\u7684\u5BF9\u6BD4\u573A\u666F\u3002',\n },\n },\n },\n}\n\nexport const NoHeader: Story = {\n args: {\n data: {\n layout: 'single',\n products: [basicShelfData.products![0]],\n },\n },\n parameters: {\n docs: {\n description: {\n story: '\u65E0\u6807\u9898\u63CF\u8FF0\u7248\u672C\uFF1A\u53EA\u663E\u793A\u4EA7\u54C1\u5361\u7247\uFF0C\u9002\u5408\u5D4C\u5165\u5230\u5176\u4ED6\u9875\u9762\u4E2D\u7684\u573A\u666F\u3002',\n },\n },\n },\n}\n\nexport const MinimalProduct: Story = {\n args: {\n data: {\n layout: 'single',\n products: [\n {\n image: 'https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?ixlib=rb-4.0.3&auto=format&fit=crop&w=964&h=560&q=80',\n tags: [\n { text: 'Limited', type: 'new', variant: 'filled' },\n ],\n name: 'Smart Home Device Collection',\n description: 'Complete smart home automation solution',\n currentPrice: '$599.00',\n originalPrice: '$799.00',\n },\n ],\n },\n },\n parameters: {\n docs: {\n description: {\n story: '\u6700\u5C0F\u5316\u4EA7\u54C1\uFF1A\u65E0\u8D60\u54C1\u5217\u8868\uFF0C\u53EA\u663E\u793A\u57FA\u672C\u4EA7\u54C1\u4FE1\u606F\u548C\u4EF7\u683C\u3002',\n },\n },\n },\n}\n\nexport const WithCustomActions: Story = {\n args: {\n data: {\n ...basicShelfData,\n products: [\n {\n ...basicShelfData.products![0],\n learnMoreText: '\u4E86\u89E3\u8BE6\u60C5',\n shopNowText: '\u7ACB\u5373\u8D2D\u4E70',\n },\n ],\n },\n onLearnMore: (product) => alert(`\u8DF3\u8F6C\u5230\u4EA7\u54C1\u8BE6\u60C5\u9875\u9762: ${product.name}`),\n onShopNow: (product) => alert(`\u6DFB\u52A0\u5230\u8D2D\u7269\u8F66: ${product.name}`),\n onGiftClick: (gift, product) => alert(`\u9009\u62E9\u8D60\u54C1: ${gift.name}`),\n },\n parameters: {\n docs: {\n description: {\n story: '\u81EA\u5B9A\u4E49\u6309\u94AE\u6587\u6848\u548C\u70B9\u51FB\u4E8B\u4EF6\uFF1A\u53EF\u4EE5\u81EA\u5B9A\u4E49\u6309\u94AE\u6587\u5B57\u548C\u5904\u7406\u51FD\u6570\u3002',\n },\n },\n },\n}\n\nexport const SingleGiftSelection: Story = {\n args: {\n data: {\n ...basicShelfData,\n products: [\n {\n ...basicShelfData.products![0],\n giftSelectionMode: 'single',\n freeGifts: [\n {\n id: 'gift-a',\n image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80',\n name: 'eufyCam Solar Panel Charger',\n currentPrice: 'Free',\n originalPrice: '$199.00',\n isNew: true,\n selected: false,\n },\n {\n id: 'gift-b',\n image: 'https://images.unsplash.com/photo-1572569511254-d8f925fe2cbb?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80',\n name: 'eufy HomeBase 3 Hub',\n currentPrice: 'Free',\n originalPrice: '$149.00',\n isNew: true,\n selected: true,\n },\n {\n id: 'gift-c',\n image: 'https://images.unsplash.com/photo-1583394838336-acd977736f90?ixlib=rb-4.0.3&auto=format&fit=crop&w=56&h=56&q=80',\n name: 'USB-C Cable Premium',\n currentPrice: 'Free',\n originalPrice: '$29.00',\n isNew: false,\n selected: false,\n },\n ],\n },\n ],\n },\n onGiftClick: (gift, product) => console.log('Single gift selection:', gift.name),\n onGiftSelectionChange: (selectedGifts, product) => console.log('Single selection changed:', selectedGifts),\n },\n parameters: {\n docs: {\n description: {\n story: '\u5355\u9009\u6A21\u5F0F\uFF1A\u7528\u6237\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u8D60\u54C1\uFF0C\u4F7F\u7528Radio\u6309\u94AE\u3002',\n },\n },\n },\n}\n\nexport const MultipleGiftSelection: Story = {\n args: {\n data: {\n ...basicShelfData,\n products: [\n {\n ...basicShelfData.products![0],\n giftSelectionMode: 'multiple',\n },\n ],\n },\n onGiftClick: (gift, product) => console.log('Multiple gift selection:', gift.name, 'for', product.name),\n onGiftSelectionChange: (selectedGifts, product) => console.log('Multiple selection changed:', selectedGifts.map(g => g.name), 'for', product.name),\n },\n parameters: {\n docs: {\n description: {\n story: '\u591A\u9009\u6A21\u5F0F\uFF1A\u7528\u6237\u53EF\u4EE5\u9009\u62E9\u591A\u4E2A\u8D60\u54C1\uFF0C\u4F7F\u7528Checkbox\u3002',\n },\n },\n },\n}\n\nexport const ComposableDesign: Story = {\n args: {\n data: basicShelfData,\n onProductClick: (product) => {\n console.log('\uD83C\uDFAF Product card clicked:', product.name)\n },\n onProductImageClick: (product) => {\n console.log('\uD83D\uDDBC\uFE0F Product image clicked - opening gallery for:', product.name)\n },\n onLearnMore: (product) => {\n console.log('\uD83D\uDCDA Learn More - navigating to product details:', product.name)\n },\n onShopNow: (product) => {\n console.log('\uD83D\uDED2 Shop Now - adding to cart:', product.name)\n },\n onGiftClick: (gift, product) => {\n console.log('\uD83C\uDF81 Gift clicked:', gift.name, 'for product:', product.name)\n },\n onGiftSelectionChange: (selectedGifts, product) => {\n console.log('\u2705 Gift selection changed for', product.name + ':', selectedGifts.map(g => g.name).join(', '))\n },\n },\n parameters: {\n docs: {\n description: {\n story: '\u7EC4\u5408\u5F0F\u8BBE\u8BA1\u793A\u4F8B\uFF1A\u6240\u6709\u4E8B\u4EF6\u90FD\u901A\u8FC7 props \u900F\u4F20\uFF0C\u5916\u90E8\u53EF\u4EE5\u5B8C\u5168\u63A7\u5236\u4EA4\u4E92\u903B\u8F91\u3002\u6253\u5F00\u6D4F\u89C8\u5668\u63A7\u5236\u53F0\u67E5\u770B\u4E8B\u4EF6\u65E5\u5FD7\u3002',\n },\n },\n },\n}"],
|
|
5
|
+
"mappings": "AACA,MAAkB,QAElB,OAAOA,MAAuD,+CAG9D,MAAMC,EAAwC,CAC5C,MAAO,uCACP,YAAa,qHACb,OAAQ,SACR,SAAU,CACR,CACE,MAAO,iHACP,KAAM,CACJ,CAAE,KAAM,UAAW,KAAM,WAAY,QAAS,QAAS,EACvD,CAAE,KAAM,MAAO,KAAM,MAAO,QAAS,UAAW,CAClD,EACA,KAAM,mCACN,YAAa,kEACb,cAAe,2BACf,UAAW,CACT,CACE,GAAI,SACJ,MAAO,+GACP,KAAM,8BACN,aAAc,OACd,cAAe,UACf,MAAO,GACP,SAAU,EACZ,EACA,CACE,GAAI,SACJ,MAAO,kHACP,KAAM,sBACN,aAAc,OACd,cAAe,UACf,MAAO,GACP,SAAU,EACZ,CACF,EACA,kBAAmB,WACnB,aAAc,YACd,cAAe,YACf,cAAe,aACf,YAAa,UACf,CACF,CACF,EAGMC,EAA0C,CAC9C,GAAGD,EACH,OAAQ,SACR,SAAU,CACR,CACE,GAAGA,EAAe,SAAU,CAAC,EAC7B,MAAO,gHACT,EACA,CACE,MAAO,iHACP,KAAM,CACJ,CAAE,KAAM,UAAW,KAAM,WAAY,QAAS,QAAS,CACzD,EACA,KAAM,mCACN,YAAa,+DACb,cAAe,2BACf,UAAW,CACT,CACE,GAAI,SACJ,MAAO,kHACP,KAAM,sBACN,aAAc,OACd,cAAe,SACf,MAAO,GACP,SAAU,EACZ,CACF,EACA,kBAAmB,SACnB,aAA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OneGetOneShelf", "basicShelfData", "doubleLayoutData", "meta", "buyOneGetOneShelf_stories_default", "Default", "product", "gift", "selectedGifts", "SingleLayout", "DoubleLayout", "NoHeader", "MinimalProduct", "WithCustomActions", "SingleGiftSelection", "MultipleGiftSelection", "g", "ComposableDesign"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../biz-components/EventSchedule/index.js").EventScheduleProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
argTypes: {
|
|
16
|
+
data: {
|
|
17
|
+
description: string;
|
|
18
|
+
control: {
|
|
19
|
+
type: "object";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
className: {
|
|
23
|
+
description: string;
|
|
24
|
+
control: {
|
|
25
|
+
type: "text";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
/**
|
|
33
|
+
* 默认展示 - 两个活动
|
|
34
|
+
*/
|
|
35
|
+
export declare const Default: Story;
|
|
36
|
+
/**
|
|
37
|
+
* 三个活动展示
|
|
38
|
+
*/
|
|
39
|
+
export declare const ThreeEvents: Story;
|
|
40
|
+
/**
|
|
41
|
+
* 单个活动
|
|
42
|
+
*/
|
|
43
|
+
export declare const SingleEvent: Story;
|
|
44
|
+
/**
|
|
45
|
+
* 无背景图片
|
|
46
|
+
*/
|
|
47
|
+
export declare const WithoutBackgroundImage: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as n}from"react/jsx-runtime";import"react";import i from"../biz-components/EventSchedule/index.js";const e=()=>n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M15.833 3.333h-11.666c-.92 0-1.667.746-1.667 1.667v11.667c0 .92.746 1.666 1.667 1.666h11.666c.92 0 1.667-.746 1.667-1.666V5c0-.921-.746-1.667-1.667-1.667z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M13.333 1.667V5M6.667 1.667V5M2.5 8.333h15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),o=()=>n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M10 18.333a8.333 8.333 0 100-16.666 8.333 8.333 0 000 16.666z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M10 5v5l3.333 1.667",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a=()=>n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M16.667 10v6.667c0 .442-.176.866-.489 1.179-.313.312-.737.488-1.178.488H5c-.442 0-.866-.176-1.179-.488A1.667 1.667 0 013.333 16.667V10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M18.333 5.833v4.167H1.667V5.833c0-.442.175-.866.488-1.178.313-.313.737-.489 1.179-.489h13.333c.441 0 .865.176 1.178.489.313.312.489.736.489 1.178zM10 18.333V4.167",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M10 4.167H6.25A2.083 2.083 0 014.167 2.083c0-1.15.933-2.083 2.083-2.083C8.333 0 10 4.167 10 4.167zM10 4.167h3.75a2.083 2.083 0 002.083-2.084c0-1.15-.933-2.083-2.083-2.083C11.667 0 10 4.167 10 4.167z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),c={scheduleList:[{title:"\u65E9\u9E1F\u4E13\u5C5E\u798F\u5229",date:"2024-12-01",active:!0,backgroundImage:"https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=200&h=150&fit=crop",items:[{icon:t(e,{}),label:"12\u67081\u65E5 - 12\u670815\u65E5"},{icon:t(o,{}),label:"\u9650\u65F6\u4F18\u60E0 48 \u5C0F\u65F6"},{icon:t(a,{}),label:"\u8D2D\u4E70\u5373\u9001\u7CBE\u7F8E\u793C\u54C1"}]},{title:"\u5723\u8BDE\u7279\u60E0\u6D3B\u52A8",date:"2024-12-16",active:!1,backgroundImage:"https://images.unsplash.com/photo-1512909006721-3d6018887383?w=200&h=150&fit=crop",items:[{icon:t(e,{}),label:"12\u670816\u65E5 - 12\u670831\u65E5"},{icon:t(o,{}),label:"\u5168\u5929\u5019\u4F18\u60E0"},{icon:t(a,{}),label:"\u6EE1\u989D\u8D60\u9001\u5723\u8BDE\u793C\u76D2"}]}]},r={scheduleList:[{title:"\u65B0\u5E74\u9884\u70ED\u6D3B\u52A8",date:"2024-12-01",active:!0,backgroundImage:"https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=200&h=150&fit=crop",items:[{icon:t(e,{}),label:"12\u67081\u65E5 - 12\u670810\u65E5"},{icon:t(o,{}),label:"\u6BCF\u65E5\u4E0A\u534810\u70B9\u5F00\u62A2"},{icon:t(a,{}),label:"\u524D100\u540D\u9001\u795E\u79D8\u793C\u7269"}]},{title:"\u5723\u8BDE\u72C2\u6B22",date:"2024-12-11",active:!1,backgroundImage:"https://images.unsplash.com/photo-1512909006721-3d6018887383?w=200&h=150&fit=crop",items:[{icon:t(e,{}),label:"12\u670811\u65E5 - 12\u670825\u65E5"},{icon:t(o,{}),label:"\u5168\u5929\u4F18\u60E0\u4E0D\u95F4\u65AD"},{icon:t(a,{}),label:"\u6EE1\u51CF\u6D3B\u52A8\u6700\u9AD8\u7701500"}]},{title:"\u8DE8\u5E74\u7279\u60E0",date:"2024-12-26",active:!1,backgroundImage:"https://images.unsplash.com/photo-1467810563316-b5476525c0f9?w=200&h=150&fit=crop",items:[{icon:t(e,{}),label:"12\u670826\u65E5 - 1\u67081\u65E5"},{icon:t(o,{}),label:"\u5012\u8BA1\u65F6\u7279\u60E0"},{icon:t(a,{}),label:"\u65B0\u5E74\u793C\u5305\u9650\u91CF\u62A2\u8D2D"}]}]},s={title:"Biz Components/EventSchedule",component:i,parameters:{layout:"fullscreen",docs:{description:{component:"\u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6 - \u5C55\u793A\u6D3B\u52A8\u65F6\u95F4\u8F74\u548C\u8BE6\u7EC6\u4FE1\u606F\u5361\u7247\uFF0C\u652F\u6301\u591A\u4E2A\u6D3B\u52A8\u540C\u65F6\u5C55\u793A\uFF0C\u5E26\u6709\u6FC0\u6D3B\u72B6\u6001\u6307\u793A"}}},tags:["autodocs"],argTypes:{data:{description:"\u4E1A\u52A1\u6570\u636E\uFF0C\u5305\u542B\u65E5\u7A0B\u5217\u8868",control:{type:"object"}},className:{description:"\u81EA\u5B9A\u4E49\u6837\u5F0F\u7C7B\u540D",control:{type:"text"}}}};var p=s;const u={args:{data:c}},m={args:{data:r}},g={args:{data:{scheduleList:[{title:"\u9650\u65F6\u79D2\u6740\u6D3B\u52A8",date:"2024-12-01",active:!0,backgroundImage:"https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=200&h=150&fit=crop",items:[{icon:t(e,{}),label:"12\u67081\u65E5\u5168\u5929"},{icon:t(o,{}),label:"\u6BCF\u5C0F\u65F6\u6574\u70B9\u5F00\u62A2"},{icon:t(a,{}),label:"\u79D2\u6740\u4EF7\u4F4E\u81F33\u6298"}]}]}}},b={args:{data:{scheduleList:[{title:"\u590F\u5B63\u6E05\u4ED3\u7279\u5356",date:"2024-06-01",active:!0,items:[{icon:t(e,{}),label:"6\u67081\u65E5 - 6\u670830\u65E5"},{icon:t(o,{}),label:"\u5168\u5929\u5019\u4F18\u60E0"},{icon:t(a,{}),label:"\u4E70\u4E00\u9001\u4E00"}]},{title:"\u65B0\u54C1\u4E0A\u5E02",date:"2024-07-01",active:!1,items:[{icon:t(e,{}),label:"7\u67081\u65E5\u8D77"},{icon:t(o,{}),label:"\u6301\u7EED\u4E00\u4E2A\u6708"},{icon:t(a,{}),label:"\u65B0\u54C1\u5C1D\u9C9C\u4EF7"}]}]}}};export{u as Default,g as SingleEvent,m as ThreeEvents,b as WithoutBackgroundImage,p as default};
|
|
2
|
+
//# sourceMappingURL=eventSchedule.stories.js.map
|