@anker-in/headless-ui 1.3.81 → 1.3.82
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/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/cjs/biz-components/MiniCart/CircleProgress.d.ts +22 -1
- package/dist/cjs/biz-components/MiniCart/CircleProgress.js +2 -1
- package/dist/cjs/biz-components/MiniCart/MiniCartDialog.d.ts +4 -2
- package/dist/cjs/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/cjs/biz-components/MiniCart/index.d.ts +45 -0
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/index.d.ts +2 -2
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/helpers/ScrollLoadVideo.d.ts +9 -1
- package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/esm/biz-components/MiniCart/CircleProgress.d.ts +22 -1
- package/dist/esm/biz-components/MiniCart/CircleProgress.js +2 -1
- package/dist/esm/biz-components/MiniCart/MiniCartDialog.d.ts +4 -2
- package/dist/esm/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/esm/biz-components/MiniCart/index.d.ts +45 -0
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/index.d.ts +2 -2
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/helpers/ScrollLoadVideo.d.ts +9 -1
- package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
- package/package.json +1 -1
- package/style.css +21 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as tt,jsx as e,jsxs as u}from"react/jsx-runtime";import le,{useImperativeHandle as Se,useRef as k,useState as Pe,useEffect as Me}from"react";import C from"gsap";import{ScrollTrigger as H}from"gsap/dist/ScrollTrigger";import O from"jump.js";import{buildPictureSource as Re,resolveTierMedia as V,useMediaTier as Ee}from"./mediaResolver.js";import{useInView as De}from"react-intersection-observer";import je from"../../helpers/ScrollLoadVideo.js";import{Button as z,Heading as Ae,Picture as U,Text as G,Countdown as Oe}from"../../components/index.js";import{cn as p}from"../../helpers/index.js";import{cva as I}from"class-variance-authority";import{withLayout as Ue}from"../../shared/Styles.js";import{useExposure as Ge}from"../../hooks/useExposure.js";import{buildTrackingRef as Je,trackUrlRef as L}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as h,resolveComponentMediaType as _e}from"../../shared/track.js";import{getLocalizedPath as qe}from"../../helpers/utils.js";import{useAiuiContext as Fe}from"../AiuiProvider/index.js";import{sizeMap as We}from"../../components/button.js";import{VideoModal as Ye}from"../VideoModal/index.js";import Ze from"./HeroBannerCarousel.js";const f="hero_banner",Ke=I("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Qe=I("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Xe=I("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),$e=I("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),et=({size:i="base"})=>{const{width:T,height:c}=We[i];return e("svg",{width:T,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},pe=le.forwardRef(({data:i,className:T,classNames:c={},onSecondaryClick:J,onPrimaryClick:_,onTertiaryClick:q,jumpOptions:ce={},a11yLabels:ue,...F},W)=>{const{locale:Y,pageHandle:me}=Fe(),Z=i.mode!=="single"&&!!i.items&&i.items.length>0,S={...{duration:500,offset:0},...ce},w=t=>!t||!Y?t:qe(t,Y),{label:K,title:s,subtitle:n,endDate:Q,endDate_tz:de,dateFormat:fe,pcImage:P,isShowVideo:X,isVideoLoop:ge=!0,primaryButton:o,secondaryButton:r,tertiaryButton:a,theme:be="light",size:M="default",titleSize:R,caption:$=[],blockLink:B,iconArray:ee,align:b="left",enableParallax:te=!0}=i,E=Array.isArray($)?$:[],ve=Array.isArray(ee)?ee:void 0,re=Ee(),ne=Re(i),xe=V(i,re,"video")?.url||"",[oe,ae]=Pe(!1),{ref:ye,inView:ie}=De(),D=k(null),j=k(null),A=k(null),v=k(null),d=k(null),m=_e(X),N=Je(me??"",m,f),g=V(i,re,m==="video"?"video":"image")?.id||P?.id||"",ke=s?.trim()||n?.trim()||P?.alt?.trim()||void 0,he=s!==void 0?s?.trim()||n?.trim()||P?.alt?.trim()||void 0:n&&n.trim()||"",Te=n&&n.trim()||"";Ge(d,{componentType:m,componentName:f,componentTitle:he,componentDescription:Te,creativeId:g,position:1});const we=B?L(w(B),N):void 0,Be=r?.link?L(w(r.link),N):void 0,Ne=o?.link?L(w(o.link),N):void 0,Ce=a?.link?L(w(a.link),N):void 0,He=h({interactive:!!B,componentType:m,componentName:f,title:s,description:n,position:1,creativeId:g}),Ve=h({interactive:!0,componentType:m,componentName:f,title:s,description:n,buttonName:"video play",position:1,creativeId:g}),ze=h({interactive:!!(r?.link||r?.isCustomSecondaryButton),componentType:m,componentName:f,title:s,description:n,buttonName:r?.text,position:1,creativeId:g}),Ie=h({interactive:!!(o?.link||o?.isCustomPrimaryButton),componentType:m,componentName:f,title:s,description:n,buttonName:o?.text,position:1,creativeId:g}),Le=h({interactive:!!(a?.link||a?.isCustomTertiaryButton),componentType:m,componentName:f,title:s,description:n,buttonName:a?.text,position:1,creativeId:g});return Se(W,()=>d.current),Me(()=>{if(Z||!te)return;C.registerPlugin(H);function t(){if(!v.current)return;const l=d.current?.clientHeight||100;window.innerHeight<=l?D.current=H.create({trigger:d.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:x=>{const y=x.progress*40-20;C.set(v.current,{yPercent:y})}}):(A.current=H.create({trigger:d.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:x=>{const y=x.progress*20-20;C.set(v.current,{yPercent:y})}}),j.current=H.create({trigger:d.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:x=>{const y=x.progress*20;C.set(v.current,{yPercent:y})}}))}return ie&&t(),()=>{D.current&&D.current.kill(),A.current&&A.current.kill(),j.current&&j.current.kill()}},[ie,i.items,te]),Z?e(Ze,{data:i,className:T,classNames:c,onPrimaryClick:_,onSecondaryClick:J,onTertiaryClick:q,a11yLabels:ue,ref:W,...F}):e("div",{...F,ref:ye,"data-ui-component-id":"HeroBanner",className:p(c.root),children:u("div",{ref:d,className:p(be==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":M==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":M==="sm"},T),children:[B&&e("a",{className:"absolute inset-0 z-10",href:we,tabIndex:-1,"aria-hidden":"true","aria-label":ke,...He}),e("div",{ref:v,className:p("absolute left-0 top-0 size-full"),children:X?u(tt,{children:[e(je,{poster:void 0,src:xe,className:"laptop:w-full absolute inset-0 h-full",videoClassName:"h-full object-cover",muted:!0,loop:ge,playsInline:!0,onPlaying:t=>{t.currentTarget.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")}}),e("div",{"data-video-poster":"true",className:"laptop:w-full pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:e(U,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:V(i,"lgDesktop","image")?.alt||"",source:ne})})]}):e(U,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:V(i,"lgDesktop","image")?.alt||"",source:ne})}),u("div",{className:Ke({align:b}),children:[u("div",{className:Qe({align:b}),children:[K&&e(G,{size:2,as:"p",className:p("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:K}),s&&e(Ae,{as:R==="4"?"h1":"h2",html:s,className:p("hero-banner-title",c.title),size:R?Number(R||"5"):M==="sm"?4:5}),n&&e(G,{as:"p",size:2,className:p("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",c.subtitle),html:n}),Q&&e("div",{className:"mt-3",children:e(Oe,{endDate:Q,endDate_tz:de,dateFormat:fe,variant:"spacious",align:b})})]}),u("div",{className:p(Xe({align:b}),c.buttonGroup),children:[u("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[r?.isShowPlayVideoButton&&r?.playVideoButtonText?u(z,{onClick:()=>ae(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...Ve,children:[r?.playVideoButtonText," ",e(et,{size:"lg"})]}):r?.text?u(z,{"aria-label":s??n,size:"lg",variant:"secondary",className:p("hero-banner-secondary-button",c.secondaryButton),as:r?.isCustomSecondaryButton?"button":"a",href:Be,target:r?.target,rel:r?.target==="_blank"?r?.rel??"noopener noreferrer":r?.rel,onClick:t=>{if(r.link?.startsWith("#")){t.preventDefault();const l=document.querySelector(r.link);l&&O(l,S)}r?.isCustomSecondaryButton&&J?.(i,t,r?.customSecondaryEventId)},...ze,children:[r?.text,e("span",{className:"sr-only",children:s??n})]}):null,o&&o.text&&e(z,{"aria-label":s??n,size:"lg",variant:"primary",className:p("hero-banner-primary-button",c.primaryButton),as:o?.isCustomPrimaryButton?"button":"a",href:Ne,target:o?.target,rel:o?.target==="_blank"?o?.rel??"noopener noreferrer":o?.rel,onClick:t=>{if(o.link?.startsWith("#")){t.preventDefault();const l=document.querySelector(o.link);l&&O(l,S)}o?.isCustomPrimaryButton&&_?.(i,t,o?.customPrimaryEventId)},...Ie,children:o.text})]}),a&&a.text&&u(z,{"aria-label":s??n,size:"lg",variant:"link",className:p("hero-banner-tertiary-button w-auto p-0",c.tertiaryButton),as:a?.isCustomTertiaryButton?"button":"a",href:Ce,target:a?.target,rel:a?.target==="_blank"?a?.rel??"noopener noreferrer":a?.rel,onClick:t=>{if(a.link?.startsWith("#")){t.preventDefault();const l=document.querySelector(a.link);l&&O(l,S)}a?.isCustomTertiaryButton&&q?.(i,t,a?.customTertiaryEventId)},...Le,children:[a.text,e("span",{className:"sr-only",children:s??n})]})]}),e("div",{className:$e({align:b}),children:ve?.map(t=>e("div",{className:"h-12",children:e(U,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:t?.pcImage?.alt||"",source:t?.pcImage?.url})},t?.pcImage?.url||t?.pcImage?.alt))})]}),E.length>0&&e("div",{className:p("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",c.captionGroup),children:E.map((t,l)=>u(le.Fragment,{children:[e(G,{size:2,className:p("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:t.title}),l<E.length-1&&e("div",{className:p("bg-info-primary w-px")})]},t.title))}),oe&&e(Ye,{visible:oe,videoUrl:r?.isYoutubeVideo?void 0:r?.videoUrl?.url,youTubeId:r?.isYoutubeVideo?r?.youtubeId:void 0,onCloseModal:()=>ae(!1)})]})})});pe.displayName="HeroBanner";var wt=Ue(pe);export{wt as default};
|
|
1
|
+
"use client";import{Fragment as rt,jsx as t,jsxs as u}from"react/jsx-runtime";import pe,{useImperativeHandle as Ee,useRef as k,useState as Me,useEffect as Pe}from"react";import N from"gsap";import{ScrollTrigger as C}from"gsap/dist/ScrollTrigger";import O from"jump.js";import{buildPictureSource as Re,resolveTierMedia as L,useMediaTier as De}from"./mediaResolver.js";import{useInView as je}from"react-intersection-observer";import Ae from"../../helpers/ScrollLoadVideo.js";import{Button as V,Heading as Oe,Picture as U,Text as G,Countdown as Ue}from"../../components/index.js";import{cn as p}from"../../helpers/index.js";import{cva as S}from"class-variance-authority";import{withLayout as Ge}from"../../shared/Styles.js";import{useExposure as Je}from"../../hooks/useExposure.js";import{buildTrackingRef as _e,trackUrlRef as z}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as h,resolveComponentMediaType as qe}from"../../shared/track.js";import{getLocalizedPath as Fe}from"../../helpers/utils.js";import{useAiuiContext as We}from"../AiuiProvider/index.js";import{sizeMap as Ye}from"../../components/button.js";import{VideoModal as Ze}from"../VideoModal/index.js";import Ke from"./HeroBannerCarousel.js";const f="hero_banner",Qe=S("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Xe=S("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),$e=S("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),et=S("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),tt=({size:s="base"})=>{const{width:T,height:c}=Ye[s];return t("svg",{width:T,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ce=pe.forwardRef(({data:s,className:T,classNames:c={},onSecondaryClick:J,onPrimaryClick:_,onTertiaryClick:q,jumpOptions:ue={},a11yLabels:me,...F},W)=>{const{locale:Y,pageHandle:de}=We(),Z=s.mode!=="single"&&!!s.items&&s.items.length>0,I={...{duration:500,offset:0},...ue},w=e=>!e||!Y?e:Fe(e,Y),{label:K,title:l,subtitle:o,endDate:Q,endDate_tz:fe,dateFormat:ge,pcImage:E,isShowVideo:X,isVideoLoop:be=!0,primaryButton:a,secondaryButton:r,tertiaryButton:i,theme:ve="light",size:M="default",titleSize:P,caption:$=[],blockLink:B,iconArray:ee,align:b="left",enableParallax:te=!0}=s,R=Array.isArray($)?$:[],ye=Array.isArray(ee)?ee:void 0,re=De(),ne=Re(s),xe=L(s,re,"video")?.url||"",[oe,ae]=Me(!1),{ref:ke,inView:ie}=je(),D=k(null),j=k(null),A=k(null),v=k(null),d=k(null),m=qe(X),H=_e(de??"",m,f),g=L(s,re,m==="video"?"video":"image")?.id||E?.id||"",he=l?.trim()||o?.trim()||E?.alt?.trim()||void 0,Te=l!==void 0?l?.trim()||o?.trim()||E?.alt?.trim()||void 0:o&&o.trim()||"",we=o&&o.trim()||"";Je(d,{componentType:m,componentName:f,componentTitle:Te,componentDescription:we,creativeId:g,position:1});const Be=B?z(w(B),H):void 0,He=r?.link?z(w(r.link),H):void 0,Ne=a?.link?z(w(a.link),H):void 0,Ce=i?.link?z(w(i.link),H):void 0,Le=h({interactive:!!B,componentType:m,componentName:f,title:l,description:o,position:1,creativeId:g}),Ve=h({interactive:!0,componentType:m,componentName:f,title:l,description:o,buttonName:"video play",position:1,creativeId:g}),Se=h({interactive:!!(r?.link||r?.isCustomSecondaryButton),componentType:m,componentName:f,title:l,description:o,buttonName:r?.text,position:1,creativeId:g}),ze=h({interactive:!!(a?.link||a?.isCustomPrimaryButton),componentType:m,componentName:f,title:l,description:o,buttonName:a?.text,position:1,creativeId:g}),Ie=h({interactive:!!(i?.link||i?.isCustomTertiaryButton),componentType:m,componentName:f,title:l,description:o,buttonName:i?.text,position:1,creativeId:g});return Ee(W,()=>d.current),Pe(()=>{if(Z||!te)return;N.registerPlugin(C);function e(){if(!v.current)return;const n=d.current?.clientHeight||100;window.innerHeight<=n?D.current=C.create({trigger:d.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:y=>{const x=y.progress*40-20;N.set(v.current,{yPercent:x})}}):(A.current=C.create({trigger:d.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:y=>{const x=y.progress*20-20;N.set(v.current,{yPercent:x})}}),j.current=C.create({trigger:d.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:y=>{const x=y.progress*20;N.set(v.current,{yPercent:x})}}))}return ie&&e(),()=>{D.current&&D.current.kill(),A.current&&A.current.kill(),j.current&&j.current.kill()}},[ie,s.items,te]),Z?t(Ke,{data:s,className:T,classNames:c,onPrimaryClick:_,onSecondaryClick:J,onTertiaryClick:q,a11yLabels:me,ref:W,...F}):t("div",{...F,ref:ke,"data-ui-component-id":"HeroBanner",className:p(c.root),children:u("div",{ref:d,className:p(ve==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":M==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":M==="sm"},T),children:[B&&t("a",{className:"absolute inset-0 z-10",href:Be,tabIndex:-1,"aria-hidden":"true","aria-label":he,...Le}),t("div",{ref:v,className:p("absolute left-0 top-0 size-full"),children:X?u(rt,{children:[t(Ae,{poster:void 0,src:xe,className:"laptop:w-full absolute inset-0 h-full transition-opacity duration-500",videoLayerClassName:"opacity-0",videoClassName:"h-full object-cover",muted:!0,loop:be,playsInline:!0,onPlaying:e=>{const n=e.currentTarget;n.parentElement?.classList.remove("opacity-0"),n.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:e=>{const n=e.currentTarget;if(n.currentTime>=.5)return;n.parentElement?.classList.add("opacity-0"),n.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),t("div",{"data-video-poster":"true",className:"laptop:w-full bg-container-primary pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:t(U,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:L(s,"lgDesktop","image")?.alt||"",source:ne})})]}):t(U,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:L(s,"lgDesktop","image")?.alt||"",source:ne})}),u("div",{className:Qe({align:b}),children:[u("div",{className:Xe({align:b}),children:[K&&t(G,{size:2,as:"p",className:p("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:K}),l&&t(Oe,{as:P==="4"?"h1":"h2",html:l,className:p("hero-banner-title",c.title),size:P?Number(P||"5"):M==="sm"?4:5}),o&&t(G,{as:"p",size:2,className:p("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",c.subtitle),html:o}),Q&&t("div",{className:"mt-3",children:t(Ue,{endDate:Q,endDate_tz:fe,dateFormat:ge,variant:"spacious",align:b})})]}),u("div",{className:p($e({align:b}),c.buttonGroup),children:[u("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[r?.isShowPlayVideoButton&&r?.playVideoButtonText?u(V,{onClick:()=>ae(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...Ve,children:[r?.playVideoButtonText," ",t(tt,{size:"lg"})]}):r?.text?u(V,{"aria-label":l??o,size:"lg",variant:"secondary",className:p("hero-banner-secondary-button",c.secondaryButton),as:r?.isCustomSecondaryButton?"button":"a",href:He,target:r?.target,rel:r?.target==="_blank"?r?.rel??"noopener noreferrer":r?.rel,onClick:e=>{if(r.link?.startsWith("#")){e.preventDefault();const n=document.querySelector(r.link);n&&O(n,I)}r?.isCustomSecondaryButton&&J?.(s,e,r?.customSecondaryEventId)},...Se,children:[r?.text,t("span",{className:"sr-only",children:l??o})]}):null,a&&a.text&&t(V,{"aria-label":l??o,size:"lg",variant:"primary",className:p("hero-banner-primary-button",c.primaryButton),as:a?.isCustomPrimaryButton?"button":"a",href:Ne,target:a?.target,rel:a?.target==="_blank"?a?.rel??"noopener noreferrer":a?.rel,onClick:e=>{if(a.link?.startsWith("#")){e.preventDefault();const n=document.querySelector(a.link);n&&O(n,I)}a?.isCustomPrimaryButton&&_?.(s,e,a?.customPrimaryEventId)},...ze,children:a.text})]}),i&&i.text&&u(V,{"aria-label":l??o,size:"lg",variant:"link",className:p("hero-banner-tertiary-button w-auto p-0",c.tertiaryButton),as:i?.isCustomTertiaryButton?"button":"a",href:Ce,target:i?.target,rel:i?.target==="_blank"?i?.rel??"noopener noreferrer":i?.rel,onClick:e=>{if(i.link?.startsWith("#")){e.preventDefault();const n=document.querySelector(i.link);n&&O(n,I)}i?.isCustomTertiaryButton&&q?.(s,e,i?.customTertiaryEventId)},...Ie,children:[i.text,t("span",{className:"sr-only",children:l??o})]})]}),t("div",{className:et({align:b}),children:ye?.map(e=>t("div",{className:"h-12",children:t(U,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:e?.pcImage?.alt||"",source:e?.pcImage?.url})},e?.pcImage?.url||e?.pcImage?.alt))})]}),R.length>0&&t("div",{className:p("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",c.captionGroup),children:R.map((e,n)=>u(pe.Fragment,{children:[t(G,{size:2,className:p("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:e.title}),n<R.length-1&&t("div",{className:p("bg-info-primary w-px")})]},e.title))}),oe&&t(Ze,{visible:oe,videoUrl:r?.isYoutubeVideo?void 0:r?.videoUrl?.url,youTubeId:r?.isYoutubeVideo?r?.youtubeId:void 0,onCloseModal:()=>ae(!1)})]})})});ce.displayName="HeroBanner";var wt=Ge(ce);export{wt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as xt,jsx as a,jsxs as b}from"react/jsx-runtime";import fe,{useRef as ye,useEffect as $,useCallback as L,useState as ne}from"react";import{Swiper as Ke,SwiperSlide as Qe}from"swiper/react";import Xe from"../../helpers/ScrollLoadVideo.js";import{cn as N,getLocalizedPath as et}from"../../helpers/index.js";import{buildPictureSource as tt,resolveTierMedia as O,useMediaTier as Ee}from"./mediaResolver.js";import{Button as oe,Heading as nt,Text as be,Countdown as ot,Picture as he}from"../../components/index.js";import{useCarouselPlayback as at}from"../../hooks/useCarouselPlayback.js";import{CarouselArrows as rt,CarouselCornerToggle as it,CarouselProgressControls as st}from"../../shared/CarouselControls.js";import{buildClickTrackingProps as lt,gaTrack as dt,resolveComponentMediaType as Be,trackComponentClick as ct}from"../../shared/track.js";import{buildPageGroup as ut,buildTrackingRef as pt,trackUrlRef as mt}from"../../shared/trackUrlRef.js";import{useExposure as gt}from"../../hooks/useExposure.js";import{useAiuiContext as vt}from"../AiuiProvider/index.js";import{VideoModal as ft}from"../VideoModal/index.js";import"swiper/css";const yt=({size:c="base"})=>{const I=c==="lg"?"20":c==="sm"?"16":"18";return a("svg",{width:I,height:I,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:a("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ae="hero_banner",bt=({data:c,isActive:I,videoRef:re,slideIndex:G,containerSize:U="default",theme:ie="light",slideLabel:se,position:Y,locale:T,pageHandle:s,onPlayVideo:R,onPrimaryClick:W,onSecondaryClick:m,onTertiaryClick:le})=>{const{pcImage:M,isVideoLoop:de=!0,isShowVideo:V,title:h,subtitle:k,label:_,endDate:z,endDate_tz:Z,dateFormat:J,iconArray:y,caption:E,blockLink:x,primaryButton:l,secondaryButton:r,tertiaryButton:d,align:B="left",titleSize:H}=c,F=Ee(),C=tt(c),g=O(c,"lgDesktop","image")?.alt||M?.alt||"",ce=O(c,F,"video")?.url||"",f=!!C&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(C),S=Be(V),ue=O(c,F,V?"video":"image")?.id||M?.id||"",pe=`${pt(s??"",S,ae)}_${Y}`,K=n=>n&&T?et(n,T):n,A=n=>n?mt(K(n),pe):void 0,P=(n,i)=>lt({interactive:n,componentType:S,componentName:ae,title:h,description:k,buttonName:i,position:Y,creativeId:ue});return b("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":se,className:N("text-info-primary relative w-full overflow-hidden transition-colors duration-500",ie==="dark"&&"aiui-dark",U==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[x&&a("a",{className:"absolute inset-0 z-10",href:A(x),tabIndex:-1,"aria-hidden":"true","aria-label":h?.trim()||k?.trim()||g||void 0,...P(!0)}),V?b(xt,{children:[a(Xe,{videoRef:re,src:ce,poster:void 0,className:"absolute inset-0 size-full",videoClassName:"size-full object-cover",muted:!0,loop:de,playsInline:!0,onPlaying:n=>{n.currentTarget.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:n=>{const i=n.currentTarget;if(i.currentTime>=.5)return;i.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),f&&a("div",{"data-video-poster":"true",className:"pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:a(he,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:G===0?"eager":"lazy",fetchPriority:G===0?"high":"auto",alt:g,source:C})})]}):a(he,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:g,source:C}),b("div",{className:N("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",B==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]"),children:[b("div",{className:N("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",B==="center"?"text-center":"laptop:text-left"),children:[_&&a(be,{size:2,as:"p",className:N("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:_}),h&&a(nt,{as:H==="4"?"h1":"h2",html:h,size:H?Number(H||"5"):U==="sm"?4:5}),k&&a(be,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:k}),z&&a("div",{className:"mt-3",children:a(ot,{endDate:z,endDate_tz:Z,dateFormat:J,variant:"spacious",align:B})})]}),(l?.text||r?.text||d?.text)&&b("div",{className:N("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",B==="center"?"justify-center":"laptop:justify-start"),children:[r?.isShowPlayVideoButton&&r?.playVideoButtonText?b(oe,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>R?.(),...P(!0,"video play"),children:[r.playVideoButtonText," ",a(yt,{size:"lg"})]}):r?.text?b(oe,{size:"lg",variant:"secondary",as:r?.isCustomSecondaryButton?"button":"a",href:A(r.link),target:r?.target,rel:r?.target==="_blank"?r?.rel??"noopener noreferrer":r?.rel,onClick:n=>r?.isCustomSecondaryButton&&m?.(c,n,r?.customSecondaryEventId),...P(!!(r.link||r.isCustomSecondaryButton),r.text),children:[r.text,a("span",{className:"sr-only",children:h??k})]}):null,l?.text&&a(oe,{size:"lg",variant:"primary",as:l?.isCustomPrimaryButton?"button":"a",href:A(l.link),target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:n=>l?.isCustomPrimaryButton&&W?.(c,n,l?.customPrimaryEventId),...P(!!(l.link||l.isCustomPrimaryButton),l.text),children:l.text}),d?.text&&b(oe,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:d?.isCustomTertiaryButton?"button":"a",href:A(d.link),target:d?.target,rel:d?.target==="_blank"?d?.rel??"noopener noreferrer":d?.rel,onClick:n=>d?.isCustomTertiaryButton&&le?.(c,n,d?.customTertiaryEventId),...P(!!(d.link||d.isCustomTertiaryButton),d.text),children:[d.text,a("span",{className:"sr-only",children:h??k})]})]}),y&&y.length>0&&a("div",{className:N("flex items-center gap-2",B==="center"?"justify-center":"justify-start"),children:y.map(n=>a("div",{className:"h-12",children:a(he,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:n?.pcImage?.alt||"",source:n?.pcImage?.url})},n?.pcImage?.url||n?.pcImage?.alt))})]}),E&&E.length>0&&a("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:E.map((n,i)=>b(fe.Fragment,{children:[a(be,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:n.title}),i<E.length-1&&a("div",{className:"bg-info-primary w-px"})]},n.title))})]})},ht={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Pe=fe.forwardRef(({data:c,className:I,classNames:re={},a11yLabels:G,onPrimaryClick:U,onSecondaryClick:ie,onTertiaryClick:se,...Y},T)=>{const s=c.items||[],R=c.carousel,W=R?.size??c.size??"default",m={...ht,...G},{locale:le,pageHandle:M,trackingData:de}=vt(),V=Ee(),h=ut({pageHandle:M,pageGroup:de?.pageGroup}),k=ye(null),[_,z]=ne(null),[Z,J]=ne(null),[y,E]=ne(null),[x,l]=ne(null),r=ye(s);$(()=>{r.current=s});const d=e=>e!==void 0&&e!==999&&e>=5,B=e=>e!==void 0&&e!==999&&e>=1&&e<=30,H=R?.autoplaySeconds,F=e=>{const t=e?.autoplaySeconds;return B(t)?t:d(H)?H:void 0},C=s.length>1&&s.some(e=>F(e)!==void 0),g=ye(s.map(()=>fe.createRef())),ce=(R?.showArrows??!0)&&s.length>1,f=L((e,t)=>{dt({event:"ga4Event",event_name:e,event_parameters:t})},[]),S=L(e=>r.current[e]?.isShowVideo?"video":"image",[]),ue=L((e,t)=>{t==="swipe"&&f("hero_banner_swipe",{to_index:e}),f("hero_banner_slide_view",{index:e,total:r.current.length,media_type:S(e),trigger:t})},[f,S]),pe=L((e,t,o,p="arrow")=>{f("hero_banner_arrow_click",{direction:e,from_index:t,to_index:o,source:p})},[f]),K=L((e,t)=>{f(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:S(t)})},[f,S]),A=L((e,t)=>{const o=r.current[t];o&&ct({pageGroup:h,componentType:"video",componentName:ae,position:t+1,buttonName:e?"video pause":"video play",componentTitle:o.title,componentDescription:o.subtitle,creativeId:O(o,V,"video")?.id||o.pcImage?.id||""})},[h,V]),P=L(e=>{g.current.forEach((o,p)=>{p!==e&&o.current&&(o.current.pause(),o.current.currentTime=0)});const t=g.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:n,activeIndex:i,playbackState:xe,resetNonce:Ne,announcement:_e,activeFrameIntervalSec:Se,isTimerRunning:He,handleSwiperInit:Ae,handleSlideChange:Ie,handleTransitionEnd:Re,handleSliderFirstMove:Me,goToSlide:Te,goToSlideIndex:ze,handlePausePlayClick:Fe,notifyVideoPlaying:ke,handleFocus:De,handleBlur:je}=at({frameCount:s.length,resolveFrameIntervalSec:e=>F(s[e]),isAutoplayEnabled:C,swiperRef:k,slideStatusLabel:m.slideStatus,onSlideMediaSync:P,onSlideChange:ue,onArrowNavigate:pe,delaysCountdownForVideo:e=>!!r.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{K(e,t);const o=g.current[t]?.current;o&&(e?o.pause():o.ended||o.play()?.catch(()=>{}))}}),qe=L(e=>{n.current=e,typeof T=="function"?T(e):T&&(T.current=e)},[T,n]),v=s[i]??s[0],$e=Be(v?.isShowVideo),Oe=v?.title!==void 0?v?.title?.trim()||v?.subtitle?.trim()||v?.pcImage?.alt?.trim()||void 0:v?.subtitle&&v.subtitle.trim()||"",Ge=v&&(O(v,V,v.isShowVideo?"video":"image")?.id||v.pcImage?.id)||"";gt(n,{componentType:$e,componentName:ae,componentTitle:Oe,componentDescription:v?.subtitle?.trim()||"",creativeId:Ge,position:1}),$(()=>{z(null),J(null);const e=r.current[i],t=g.current[i]?.current;if(!e?.isShowVideo||!t)return;const o=()=>z(t.ended?"ended":t.paused?"paused":"playing"),p=()=>J(Number.isFinite(t.duration)?t.duration:null),Q=()=>{o(),ke(i)};return o(),p(),t.addEventListener("playing",Q),t.addEventListener("pause",o),t.addEventListener("ended",o),t.addEventListener("loadedmetadata",p),()=>{t.removeEventListener("playing",Q),t.removeEventListener("pause",o),t.removeEventListener("ended",o),t.removeEventListener("loadedmetadata",p)}},[i,ke]),$(()=>{const e=r.current[i];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=g.current[i]?.current;if(!t)return;const o=(u,w,te,ve)=>{if(!(!u||typeof w!="number"||typeof te!="number"||typeof ve!="number"))return ve>=w&&ve<te?u:void 0};let p=null;const Q=u=>{p=u,E(w=>w&&w.index===i&&w.theme===u?w:{index:i,theme:u})},Le=u=>{Q(o(e.theme_1,e.star_time_1,e.end_time_1,u)??o(e.theme_2,e.star_time_2,e.end_time_2,u)??e.theme??"light")},X=t;let j=0,q=0;const me=typeof X.requestVideoFrameCallback=="function",Je=()=>me?q!==0:j!==0,ge=()=>{if(!Je())if(me){const u=(w,te)=>{Le(te.mediaTime),q=X.requestVideoFrameCallback(u)};q=X.requestVideoFrameCallback(u)}else{const u=()=>{Le(t.currentTime),j=requestAnimationFrame(u)};j=requestAnimationFrame(u)}},ee=()=>{me?(X.cancelVideoFrameCallback?.(q),q=0):(cancelAnimationFrame(j),j=0)},Ve=()=>{ee(),p&&E({index:i,theme:p})};return t.addEventListener("play",ge),t.addEventListener("pause",ee),t.addEventListener("ended",Ve),!t.paused&&!t.ended&&ge(),()=>{ee(),t.removeEventListener("play",ge),t.removeEventListener("pause",ee),t.removeEventListener("ended",Ve)}},[i]),$(()=>{g.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),$(()=>{r.current.length!==0&&f("hero_banner_slide_view",{index:0,total:r.current.length,media_type:S(0),trigger:"initial"})},[f,S]);const Ue=!!s[i]?.isShowVideo,Ce=Se!==void 0,D=!Ce&&Ue&&Z!==null&&Z>5&&_!=="ended"&&_!==null,Ye=Ce||D,We=D?_==="paused":xe==="STOPPED",Ze=()=>{if(!D){Fe();return}const e=g.current[i]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),K(t,i),A(t,i)},we=y&&y.index===i?y.theme:s[i]?.theme;return b("div",{ref:qe,role:"region","aria-roledescription":"carousel","aria-label":m.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:De,onBlur:je,className:N("hero-banner-carousel group relative w-full overflow-hidden",W==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",re.root,I),...Y,children:[a(Ke,{onSwiper:Ae,onSlideChange:Ie,onSlideChangeTransitionEnd:Re,onSliderFirstMove:Me,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:s.map((e,t)=>{const o=y&&y.index===t?y.theme:e.theme??"light";return a(Qe,{children:({isActive:p})=>a(bt,{data:e,isActive:p,slideIndex:t,slideLabel:`${m.slideStatus} ${t+1} / ${s.length}`,videoRef:g.current[t],containerSize:W,theme:o,position:t+1,locale:le,pageHandle:M,onPlayVideo:()=>l(t),onPrimaryClick:U,onSecondaryClick:ie,onTertiaryClick:se})},t)})}),ce&&a(rt,{onPrev:()=>Te("prev"),onNext:()=>Te("next"),prevLabel:m.prevSlide,nextLabel:m.nextSlide}),C&&a(st,{frameCount:s.length,activeIndex:i,resetNonce:Ne,activeFrameIntervalSec:Se,isAutoplayEnabled:C,isTimerRunning:He,onSegmentClick:ze,segmentLabel:e=>`${m.slideStatus} ${e+1} / ${s.length}`,classPrefix:"hero-banner",theme:we}),Ye&&a(it,{isPaused:We,onToggle:Ze,pausedLabel:D?m.playVideo:m.playAutoplay,playingLabel:D?m.pauseVideo:m.pauseAutoplay,classPrefix:"hero-banner",theme:we}),a("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:_e}),x!==null&&s[x]?.secondaryButton&&a(ft,{visible:!0,videoUrl:s[x].secondaryButton?.isYoutubeVideo?void 0:s[x].secondaryButton?.videoUrl?.url,youTubeId:s[x].secondaryButton?.isYoutubeVideo?s[x].secondaryButton?.youtubeId:void 0,onCloseModal:()=>l(null)})]})});Pe.displayName="HeroBannerCarousel";var It=Pe;export{It as default};
|
|
1
|
+
"use client";import{Fragment as xt,jsx as a,jsxs as h}from"react/jsx-runtime";import he,{useRef as xe,useEffect as G,useCallback as E,useState as re}from"react";import{Swiper as Ke,SwiperSlide as Qe}from"swiper/react";import Xe from"../../helpers/ScrollLoadVideo.js";import{cn as V,getLocalizedPath as et}from"../../helpers/index.js";import{buildPictureSource as tt,resolveTierMedia as U,useMediaTier as Be}from"./mediaResolver.js";import{Button as ie,Heading as nt,Text as Se,Countdown as ot,Picture as Te}from"../../components/index.js";import{useCarouselPlayback as at}from"../../hooks/useCarouselPlayback.js";import{CarouselArrows as rt,CarouselCornerToggle as it,CarouselProgressControls as st}from"../../shared/CarouselControls.js";import{buildClickTrackingProps as lt,gaTrack as dt,resolveComponentMediaType as Pe,trackComponentClick as ct}from"../../shared/track.js";import{buildPageGroup as ut,buildTrackingRef as pt,trackUrlRef as mt}from"../../shared/trackUrlRef.js";import{useExposure as gt}from"../../hooks/useExposure.js";import{useAiuiContext as vt}from"../AiuiProvider/index.js";import{VideoModal as ft}from"../VideoModal/index.js";import"swiper/css";const yt=({size:d="base"})=>{const I=d==="lg"?"20":d==="sm"?"16":"18";return a("svg",{width:I,height:I,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:a("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},se="hero_banner",bt=({data:d,isActive:I,isAdjacent:le=!1,videoRef:de,slideIndex:Y,containerSize:W="default",theme:ce="light",slideLabel:ue,position:S,locale:r,pageHandle:R,onPlayVideo:Z,onPrimaryClick:m,onSecondaryClick:pe,onTertiaryClick:J})=>{const{pcImage:K,isVideoLoop:M=!0,isShowVideo:B,title:T,subtitle:b,label:z,endDate:F,endDate_tz:Q,dateFormat:k,iconArray:P,caption:f,blockLink:D,primaryButton:i,secondaryButton:s,tertiaryButton:l,align:C="left",titleSize:N}=d,_=Be(),p=tt(d),j=U(d,"lgDesktop","image")?.alt||K?.alt||"",y=U(d,_,"video")?.url||"",w=!!p&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(p),X=Pe(B),me=U(d,_,B?"video":"image")?.id||K?.id||"",ee=`${pt(R??"",X,se)}_${S}`,ge=n=>n&&r?et(n,r):n,H=n=>n?mt(ge(n),ee):void 0,x=(n,g)=>lt({interactive:n,componentType:X,componentName:se,title:T,description:b,buttonName:g,position:S,creativeId:me});return h("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":ue,className:V("text-info-primary relative w-full overflow-hidden transition-colors duration-500",ce==="dark"&&"aiui-dark",W==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[D&&a("a",{className:"absolute inset-0 z-10",href:H(D),tabIndex:-1,"aria-hidden":"true","aria-label":T?.trim()||b?.trim()||j||void 0,...x(!0)}),B?h(xt,{children:[a(Xe,{videoRef:de,src:y,poster:void 0,className:"absolute inset-0 size-full transition-opacity duration-500",videoClassName:"size-full object-cover",videoLayerClassName:"opacity-0",muted:!0,loop:M,playsInline:!0,onPlaying:n=>{const g=n.currentTarget;g.parentElement?.classList.remove("opacity-0"),g.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:n=>{const g=n.currentTarget;if(g.currentTime>=.5)return;g.parentElement?.classList.add("opacity-0"),g.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),w&&a("div",{"data-video-poster":"true",className:"bg-container-primary pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:a(Te,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:Y===0||le?"eager":"lazy",fetchPriority:Y===0?"high":"auto",alt:j,source:p})})]}):a(Te,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:j,source:p}),h("div",{className:V("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",C==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]"),children:[h("div",{className:V("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",C==="center"?"text-center":"laptop:text-left"),children:[z&&a(Se,{size:2,as:"p",className:V("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:z}),T&&a(nt,{as:N==="4"?"h1":"h2",html:T,size:N?Number(N||"5"):W==="sm"?4:5}),b&&a(Se,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:b}),F&&a("div",{className:"mt-3",children:a(ot,{endDate:F,endDate_tz:Q,dateFormat:k,variant:"spacious",align:C})})]}),(i?.text||s?.text||l?.text)&&h("div",{className:V("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",C==="center"?"justify-center":"laptop:justify-start"),children:[s?.isShowPlayVideoButton&&s?.playVideoButtonText?h(ie,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>Z?.(),...x(!0,"video play"),children:[s.playVideoButtonText," ",a(yt,{size:"lg"})]}):s?.text?h(ie,{size:"lg",variant:"secondary",as:s?.isCustomSecondaryButton?"button":"a",href:H(s.link),target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:n=>s?.isCustomSecondaryButton&&pe?.(d,n,s?.customSecondaryEventId),...x(!!(s.link||s.isCustomSecondaryButton),s.text),children:[s.text,a("span",{className:"sr-only",children:T??b})]}):null,i?.text&&a(ie,{size:"lg",variant:"primary",as:i?.isCustomPrimaryButton?"button":"a",href:H(i.link),target:i?.target,rel:i?.target==="_blank"?i?.rel??"noopener noreferrer":i?.rel,onClick:n=>i?.isCustomPrimaryButton&&m?.(d,n,i?.customPrimaryEventId),...x(!!(i.link||i.isCustomPrimaryButton),i.text),children:i.text}),l?.text&&h(ie,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:l?.isCustomTertiaryButton?"button":"a",href:H(l.link),target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:n=>l?.isCustomTertiaryButton&&J?.(d,n,l?.customTertiaryEventId),...x(!!(l.link||l.isCustomTertiaryButton),l.text),children:[l.text,a("span",{className:"sr-only",children:T??b})]})]}),P&&P.length>0&&a("div",{className:V("flex items-center gap-2",C==="center"?"justify-center":"justify-start"),children:P.map(n=>a("div",{className:"h-12",children:a(Te,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:n?.pcImage?.alt||"",source:n?.pcImage?.url})},n?.pcImage?.url||n?.pcImage?.alt))})]}),f&&f.length>0&&a("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:f.map((n,g)=>h(he.Fragment,{children:[a(Se,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:n.title}),g<f.length-1&&a("div",{className:"bg-info-primary w-px"})]},n.title))})]})},ht={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Ne=he.forwardRef(({data:d,className:I,classNames:le={},a11yLabels:de,onPrimaryClick:Y,onSecondaryClick:W,onTertiaryClick:ce,...ue},S)=>{const r=d.items||[],R=d.carousel,Z=R?.size??d.size??"default",m={...ht,...de},{locale:pe,pageHandle:J,trackingData:K}=vt(),M=Be(),B=ut({pageHandle:J,pageGroup:K?.pageGroup}),T=xe(null),[b,z]=re(null),[F,Q]=re(null),[k,P]=re(null),[f,D]=re(null),i=xe(r);G(()=>{i.current=r});const s=e=>e!==void 0&&e!==999&&e>=5,l=e=>e!==void 0&&e!==999&&e>=1&&e<=30,C=R?.autoplaySeconds,N=e=>{const t=e?.autoplaySeconds;return l(t)?t:s(C)?C:void 0},_=r.length>1&&r.some(e=>N(e)!==void 0),p=xe(r.map(()=>he.createRef())),j=(R?.showArrows??!0)&&r.length>1,y=E((e,t)=>{dt({event:"ga4Event",event_name:e,event_parameters:t})},[]),w=E(e=>i.current[e]?.isShowVideo?"video":"image",[]),X=E((e,t)=>{t==="swipe"&&y("hero_banner_swipe",{to_index:e}),y("hero_banner_slide_view",{index:e,total:i.current.length,media_type:w(e),trigger:t})},[y,w]),me=E((e,t,o,u="arrow")=>{y("hero_banner_arrow_click",{direction:e,from_index:t,to_index:o,source:u})},[y]),ee=E((e,t)=>{y(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:w(t)})},[y,w]),ge=E((e,t)=>{const o=i.current[t];o&&ct({pageGroup:B,componentType:"video",componentName:se,position:t+1,buttonName:e?"video pause":"video play",componentTitle:o.title,componentDescription:o.subtitle,creativeId:U(o,M,"video")?.id||o.pcImage?.id||""})},[B,M]),H=E(e=>{p.current.forEach((o,u)=>{u!==e&&o.current&&(o.current.pause(),o.current.currentTime=0)});const t=p.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:x,activeIndex:n,playbackState:g,resetNonce:ve,announcement:_e,activeFrameIntervalSec:ke,isTimerRunning:He,handleSwiperInit:Ae,handleSlideChange:Ie,handleTransitionEnd:Re,handleSliderFirstMove:Me,goToSlide:Ce,goToSlideIndex:ze,handlePausePlayClick:Fe,notifyVideoPlaying:we,handleFocus:De,handleBlur:je}=at({frameCount:r.length,resolveFrameIntervalSec:e=>N(r[e]),isAutoplayEnabled:_,swiperRef:T,slideStatusLabel:m.slideStatus,onSlideMediaSync:H,onSlideChange:X,onArrowNavigate:me,delaysCountdownForVideo:e=>!!i.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{ee(e,t);const o=p.current[t]?.current;o&&(e?o.pause():o.ended||o.play()?.catch(()=>{}))}}),qe=E(e=>{x.current=e,typeof S=="function"?S(e):S&&(S.current=e)},[S,x]),v=r[n]??r[0],$e=Pe(v?.isShowVideo),Oe=v?.title!==void 0?v?.title?.trim()||v?.subtitle?.trim()||v?.pcImage?.alt?.trim()||void 0:v?.subtitle&&v.subtitle.trim()||"",Ge=v&&(U(v,M,v.isShowVideo?"video":"image")?.id||v.pcImage?.id)||"";gt(x,{componentType:$e,componentName:se,componentTitle:Oe,componentDescription:v?.subtitle?.trim()||"",creativeId:Ge,position:1}),G(()=>{z(null),Q(null);const e=i.current[n],t=p.current[n]?.current;if(!e?.isShowVideo||!t)return;const o=()=>z(t.ended?"ended":t.paused?"paused":"playing"),u=()=>Q(Number.isFinite(t.duration)?t.duration:null),A=()=>{o(),we(n)};return o(),u(),t.addEventListener("playing",A),t.addEventListener("pause",o),t.addEventListener("ended",o),t.addEventListener("loadedmetadata",u),()=>{t.removeEventListener("playing",A),t.removeEventListener("pause",o),t.removeEventListener("ended",o),t.removeEventListener("loadedmetadata",u)}},[n,we]),G(()=>{const e=i.current[n];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=p.current[n]?.current;if(!t)return;const o=(c,L,ae,be)=>{if(!(!c||typeof L!="number"||typeof ae!="number"||typeof be!="number"))return be>=L&&be<ae?c:void 0};let u=null;const A=c=>{u=c,P(L=>L&&L.index===n&&L.theme===c?L:{index:n,theme:c})},te=c=>{A(o(e.theme_1,e.star_time_1,e.end_time_1,c)??o(e.theme_2,e.star_time_2,e.end_time_2,c)??e.theme??"light")},ne=t;let $=0,O=0;const fe=typeof ne.requestVideoFrameCallback=="function",Je=()=>fe?O!==0:$!==0,ye=()=>{if(!Je())if(fe){const c=(L,ae)=>{te(ae.mediaTime),O=ne.requestVideoFrameCallback(c)};O=ne.requestVideoFrameCallback(c)}else{const c=()=>{te(t.currentTime),$=requestAnimationFrame(c)};$=requestAnimationFrame(c)}},oe=()=>{fe?(ne.cancelVideoFrameCallback?.(O),O=0):(cancelAnimationFrame($),$=0)},Ve=()=>{oe(),u&&P({index:n,theme:u})};return t.addEventListener("play",ye),t.addEventListener("pause",oe),t.addEventListener("ended",Ve),!t.paused&&!t.ended&&ye(),()=>{oe(),t.removeEventListener("play",ye),t.removeEventListener("pause",oe),t.removeEventListener("ended",Ve)}},[n]),G(()=>{p.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),G(()=>{i.current.length!==0&&y("hero_banner_slide_view",{index:0,total:i.current.length,media_type:w(0),trigger:"initial"})},[y,w]);const Ue=!!r[n]?.isShowVideo,Le=ke!==void 0,q=!Le&&Ue&&F!==null&&F>5&&b!=="ended"&&b!==null,Ye=Le||q,We=q?b==="paused":g==="STOPPED",Ze=()=>{if(!q){Fe();return}const e=p.current[n]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),ee(t,n),ge(t,n)},Ee=k&&k.index===n?k.theme:r[n]?.theme;return h("div",{ref:qe,role:"region","aria-roledescription":"carousel","aria-label":m.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:De,onBlur:je,className:V("hero-banner-carousel group relative w-full overflow-hidden",Z==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",le.root,I),...ue,children:[a(Ke,{onSwiper:Ae,onSlideChange:Ie,onSlideChangeTransitionEnd:Re,onSliderFirstMove:Me,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:r.map((e,t)=>{const o=k&&k.index===t?k.theme:e.theme??"light";return a(Qe,{children:({isActive:u,isPrev:A,isNext:te})=>a(bt,{data:e,isActive:u,isAdjacent:A||te,slideIndex:t,slideLabel:`${m.slideStatus} ${t+1} / ${r.length}`,videoRef:p.current[t],containerSize:Z,theme:o,position:t+1,locale:pe,pageHandle:J,onPlayVideo:()=>D(t),onPrimaryClick:Y,onSecondaryClick:W,onTertiaryClick:ce})},t)})}),j&&a(rt,{onPrev:()=>Ce("prev"),onNext:()=>Ce("next"),prevLabel:m.prevSlide,nextLabel:m.nextSlide}),_&&a(st,{frameCount:r.length,activeIndex:n,resetNonce:ve,activeFrameIntervalSec:ke,isAutoplayEnabled:_,isTimerRunning:He,onSegmentClick:ze,segmentLabel:e=>`${m.slideStatus} ${e+1} / ${r.length}`,classPrefix:"hero-banner",theme:Ee}),Ye&&a(it,{isPaused:We,onToggle:Ze,pausedLabel:q?m.playVideo:m.playAutoplay,playingLabel:q?m.pauseVideo:m.pauseAutoplay,classPrefix:"hero-banner",theme:Ee}),a("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:_e}),f!==null&&r[f]?.secondaryButton&&a(ft,{visible:!0,videoUrl:r[f].secondaryButton?.isYoutubeVideo?void 0:r[f].secondaryButton?.videoUrl?.url,youTubeId:r[f].secondaryButton?.isYoutubeVideo?r[f].secondaryButton?.youtubeId:void 0,onCloseModal:()=>D(null)})]})});Ne.displayName="HeroBannerCarousel";var It=Ne;export{It as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Img } from '../../types/props.js';
|
|
2
|
+
export type CircleProgressSemanticName = 'root' | 'ring' | 'inner' | 'image' | 'centerText' | 'centerTextMain' | 'centerTextSub' | 'badge' | 'label';
|
|
2
3
|
export interface CircleProgressProps {
|
|
3
4
|
/** 总阶段数 (1-4) */
|
|
4
5
|
totalSteps?: 1 | 2 | 3 | 4;
|
|
@@ -22,8 +23,28 @@ export interface CircleProgressProps {
|
|
|
22
23
|
laptopSize?: number;
|
|
23
24
|
/** 段之间的间隙(像素),默认 3 */
|
|
24
25
|
gap?: number;
|
|
26
|
+
/**
|
|
27
|
+
* 圆环中间显示的文字(如满减档位优惠 "-£10" / "10% OFF")
|
|
28
|
+
* 与 image 互斥使用:传入 image 时不渲染 centerText
|
|
29
|
+
* 含换行符时按第一行(主文案,大字)和其余行(副文案,小字)分两行展示,如 "£10\nOFF"
|
|
30
|
+
* 字号随断点变化:移动端 12px、tablet 起 16px、desktop 起 18px(副文案比主文案小一档)
|
|
31
|
+
* 可选,默认不渲染(非破坏性:不传时与旧版行为一致)
|
|
32
|
+
*/
|
|
33
|
+
centerText?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 中间图片置灰(未达当前档时赠品图变灰)
|
|
36
|
+
* 可选,默认 false
|
|
37
|
+
*/
|
|
38
|
+
dimmed?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 中间图片上的售罄角标文案(如 "Sold Out")
|
|
41
|
+
* 可选,默认不渲染
|
|
42
|
+
*/
|
|
43
|
+
dimmedBadge?: string;
|
|
25
44
|
/** 自定义类名 */
|
|
26
45
|
className?: string;
|
|
46
|
+
/** 各部分的自定义样式类名,用于覆盖默认样式 */
|
|
47
|
+
classNames?: Partial<Record<CircleProgressSemanticName, string>>;
|
|
27
48
|
}
|
|
28
49
|
/**
|
|
29
50
|
* 分段式圆形进度条组件
|
|
@@ -32,7 +53,7 @@ export interface CircleProgressProps {
|
|
|
32
53
|
* 移动端默认 64px,laptop 以上默认 80px
|
|
33
54
|
*/
|
|
34
55
|
declare const CircleProgress: {
|
|
35
|
-
({ totalSteps, currentStep, image, label, progressColor, labelColor, trackColor, backgroundColor, size, laptopSize, gap, className, }: CircleProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
({ totalSteps, currentStep, image, label, progressColor, labelColor, trackColor, backgroundColor, size, laptopSize, gap, centerText, dimmed, dimmedBadge, className, classNames, }: CircleProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
36
57
|
displayName: string;
|
|
37
58
|
};
|
|
38
59
|
export default CircleProgress;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as p}from"react/jsx-runtime";import*as B from"react";import{Picture as H,Text as v}from"../../components/index.js";import{cn as e}from"../../helpers/index.js";const j=({totalSteps:a=4,currentStep:k=0,image:m,label:o,progressColor:z="var(--brand-color-0)",labelColor:T="var(--marketing-color-1)",trackColor:E="#DADCE0",backgroundColor:A="#EAEAEC",size:u=64,laptopSize:x=96,gap:$=3,centerText:M,dimmed:R=!1,dimmedBadge:y,className:G,classNames:r})=>{const d=Math.max(u,x),C=6,s=(d-C)/2,i=d/2,I=B.useMemo(()=>{const P=($+C)/s*(180/Math.PI),O=(360-P*a)/a,h=n=>n*Math.PI/180,W=(n,l)=>{const c=n-90,b=l-90,X=i+s*Math.cos(h(c)),Y=i+s*Math.sin(h(c)),F=i+s*Math.cos(h(b)),L=i+s*Math.sin(h(b)),q=l-n>180?1:0;return`M ${X} ${Y} A ${s} ${s} 0 ${q} 1 ${F} ${L}`},N=[];let w=a===2?-45:0;for(let n=0;n<a;n++){const l=w+P/2,c=l+O,b=n<k;N.push({path:W(l,c),isCompleted:b,index:n}),w=c+P/2}return N},[a,k,$,s,i]),[S,...D]=(M||"").split(`
|
|
2
|
+
`),g=D.join(" ");return p("div",{className:e("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",G,r?.root),style:{"--circle-size":`${u}px`,"--circle-laptop-size":`${x}px`,"--circle-height":`${o?u+8:u}px`,"--circle-laptop-height":`${o?x+8:x}px`},children:[p("div",{className:e("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",r?.ring),children:[p("svg",{viewBox:`0 0 ${d} ${d}`,className:e("absolute inset-0 size-full",o?"translate-y-[-8px]":""),children:[t("circle",{cx:i,cy:i,r:s,fill:A,stroke:"none"}),I.map(f=>t("path",{d:f.path,fill:"none",stroke:f.isCompleted?z:E,strokeWidth:C,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},f.index))]}),t("div",{className:e("absolute inset-[10px] flex items-center justify-center",o?"translate-y-[-8px]":"",r?.inner),children:p("div",{className:e("flex size-full items-center justify-center overflow-hidden rounded-full",y&&"relative"),style:{backgroundColor:A},children:[m?.url&&t(H,{className:e("size-full",R&&"opacity-40 grayscale",r?.image),imgClassName:"h-full object-contain",source:m.url,alt:m.alt||""}),!m?.url&&M&&p("div",{className:e("text-info-primary flex flex-col items-center justify-center text-center",g?"gap-0.5":"",r?.centerText),children:[t(v,{className:e("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",g&&"font-bold",r?.centerTextMain),html:S}),g&&t(v,{className:e("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",r?.centerTextSub),html:g})]}),y&&t("span",{className:e("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",r?.badge),children:t(v,{size:1,className:"text-center text-white",html:y})})]})})]}),o&&t("div",{className:e("absolute bottom-0 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",r?.label),style:{backgroundColor:T},children:t(v,{className:"text-xs font-medium text-white",html:o})})]})};j.displayName="CircleProgress";var Z=j;export{Z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CartLineItem, Cart } from './index.js';
|
|
1
|
+
import type { CartLineItem, Cart, MiniCartLabelStyles } from './index.js';
|
|
2
2
|
/**
|
|
3
3
|
* 购物车数据类型 - 复用 MiniCart 的类型定义
|
|
4
4
|
*/
|
|
@@ -29,6 +29,8 @@ export interface MiniCartDialogProps {
|
|
|
29
29
|
copy?: MiniCartDialogCopy;
|
|
30
30
|
/** 各部分的自定义样式类名 */
|
|
31
31
|
classNames?: Partial<Record<MiniCartDialogSemanticName, string>>;
|
|
32
|
+
/** 商品行标签(赠品 / 不参与活动)颜色,与 MiniCart 的 labelStyles 同一结构;不传用默认色 */
|
|
33
|
+
labelStyles?: MiniCartLabelStyles;
|
|
32
34
|
/**
|
|
33
35
|
* 增加商品数量回调
|
|
34
36
|
* @param lineItemId 商品行ID
|
|
@@ -54,7 +56,7 @@ export interface MiniCartDialogProps {
|
|
|
54
56
|
* @description 用于展示购物车商品列表,支持调整商品数量
|
|
55
57
|
*/
|
|
56
58
|
declare const MiniCartDialog: {
|
|
57
|
-
({ open, onOpenChange, cart, copy, classNames, onIncreaseQuantity, onDecreaseQuantity, onQuantityChange, }: MiniCartDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
({ open, onOpenChange, cart, copy, classNames, labelStyles, onIncreaseQuantity, onDecreaseQuantity, onQuantityChange, }: MiniCartDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
58
60
|
displayName: string;
|
|
59
61
|
};
|
|
60
62
|
export default MiniCartDialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{cn as i}from"../../helpers/index.js";import{Heading as D,Text as d,Dialog as I,DialogContent as N,DialogHeader as z,DialogTitle as P}from"../../components/index.js";import{resolveCartLineLabelStyle as L}from"./index.js";const M=({className:l})=>t("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),k=({className:l})=>t("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),q=({item:l,classNames:a,labelStyles:x,onIncrease:u,onDecrease:n})=>{const{merchandise:y,quantity:p,cost:C,readonly:g,productLabel:f,labelVariant:h}=l,{image:c,title:b}=y,{totalAmount:m,subtotalAmount:s}=C,v=b||y.sku||"Product",e=m?.formattedPrice||"",o=s&&m&&parseFloat(s.amount)>parseFloat(m.amount);return r("div",{className:i("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",a?.item),children:[r("div",{className:i("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",a?.itemImage),children:[c?.url&&t("img",{src:c.url,alt:c.altText||v,className:"size-full object-cover"}),f&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center px-1 py-px backdrop-blur-sm",style:L(h,x),children:t(d,{size:1,className:"text-center text-white",html:f})})]}),r("div",{className:i("laptop:gap-4 flex flex-1 flex-col gap-2",a?.itemInfo),children:[t(d,{as:"p",size:3,className:i("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",a?.itemTitle),children:v}),r("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[r("div",{className:i("flex items-center gap-1",a?.itemPrice),children:[e&&t(d,{size:4,className:i("text-info-primary laptop:text-[18px] text-[16px]",a?.itemCurrentPrice),children:e}),o&&s?.formattedPrice&&t(d,{size:4,className:i("text-info-tertiary laptop:text-[18px] text-[16px] line-through",a?.itemOriginalPrice),children:s.formattedPrice})]}),g?t("div",{className:i("flex items-center",a?.quantityControl),children:r("span",{className:"text-info-primary text-sm font-semibold",children:["x",p]})}):r("div",{className:i("flex items-center",a?.quantityControl),children:[t("button",{type:"button",onClick:n,disabled:p<=0,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",a?.quantityButton),"aria-label":"Decrease quantity",children:t(M,{className:"laptop:size-3 size-[10.67px]"})}),t("div",{className:i("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",a?.quantityValue),children:p}),t("button",{type:"button",onClick:u,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",a?.quantityButton),"aria-label":"Increase quantity",children:t(k,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},w=({open:l,onOpenChange:a,cart:x,copy:u,classNames:n={},labelStyles:y,onIncreaseQuantity:p,onDecreaseQuantity:C,onQuantityChange:g})=>{const f=u?.title||"Selected ({count})",h=u?.emptyText||"Your cart is empty",c=x?.lineItems?.reduce((e,o)=>e+(o?.quantity||0),0)||0,b=x?.lineItems||[],m=b.length===0,s=(e,o)=>{p?.(e,o),g?.(e,o+1)},v=(e,o)=>{o>0&&(C?.(e,o),g?.(e,o-1))};return t(I,{open:l,onOpenChange:a,children:r(N,{className:i("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",n?.root),children:[t(z,{className:i("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",n?.header),children:t(P,{asChild:!0,children:t(D,{as:"h3",size:2,className:i("text-info-primary font-bold",n?.title),children:f.replace("{count}",c.toString())})})}),t("div",{className:i("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",n?.content),children:m?t("div",{className:"flex items-center justify-center py-8",children:t(d,{size:2,className:"text-info-tertiary",children:h})}):t("div",{className:i("flex flex-col gap-2",n?.itemList),children:b.map(e=>t(q,{item:e,classNames:n,labelStyles:y,onIncrease:()=>s(e.id,e.quantity),onDecrease:()=>v(e.id,e.quantity)},e.id))})}),t("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};w.displayName="MiniCartDialog";var H=w;export{w as MiniCartDialog,H as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Img } from '../../types/props.js';
|
|
3
|
+
import type { CircleProgressSemanticName } from './CircleProgress.js';
|
|
3
4
|
export type MiniCartSemanticName = 'root' | 'content' | 'cartInfo' | 'cartTitle' | 'cartDescription' | 'priceSection' | 'totalPrice' | 'originalPrice' | 'saveAmount' | 'actionButton' | 'itemsGrid' | 'itemGridContainer' | 'gridItem' | 'gridItemOverlay' | 'expandButton' | 'circleProgress' | 'mobileViewMoreButton';
|
|
4
5
|
/**
|
|
5
6
|
* 圆形进度条配置
|
|
@@ -23,7 +24,34 @@ export interface CircleProgressConfig {
|
|
|
23
24
|
size?: number;
|
|
24
25
|
/** laptop 以上组件尺寸,默认 80 */
|
|
25
26
|
laptopSize?: number;
|
|
27
|
+
/** 圆环中间显示的文字(如满减档位优惠),传入 image 时不渲染;字号随断点 12 / 16 / 18px */
|
|
28
|
+
centerText?: string;
|
|
29
|
+
/** 中间图片置灰(未达当前档时赠品图变灰),默认 false */
|
|
30
|
+
dimmed?: boolean;
|
|
31
|
+
/** 中间图片上的售罄角标文案(如 "Sold Out") */
|
|
32
|
+
dimmedBadge?: string;
|
|
33
|
+
/** 未完成阶段的颜色 */
|
|
34
|
+
trackColor?: string;
|
|
35
|
+
/** 圆环各部分的自定义样式类名(root / ring / inner / image / centerText / centerTextMain / centerTextSub / badge / label) */
|
|
36
|
+
classNames?: Partial<Record<CircleProgressSemanticName, string>>;
|
|
26
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* 商品行标签变体(满赠/满减场景)
|
|
40
|
+
* 不传时沿用旧版橙色内联背景(非破坏性)
|
|
41
|
+
*/
|
|
42
|
+
export type CartLineLabelVariant = 'gift' | 'notEligible';
|
|
43
|
+
/**
|
|
44
|
+
* 商品格子标签颜色配置(直接覆盖内联背景色)
|
|
45
|
+
* 不传时保持旧版颜色
|
|
46
|
+
*/
|
|
47
|
+
export interface MiniCartLabelStyles {
|
|
48
|
+
/** 赠品(Free)标签背景色,默认 rgba(251, 148, 63, 0.6) */
|
|
49
|
+
giftLabelColor?: string;
|
|
50
|
+
/** 不参与活动商品(Not Eligible)标签背景色,默认 rgba(118, 120, 128, 0.6) */
|
|
51
|
+
notEligibleLabelColor?: string;
|
|
52
|
+
}
|
|
53
|
+
/** 商品行标签背景样式:MiniCart 缩略图与 MiniCartDialog 共用,保证两处赠品/不参与标识颜色一致 */
|
|
54
|
+
export declare const resolveCartLineLabelStyle: (variant: CartLineLabelVariant | undefined, labelStyles?: MiniCartLabelStyles) => React.CSSProperties;
|
|
27
55
|
/**
|
|
28
56
|
* 文案配置
|
|
29
57
|
*/
|
|
@@ -48,6 +76,13 @@ export interface MiniCartData {
|
|
|
48
76
|
locale?: string;
|
|
49
77
|
/** 是否显示手机端查看更多按钮,默认 true */
|
|
50
78
|
showMobileViewMore?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* 数量角标显示上限:quantity 超过该值显示 "{max}+"(如 99+)
|
|
81
|
+
* 不传时显示完整数字(旧行为)
|
|
82
|
+
*/
|
|
83
|
+
maxQuantityDisplay?: number;
|
|
84
|
+
/** 标签颜色配置,通过 CSS 变量注入;不传保持旧版颜色 */
|
|
85
|
+
labelStyles?: MiniCartLabelStyles;
|
|
51
86
|
}
|
|
52
87
|
/**
|
|
53
88
|
* 购物车商品项类型
|
|
@@ -57,6 +92,16 @@ export type CartLineItem = {
|
|
|
57
92
|
quantity: number;
|
|
58
93
|
/** 商品标签,如 "Free"、"Gift" 等,显示在商品图片底部 */
|
|
59
94
|
productLabel?: string;
|
|
95
|
+
/**
|
|
96
|
+
* 标签变体:'gift' 赠品(橙色)、'notEligible' 不参与活动商品(灰色)
|
|
97
|
+
* 不传时沿用旧版橙色背景
|
|
98
|
+
*/
|
|
99
|
+
labelVariant?: CartLineLabelVariant;
|
|
100
|
+
/**
|
|
101
|
+
* 只读行:MiniCartDialog 中隐藏数量增减控件(如满赠赠品行数量由后端计算)
|
|
102
|
+
* 默认可调
|
|
103
|
+
*/
|
|
104
|
+
readonly?: boolean;
|
|
60
105
|
cost: {
|
|
61
106
|
totalAmount: {
|
|
62
107
|
amount: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{cn as o}from"../../helpers/index.js";import{Button as vt}from"../../components/index.js";import{Text as h}from"../../components/index.js";import{Heading as m}from"../../components/index.js";import wt from"./CircleProgress.js";import{useExposure as yt}from"../../hooks/useExposure.js";const Ct="cart",kt="mini_cart",W=a.forwardRef(({className:q,classNames:n={},data:G,cart:l,progressConfig:s,onRemoveItem:U,onCheckout:X,onClickToView:k,...F},O)=>{const b=a.useRef(null),{copy:c,theme:L="light",locale:Lt="us",showMobileViewMore:Y=!0}=G||{};yt(b,{componentType:Ct,componentName:kt,componentTitle:c?.itemsInCart||"Mini Cart",componentDescription:c?.description}),a.useImperativeHandle(O,()=>b.current);const Z=c?.emptyCart||"Your Cart is Empty",M=c?.description||"",_=c?.itemsInCart||"You have selected {count} items",$=c?.total||"Total {total}",Mt=c?.totalWithCoupon||"total: {total} ({subtotal})",N=c?.clickToView||"Click to view cart",J=c?.buyNowText||"Buy Now",K=c?.savingText||"Saving {amount}",d=a.useMemo(()=>l?.lineItems||[],[l?.lineItems]),S=d.reduce((e,r)=>e+(r?.quantity||0),0),Q=S===0,tt=parseFloat(l?.cost?.totalAmount?.amount||"0"),et=parseFloat(l?.cost?.subtotalAmount?.amount||"0"),ot=parseFloat(l?.cost?.savingAmount?.amount||"0"),rt=l?.cost?.totalAmount?.formattedPrice||"",I=et>tt?l?.cost?.subtotalAmount?.formattedPrice:null,P=ot>0?l?.cost?.savingAmount?.formattedPrice:null,p=a.useRef(null),[v,nt]=a.useState(!1),[z,T]=a.useState(!1),[A,B]=a.useState(null),D=async e=>{if(!A){B(e);try{await U?.(e,l)}finally{B(null)}}},[j,w]=a.useState(!1),[at,it]=a.useState(0),[lt,st]=a.useState(0),[R,ct]=a.useState(!1),[E,pt]=a.useState(!0),f=a.useCallback(()=>{const e=p.current;if(!e)return;const{scrollLeft:r,scrollWidth:u,clientWidth:x}=e;ct(r>0),pt(r<u-x-1)},[]),dt=a.useCallback(()=>{f()},[f]);a.useEffect(()=>{f()},[d.length,f]);const ut=e=>{p.current&&(w(!0),it(e.pageX-p.current.offsetLeft),st(p.current.scrollLeft))},mt=e=>{if(!j||!p.current)return;e.preventDefault();const u=(e.pageX-p.current.offsetLeft-at)*1.5;p.current.scrollLeft=lt-u},gt=()=>{w(!1)},ft=()=>{w(!1)},H=e=>{if(p.current){const r=p.current,u=100;r.scrollBy({left:e==="right"?u:-u,behavior:"smooth"})}},y=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),xt=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ht=e=>d.length?i("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",n?.itemsGrid),children:[d.length>=5&&t("button",{onClick:()=>H("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!R&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",n?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!R}),"aria-label":"Scroll left to see more items",children:t(y,{className:"laptop:size-4 size-5 rotate-180"})}),i("div",{ref:p,onMouseDown:ut,onMouseMove:mt,onMouseUp:gt,onMouseLeave:ft,onScroll:dt,className:o("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",j?"cursor-grabbing":"cursor-grab",n?.itemGridContainer),children:[d.filter(r=>r&&r.id).map(r=>{const x=(r.merchandise||{}).image||{},V=x.url,bt=x.altText||"Product image",C=A===r.id;return i("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",n?.gridItem),children:[V&&t("img",{src:V,alt:bt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),C&&t("div",{className:"rounded-box-small absolute inset-0 flex items-center justify-center bg-black/50",children:i("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>D(r.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",C&&"pointer-events-none opacity-0"),"aria-label":"delete",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),r.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:{backgroundColor:"rgba(251, 148, 63, 0.60)"},children:t(h,{size:1,className:"relative text-center text-white",html:r.productLabel})})}),r.quantity>1&&!r.productLabel&&t("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 flex size-4 items-center justify-center rounded-full text-white",children:t(h,{className:"text-sm",html:String(r.quantity)})}),t("div",{role:"button",onClick:()=>D(r.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",C&&"laptop:hidden",n?.gridItemOverlay),"aria-label":"Remove item",children:t(xt,{className:"pointer-events-none size-[20px] text-white"})})]},r.id)}),Y&&t("button",{onClick:()=>k?.(l),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",n?.mobileViewMoreButton),"aria-label":N,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.length>=5&&t("button",{onClick:()=>H("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!E&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",n?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!E}),"aria-label":"Scroll right to see more items",children:t(y,{className:"laptop:size-4 size-5"})})]}):null,g=!Q&&d.length>0;return t("div",{ref:b,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",q,n?.root,{"aiui-dark bg-container-primary":L==="dark"}),...F,children:i("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",n?.content),children:[i("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",s&&"laptop:pl-[104px] pl-[72px]"),children:[s&&t(wt,{totalSteps:s.totalSteps,currentStep:s.currentStep,image:s.image,label:s.label,progressColor:s.progressColor,labelColor:s.labelColor,backgroundColor:s.backgroundColor,size:s.size,laptopSize:s.laptopSize,className:o("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",n?.circleProgress)}),i("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",n?.cartInfo),children:g?i("div",{className:"flex w-full items-center gap-2",children:[t(m,{size:2,as:"h3",className:o("",n?.cartTitle),html:_.replace("{count}",`<span class="text-brand-0">${S||0}</span>`)}),i(m,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?nt(!v):k?.(l)},className:o("flex cursor-pointer items-center gap-1",n?.expandButton),children:[t(h,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:N}),t(y,{className:o("size-4 transition-transform",v?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(m,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",n?.cartTitle),html:Z})}),M&&t(h,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",n?.cartDescription),html:M})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",v?"block":"hidden"),children:ht(L)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),i("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",n?.priceSection),children:[i("div",{className:"flex flex-col items-end justify-center",children:[i("div",{className:"flex items-center gap-2",children:[t(m,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",n?.totalPrice),html:$.replace("{total}",rt)}),I&&t(m,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",n?.originalPrice),html:I})]}),P&&t(m,{size:2,as:"h6",className:o("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",n?.saveAmount),html:K.replace("{amount}",P)})]}),t(vt,{disabled:!g,loading:z,onClick:async()=>{if(!z){T(!0);try{await X?.(l)}finally{T(!1)}}},className:o("whitespace-nowrap",n?.actionButton),children:J})]})]})})});W.displayName="MiniCart";var At=W;export{At as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import*as i from"react";import{cn as o}from"../../helpers/index.js";import{Button as wt}from"../../components/index.js";import{Text as h}from"../../components/index.js";import{Heading as u}from"../../components/index.js";import kt from"./CircleProgress.js";import{useExposure as Lt}from"../../hooks/useExposure.js";const Mt="cart",St="mini_cart",Nt=(b,r)=>b==="notEligible"?{backgroundColor:r?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:b==="gift"?{backgroundColor:r?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},G=i.forwardRef(({className:b,classNames:r={},data:U,cart:s,progressConfig:n,onRemoveItem:X,onCheckout:F,onClickToView:M,...Q},O)=>{const v=i.useRef(null),{copy:c,theme:S="light",locale:Pt="us",showMobileViewMore:Y=!0,maxQuantityDisplay:y,labelStyles:$}=U||{};Lt(v,{componentType:Mt,componentName:St,componentTitle:c?.itemsInCart||"Mini Cart",componentDescription:c?.description}),i.useImperativeHandle(O,()=>v.current);const Z=c?.emptyCart||"Your Cart is Empty",N=c?.description||"",_=c?.itemsInCart||"You have selected {count} items",J=c?.total||"Total {total}",It=c?.totalWithCoupon||"total: {total} ({subtotal})",P=c?.clickToView||"Click to view cart",K=c?.buyNowText||"Buy Now",tt=c?.savingText||"Saving {amount}",d=i.useMemo(()=>s?.lineItems||[],[s?.lineItems]),I=d.reduce((e,a)=>e+(a?.quantity||0),0),et=I===0,ot=parseFloat(s?.cost?.totalAmount?.amount||"0"),rt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),at=parseFloat(s?.cost?.savingAmount?.amount||"0"),nt=s?.cost?.totalAmount?.formattedPrice||"",T=rt>ot?s?.cost?.subtotalAmount?.formattedPrice:null,z=at>0?s?.cost?.savingAmount?.formattedPrice:null,p=i.useRef(null),[C,it]=i.useState(!1),[B,A]=i.useState(!1),[D,E]=i.useState(null),j=async e=>{if(!D){E(e);try{await X?.(e,s)}finally{E(null)}}},[R,w]=i.useState(!1),[lt,st]=i.useState(0),[ct,pt]=i.useState(0),[V,dt]=i.useState(!1),[H,mt]=i.useState(!0),f=i.useCallback(()=>{const e=p.current;if(!e)return;const{scrollLeft:a,scrollWidth:m,clientWidth:x}=e;dt(a>0),mt(a<m-x-1)},[]),ut=i.useCallback(()=>{f()},[f]);i.useEffect(()=>{f()},[d.length,f]);const gt=e=>{p.current&&(w(!0),st(e.pageX-p.current.offsetLeft),pt(p.current.scrollLeft))},bt=e=>{if(!R||!p.current)return;e.preventDefault();const m=(e.pageX-p.current.offsetLeft-lt)*1.5;p.current.scrollLeft=ct-m},ft=()=>{w(!1)},xt=()=>{w(!1)},W=e=>{if(p.current){const a=p.current,m=100;a.scrollBy({left:e==="right"?m:-m,behavior:"smooth"})}},k=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),ht=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),vt=e=>d.length?l("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",r?.itemsGrid),children:[d.length>=5&&t("button",{onClick:()=>W("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!V&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!V}),"aria-label":"Scroll left to see more items",children:t(k,{className:"laptop:size-4 size-5 rotate-180"})}),l("div",{ref:p,onMouseDown:gt,onMouseMove:bt,onMouseUp:ft,onMouseLeave:xt,onScroll:ut,className:o("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",R?"cursor-grabbing":"cursor-grab",r?.itemGridContainer),children:[d.filter(a=>a&&a.id).map(a=>{const x=(a.merchandise||{}).image||{},q=x.url,Ct=x.altText||"Product image",L=D===a.id;return l("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",r?.gridItem),children:[q&&t("img",{src:q,alt:Ct,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),L&&t("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:l("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>j(a.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",L&&"pointer-events-none opacity-0"),"aria-label":"delete",children:l("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:Nt(a.labelVariant,$),children:t(h,{size:1,className:"relative text-center text-white",html:a.productLabel})})}),a.quantity>1&&t("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 z-10 flex size-4 items-center justify-center rounded-full text-white",children:t(h,{className:"text-sm",html:yt(a.quantity)})}),t("div",{role:"button",onClick:()=>j(a.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",L&&"laptop:hidden",r?.gridItemOverlay),"aria-label":"Remove item",children:t(ht,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),Y&&t("button",{onClick:()=>M?.(s),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",r?.mobileViewMoreButton),"aria-label":P,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.length>=5&&t("button",{onClick:()=>W("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!H}),"aria-label":"Scroll right to see more items",children:t(k,{className:"laptop:size-4 size-5"})})]}):null,g=!et&&d.length>0,yt=e=>y!==void 0&&e>y?`${y}+`:String(e);return t("div",{ref:v,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",b,r?.root,{"aiui-dark bg-container-primary":S==="dark"}),...Q,children:l("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",r?.content),children:[l("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",n&&"laptop:pl-[104px] pl-[72px]"),children:[n&&t(kt,{totalSteps:n.totalSteps,currentStep:n.currentStep,image:n.image,label:n.label,progressColor:n.progressColor,labelColor:n.labelColor,backgroundColor:n.backgroundColor,size:n.size,laptopSize:n.laptopSize,centerText:n.centerText,dimmed:n.dimmed,dimmedBadge:n.dimmedBadge,trackColor:n.trackColor,classNames:n.classNames,className:o("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",r?.circleProgress)}),l("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",r?.cartInfo),children:g?l("div",{className:"flex w-full items-center gap-2",children:[t(u,{size:2,as:"h3",className:o("",r?.cartTitle),html:_.replace("{count}",`<span class="text-brand-0">${I||0}</span>`)}),l(u,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?it(!C):M?.(s)},className:o("flex cursor-pointer items-center gap-1",r?.expandButton),children:[t(h,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:P}),t(k,{className:o("size-4 transition-transform",C?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(u,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",r?.cartTitle),html:Z})}),N&&t(h,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.cartDescription),html:N})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",C?"block":"hidden"),children:vt(S)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),l("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",r?.priceSection),children:[l("div",{className:"flex flex-col items-end justify-center",children:[l("div",{className:"flex items-center gap-2",children:[t(u,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",r?.totalPrice),html:J.replace("{total}",nt)}),T&&t(u,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",r?.originalPrice),html:T})]}),z&&t(u,{size:2,as:"h6",className:o("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",r?.saveAmount),html:tt.replace("{amount}",z)})]}),t(wt,{disabled:!g,loading:B,onClick:async()=>{if(!B){A(!0);try{await F?.(s)}finally{A(!1)}}},className:o("whitespace-nowrap",r?.actionButton),children:K})]})]})})});G.displayName="MiniCart";var jt=G;export{jt as default,Nt as resolveCartLineLabelStyle};
|
|
@@ -153,9 +153,9 @@ export type { AccessoryShelfProps, AccessoryProductData, AccessoryCardSemanticNa
|
|
|
153
153
|
export { default as ImageTextOverlay } from './ImageTextOverlay/index.js';
|
|
154
154
|
export type { ImageTextOverlayProps, ImageTextOverlayData, ImageTextOverlayItem, ImageTextOverlaySemanticName, ImageTextOverlayBackgroundImage, } from './ImageTextOverlay/types.js';
|
|
155
155
|
export { default as MiniCart } from './MiniCart/index.js';
|
|
156
|
-
export type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig } from './MiniCart/index.js';
|
|
156
|
+
export type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig, MiniCartCopy, CartLineLabelVariant, MiniCartLabelStyles, } from './MiniCart/index.js';
|
|
157
157
|
export { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js';
|
|
158
|
-
export type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js';
|
|
158
|
+
export type { CircleProgressProps as MiniCartCircleProgressProps, CircleProgressSemanticName as MiniCartCircleProgressSemanticName, } from './MiniCart/CircleProgress.js';
|
|
159
159
|
export { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js';
|
|
160
160
|
export type { MiniCartDialogProps, MiniCartDialogCopy, MiniCartDialogSemanticName, CartData, } from './MiniCart/MiniCartDialog.js';
|
|
161
161
|
export { default as WebPushPopup } from './WebPushPopup/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AccessoriesProductGrid as o,SectionHeader as a,PromoBanner as i,MainProductArea as s,AddToCartSuccessPopover as p}from"./AccessoriesShelf/index.js";import{default as f}from"./ActivitySchedule/index.js";import{default as n}from"./GiftShelf/index.js";import{default as u}from"./GiftTierShelf/index.js";import{default as x}from"./ActivityMechanism/index.js";import{default as S}from"./BrandEquity/index.js";import{default as P}from"./MemberEquity/index.js";import{default as g}from"./Slogan/index.js";import{default as B}from"./Title/index.js";import{default as v}from"./Spacer/index.js";import{default as b}from"./ShelfDisplay/index.js";import{default as D}from"./ShelfDisplayHorizontal/index.js";import{default as j}from"./Evaluate/index.js";import{default as O}from"./Category/index.js";import{default as L}from"./HeroBanner/index.js";import{default as k}from"./AccordionCards/index.js";import{default as N}from"./Graphic/index.js";import{default as H}from"./MediaPlayerBase/index.js";import{default as q}from"./MediaPlayerSticky/index.js";import{default as K}from"./MediaPlayerMulti/index.js";import{default as _}from"./Marquee/index.js";import{default as J}from"./MarqueeReview/index.js";import{default as X}from"./WhyChoose/index.js";import{default as $}from"./Faq/index.js";import{MarqueeItem as te,MarqueeImageContent as re,MarqueeTextContent as oe}from"./Marquee/index.js";import{default as ie}from"./MultiLayoutGraphicBlock/index.js";import{default as pe}from"./GraphicAttractionBlock/index.js";import{default as fe}from"./HeaderNavigation/index.js";import{default as ne}from"./FooterNavigation/index.js";import{default as ue}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as xe,SearchPageTabType as ye}from"./SearchPage/types.js";import{withLayout as he}from"../shared/Styles.js";import{default as Ce}from"./AiuiProvider/index.js";import{default as Me}from"./Tabs/index.js";import{default as Te}from"./SwiperBox/index.js";import{VideoModal as Ie}from"./VideoModal/index.js";import{default as Ae}from"./CreativeModule/index.js";import{default as Fe}from"./GraphicOverlay/index.js";import{default as Ge}from"./Specs/index.js";import{default as we}from"./TabsGroup/index.js";import{default as Ve,useBizProductContext as ke}from"./Listing/BizProductProvider.js";import{default as Ne}from"./Listing/components/PurchaseBar/index.js";import{default as He}from"./Listing/components/PurchaseBar/ProductActions/index.js";import{default as qe}from"./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js";import{default as Ke}from"./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js";import{default as _e}from"./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js";import{default as Je}from"./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js";import{default as Xe}from"./Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js";import{default as $e}from"./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js";import{default as tt}from"./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js";import{default as ot}from"./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js";import{default as it}from"./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js";import{default as pt}from"./Listing/components/ProductCard/ProductGridBox.js";import{default as ft}from"./Listing/components/ProductCard/ProductGallery/index.js";import{default as nt}from"./Listing/components/ProductCard/ProductSummary/index.js";import{default as ut}from"./Listing/components/ProductCard/ProductDetail/BenefitsTab.js";import{default as xt}from"./Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js";import{default as St}from"./Listing/components/PaidShipping/index.js";import{default as Pt}from"./Listing/components/CartActionButtons/index.js";import{NotifyMeDialog as gt}from"./NotifyMeDialog/index.js";import{default as Bt}from"./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js";import{default as vt}from"./Listing/components/ProductCard/ProductPaidShipping/index.js";import{default as bt}from"./GraphicMore/index.js";import{default as Dt}from"./Features/index.js";import{default as jt}from"./AplusDesc/index.js";import{default as Ot}from"./GiftBox/index.js";import{default as Lt}from"./SelectStore/index.js";import{default as kt}from"./DownLoad/index.js";import{default as Nt}from"./FootCharger/index.js";import{default as Ht}from"./BrandCardLink/index.js";import*as Rt from"./IPRedirect/index.js";import{default as zt}from"./WheelLottery/index.js";import{default as Ut}from"./ProductLottery/index.js";import{default as Yt}from"./ProductCompare/index.js";import{default as Qt}from"./Ksp/index.js";import{default as Zt}from"./ImageTextFeature/index.js";import{default as er}from"./FeatureCards/index.js";import{default as rr}from"./FeaturedBlogPosts/index.js";import{default as ar}from"./ImageWithText/index.js";import{default as sr}from"./VideoFeature/index.js";import{default as dr}from"./TabsWithMedia/index.js";import{default as cr}from"./TabWithImage/index.js";import{default as lr}from"./FeatureShowcase/index.js";import{default as mr}from"./ProductHero/index.js";import{default as yr}from"./SpecsComparison/index.js";import{default as hr}from"./MediaSceneSwitcher/index.js";import{default as Cr}from"./MediaSceneSwitcherV2/index.js";import{default as Mr}from"./ThreeDCarousel/index.js";import{default as Tr}from"./ProductNav/index.js";import{default as Ir}from"./AnchorNavigation/index.js";import{default as Ar}from"./PromotionalBar/index.js";import{default as Fr}from"./EventSchedule/index.js";import{default as Gr}from"./SecondaryBanner/index.js";import{default as wr}from"./BuyOneGetOneShelf/index.js";import{default as Vr}from"./ActiveShelf/index.js";import{default as Wr}from"./MediaShelf/index.js";import{default as Er,CreditsProductCard as Hr}from"./CreditsShelf/index.js";import{default as qr,SceneProductCard as zr}from"./SceneShelf/index.js";import{default as Ur,SceneShelfV2ProductCard as _r}from"./SceneShelfV2/index.js";import{default as Jr}from"./SceneShelfV3/index.js";import{default as Xr}from"./MediaEndorsement/index.js";import{default as $r}from"./MediaTextOverlay/index.js";import{default as to}from"./ImageOverlayShelf/index.js";import{default as oo,AccessoryProductCard as ao}from"./AccessoriesShelf/components/AccessoryShelf/index.js";import{default as so}from"./ImageTextOverlay/index.js";import{default as fo}from"./MiniCart/index.js";import{default as no}from"./MiniCart/CircleProgress.js";import{default as uo,MiniCartDialog as mo}from"./MiniCart/MiniCartDialog.js";import{default as yo}from"./WebPushPopup/index.js";import{useEmarsysWebPush as ho}from"../hooks/useEmarsysWebPush.js";const e={ActivityMechanism:"ActivityMechanism",ActivitySchedule:"ActivitySchedule",AnchorNavigation:"AnchorNavigation",EventSchedule:"EventSchedule",FeatureCards:"FeatureCards",GiftShelf:"GiftShelf",GiftTierShelf:"GiftTierShelf",ImageTextFeature:"ImageTextFeature",ImageTextOverlay:"ImageTextOverlay",ImageWithText:"ImageWithText",MarqueeReview:"MarqueeReview",MediaSceneSwitcher:"MediaSceneSwitcher",ProductCompare:"ProductCompare",ProductHero:"ProductHero",ProductNav:"ProductNav",PromotionalBar:"PromotionalBar",TabsWithMedia:"TabsWithMedia",ThreeDCarousel:"ThreeDCarousel",VideoFeature:"VideoFeature","ipc-accordioncards":"AccordionCards","ipc-active-shelf":"ActiveShelf","ipc-add-to-cart-success-popover":"AddToCartSuccessPopover","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-brand-card-link":"BrandCardLink","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-creativemodule":"CreativeModule","ipc-credits-shelf":"CreditsShelf","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-image-overlay-shelf":"ImageOverlayShelf","ipc-marquee":"Marquee","ipc-media-endorsement":"MediaEndorsement","ipc-media-shelf":"MediaShelf","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-media-text-overlay":"MediaTextOverlay","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mini-cart":"MiniCart","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-notify-me-dialog":"NotifyMeDialog","ipc-product-lottery":"ProductLottery","ipc-scene-shelf":"SceneShelf","ipc-scene-shelf-v2":"SceneShelfV2","ipc-scene-shelf-v3":"SceneShelfV3","ipc-search-page":"SearchPage","ipc-search-page-tabs":"SearchPage","ipc-secondary-banner":"SecondaryBanner","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-shelfdisplay-horizontal":"ShelfDisplayHorizontal","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-title":"Title","ipc-wheel-lottery":"WheelLottery","ipc-whychoose":"WhyChoose",ksp:"Ksp",modalCoupon:"ModalCoupon",modalRegisterSubscribe:"ModalRegisterSubscribe",modalSmsSubscribe:"ModalSmsSubscribe",modalSubscribeConfirm:"ModalSubscribeConfirm",modalVerify:"ModalVerify"};import{CartSummaryHeader as Co,CartItemRow as go,CartGiftSection as Mo,CartPerksSection as Bo,CartThirdPartyBanner as To,CartPriceSummary as vo}from"./CartDetail/index.js";import{useAiuiContext as bo}from"./AiuiProvider/index.js";import{default as Do}from"./ModalRegisterSubscribe/index.js";import{default as jo}from"./ModalSubscribeConfirm/index.js";import{default as Oo}from"./ModalCoupon/index.js";import{default as Lo}from"./ModalSmsSubscribe/index.js";import{default as ko}from"./ModalVerify/index.js";export{o as AccessoriesProductGrid,ao as AccessoryProductCard,oo as AccessoryShelf,k as AccordionCards,Vr as ActiveShelf,x as ActivityMechanism,f as ActivitySchedule,p as AddToCartSuccessPopover,Ce as AiuiProvider,Ir as AnchorNavigation,jt as AplusDesc,ut as BenefitsTab,Ve as BizProductProvider,Ht as BrandCardLink,S as BrandEquity,wr as BuyOneGetOneShelf,Pt as CartActionButtons,Mo as CartGiftSection,go as CartItemRow,Bo as CartPerksSection,vo as CartPriceSummary,Co as CartSummaryHeader,To as CartThirdPartyBanner,O as Category,Ae as CreativeModule,xt as CreditCouponRedeem,Hr as CreditsProductCard,Er as CreditsShelf,kt as DownLoad,j as Evaluate,Fr as EventSchedule,$ as Faq,er as FeatureCards,lr as FeatureShowcase,rr as FeaturedBlogPosts,Dt as Features,Nt as FootCharger,ne as FooterNavigation,Ot as GiftBox,n as GiftShelf,u as GiftTierShelf,N as Graphic,pe as GraphicAttractionBlock,bt as GraphicMore,Fe as GraphicOverlay,fe as HeaderNavigation,L as HeroBanner,xe as IPC_SEARCH_PAGE,Rt as IPRedirect,to as ImageOverlayShelf,Zt as ImageTextFeature,so as ImageTextOverlay,ar as ImageWithText,Qt as Ksp,s as MainProductArea,_ as Marquee,re as MarqueeImageContent,te as MarqueeItem,J as MarqueeReview,oe as MarqueeTextContent,Xr as MediaEndorsement,H as MediaPlayerBase,K as MediaPlayerMulti,q as MediaPlayerSticky,hr as MediaSceneSwitcher,Cr as MediaSceneSwitcherV2,Wr as MediaShelf,$r as MediaTextOverlay,P as MemberEquity,fo as MiniCart,no as MiniCartCircleProgress,uo as MiniCartDialog,mo as MiniCartDialogComponent,Oo as ModalCoupon,Do as ModalRegisterSubscribe,Lo as ModalSmsSubscribe,jo as ModalSubscribeConfirm,ko as ModalVerify,ie as MultiLayoutGraphicBlock,gt as NotifyMeDialog,e as PAYLOAD_COMPONENT_MAP,St as PaidShipping,He as ProductActions,it as ProductBanner,Ke as ProductBenefits,qe as ProductBenefitsTabs,tt as ProductBundle,Yt as ProductCompare,ot as ProductCoupon,Je as ProductFreeGift,Xe as ProductFunctionFreeGift,ft as ProductGallery,pt as ProductGridBox,mr as ProductHero,_e as ProductHighlight,Ut as ProductLottery,Tr as ProductNav,$e as ProductOptions,vt as ProductPaidShipping,Bt as ProductServiceBenefits,nt as ProductSummary,i as PromoBanner,Ar as PromotionalBar,Ne as PurchaseBar,zr as SceneProductCard,qr as SceneShelf,Ur as SceneShelfV2,_r as SceneShelfV2ProductCard,Jr as SceneShelfV3,ue as SearchPage,ye as SearchPageTabType,Gr as SecondaryBanner,a as SectionHeader,Lt as SelectStore,b as ShelfDisplay,D as ShelfDisplayHorizontal,g as Slogan,v as Spacer,Ge as Specs,yr as SpecsComparison,Te as SwiperBox,we as TabGroup,cr as TabWithImage,Me as Tabs,dr as TabsWithMedia,Mr as ThreeDCarousel,B as Title,sr as VideoFeature,Ie as VideoModal,yo as WebPushPopup,zt as WheelLottery,X as WhyChoose,bo as useAiuiContext,ke as useBizProductContext,ho as useEmarsysWebPush,he as withLayout};
|
|
1
|
+
import{AccessoriesProductGrid as o,SectionHeader as a,PromoBanner as i,MainProductArea as s,AddToCartSuccessPopover as p}from"./AccessoriesShelf/index.js";import{default as f}from"./ActivitySchedule/index.js";import{default as n}from"./GiftShelf/index.js";import{default as u}from"./GiftTierShelf/index.js";import{default as x}from"./ActivityMechanism/index.js";import{default as S}from"./BrandEquity/index.js";import{default as P}from"./MemberEquity/index.js";import{default as g}from"./Slogan/index.js";import{default as B}from"./Title/index.js";import{default as v}from"./Spacer/index.js";import{default as b}from"./ShelfDisplay/index.js";import{default as D}from"./ShelfDisplayHorizontal/index.js";import{default as j}from"./Evaluate/index.js";import{default as L}from"./Category/index.js";import{default as V}from"./HeroBanner/index.js";import{default as k}from"./AccordionCards/index.js";import{default as W}from"./Graphic/index.js";import{default as H}from"./MediaPlayerBase/index.js";import{default as q}from"./MediaPlayerSticky/index.js";import{default as K}from"./MediaPlayerMulti/index.js";import{default as _}from"./Marquee/index.js";import{default as J}from"./MarqueeReview/index.js";import{default as X}from"./WhyChoose/index.js";import{default as $}from"./Faq/index.js";import{MarqueeItem as re,MarqueeImageContent as te,MarqueeTextContent as oe}from"./Marquee/index.js";import{default as ie}from"./MultiLayoutGraphicBlock/index.js";import{default as pe}from"./GraphicAttractionBlock/index.js";import{default as fe}from"./HeaderNavigation/index.js";import{default as ne}from"./FooterNavigation/index.js";import{default as ue}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as xe,SearchPageTabType as ye}from"./SearchPage/types.js";import{withLayout as he}from"../shared/Styles.js";import{default as Ce}from"./AiuiProvider/index.js";import{default as Me}from"./Tabs/index.js";import{default as Te}from"./SwiperBox/index.js";import{VideoModal as Ie}from"./VideoModal/index.js";import{default as Ae}from"./CreativeModule/index.js";import{default as Fe}from"./GraphicOverlay/index.js";import{default as Ge}from"./Specs/index.js";import{default as Oe}from"./TabsGroup/index.js";import{default as we,useBizProductContext as ke}from"./Listing/BizProductProvider.js";import{default as We}from"./Listing/components/PurchaseBar/index.js";import{default as He}from"./Listing/components/PurchaseBar/ProductActions/index.js";import{default as qe}from"./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js";import{default as Ke}from"./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js";import{default as _e}from"./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js";import{default as Je}from"./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js";import{default as Xe}from"./Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js";import{default as $e}from"./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js";import{default as rr}from"./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js";import{default as or}from"./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js";import{default as ir}from"./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js";import{default as pr}from"./Listing/components/ProductCard/ProductGridBox.js";import{default as fr}from"./Listing/components/ProductCard/ProductGallery/index.js";import{default as nr}from"./Listing/components/ProductCard/ProductSummary/index.js";import{default as ur}from"./Listing/components/ProductCard/ProductDetail/BenefitsTab.js";import{default as xr}from"./Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js";import{default as Sr}from"./Listing/components/PaidShipping/index.js";import{default as Pr}from"./Listing/components/CartActionButtons/index.js";import{NotifyMeDialog as gr}from"./NotifyMeDialog/index.js";import{default as Br}from"./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js";import{default as vr}from"./Listing/components/ProductCard/ProductPaidShipping/index.js";import{default as br}from"./GraphicMore/index.js";import{default as Dr}from"./Features/index.js";import{default as jr}from"./AplusDesc/index.js";import{default as Lr}from"./GiftBox/index.js";import{default as Vr}from"./SelectStore/index.js";import{default as kr}from"./DownLoad/index.js";import{default as Wr}from"./FootCharger/index.js";import{default as Hr}from"./BrandCardLink/index.js";import*as Rr from"./IPRedirect/index.js";import{default as zr}from"./WheelLottery/index.js";import{default as Ur}from"./ProductLottery/index.js";import{default as Yr}from"./ProductCompare/index.js";import{default as Qr}from"./Ksp/index.js";import{default as Zr}from"./ImageTextFeature/index.js";import{default as et}from"./FeatureCards/index.js";import{default as tt}from"./FeaturedBlogPosts/index.js";import{default as at}from"./ImageWithText/index.js";import{default as st}from"./VideoFeature/index.js";import{default as dt}from"./TabsWithMedia/index.js";import{default as ct}from"./TabWithImage/index.js";import{default as lt}from"./FeatureShowcase/index.js";import{default as mt}from"./ProductHero/index.js";import{default as yt}from"./SpecsComparison/index.js";import{default as ht}from"./MediaSceneSwitcher/index.js";import{default as Ct}from"./MediaSceneSwitcherV2/index.js";import{default as Mt}from"./ThreeDCarousel/index.js";import{default as Tt}from"./ProductNav/index.js";import{default as It}from"./AnchorNavigation/index.js";import{default as At}from"./PromotionalBar/index.js";import{default as Ft}from"./EventSchedule/index.js";import{default as Gt}from"./SecondaryBanner/index.js";import{default as Ot}from"./BuyOneGetOneShelf/index.js";import{default as wt}from"./ActiveShelf/index.js";import{default as Nt}from"./MediaShelf/index.js";import{default as Et,CreditsProductCard as Ht}from"./CreditsShelf/index.js";import{default as qt,SceneProductCard as zt}from"./SceneShelf/index.js";import{default as Ut,SceneShelfV2ProductCard as _t}from"./SceneShelfV2/index.js";import{default as Jt}from"./SceneShelfV3/index.js";import{default as Xt}from"./MediaEndorsement/index.js";import{default as $t}from"./MediaTextOverlay/index.js";import{default as ro}from"./ImageOverlayShelf/index.js";import{default as oo,AccessoryProductCard as ao}from"./AccessoriesShelf/components/AccessoryShelf/index.js";import{default as so}from"./ImageTextOverlay/index.js";import{default as fo}from"./MiniCart/index.js";import{default as no}from"./MiniCart/CircleProgress.js";import{default as uo,MiniCartDialog as mo}from"./MiniCart/MiniCartDialog.js";import{default as yo}from"./WebPushPopup/index.js";import{useEmarsysWebPush as ho}from"../hooks/useEmarsysWebPush.js";const e={ActivityMechanism:"ActivityMechanism",ActivitySchedule:"ActivitySchedule",AnchorNavigation:"AnchorNavigation",EventSchedule:"EventSchedule",FeatureCards:"FeatureCards",GiftShelf:"GiftShelf",GiftTierShelf:"GiftTierShelf",ImageTextFeature:"ImageTextFeature",ImageTextOverlay:"ImageTextOverlay",ImageWithText:"ImageWithText",MarqueeReview:"MarqueeReview",MediaSceneSwitcher:"MediaSceneSwitcher",ProductCompare:"ProductCompare",ProductHero:"ProductHero",ProductNav:"ProductNav",PromotionalBar:"PromotionalBar",TabsWithMedia:"TabsWithMedia",ThreeDCarousel:"ThreeDCarousel",VideoFeature:"VideoFeature","ipc-accordioncards":"AccordionCards","ipc-active-shelf":"ActiveShelf","ipc-add-to-cart-success-popover":"AddToCartSuccessPopover","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-brand-card-link":"BrandCardLink","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-creativemodule":"CreativeModule","ipc-credits-shelf":"CreditsShelf","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-image-overlay-shelf":"ImageOverlayShelf","ipc-marquee":"Marquee","ipc-media-endorsement":"MediaEndorsement","ipc-media-shelf":"MediaShelf","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-media-text-overlay":"MediaTextOverlay","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mini-cart":"MiniCart","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-notify-me-dialog":"NotifyMeDialog","ipc-product-lottery":"ProductLottery","ipc-scene-shelf":"SceneShelf","ipc-scene-shelf-v2":"SceneShelfV2","ipc-scene-shelf-v3":"SceneShelfV3","ipc-search-page":"SearchPage","ipc-search-page-tabs":"SearchPage","ipc-secondary-banner":"SecondaryBanner","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-shelfdisplay-horizontal":"ShelfDisplayHorizontal","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-title":"Title","ipc-wheel-lottery":"WheelLottery","ipc-whychoose":"WhyChoose",ksp:"Ksp",modalCoupon:"ModalCoupon",modalRegisterSubscribe:"ModalRegisterSubscribe",modalSmsSubscribe:"ModalSmsSubscribe",modalSubscribeConfirm:"ModalSubscribeConfirm",modalVerify:"ModalVerify"};import{CartSummaryHeader as Co,CartItemRow as go,CartGiftSection as Mo,CartPerksSection as Bo,CartThirdPartyBanner as To,CartPriceSummary as vo}from"./CartDetail/index.js";import{useAiuiContext as bo}from"./AiuiProvider/index.js";import{default as Do}from"./ModalRegisterSubscribe/index.js";import{default as jo}from"./ModalSubscribeConfirm/index.js";import{default as Lo}from"./ModalCoupon/index.js";import{default as Vo}from"./ModalSmsSubscribe/index.js";import{default as ko}from"./ModalVerify/index.js";export{o as AccessoriesProductGrid,ao as AccessoryProductCard,oo as AccessoryShelf,k as AccordionCards,wt as ActiveShelf,x as ActivityMechanism,f as ActivitySchedule,p as AddToCartSuccessPopover,Ce as AiuiProvider,It as AnchorNavigation,jr as AplusDesc,ur as BenefitsTab,we as BizProductProvider,Hr as BrandCardLink,S as BrandEquity,Ot as BuyOneGetOneShelf,Pr as CartActionButtons,Mo as CartGiftSection,go as CartItemRow,Bo as CartPerksSection,vo as CartPriceSummary,Co as CartSummaryHeader,To as CartThirdPartyBanner,L as Category,Ae as CreativeModule,xr as CreditCouponRedeem,Ht as CreditsProductCard,Et as CreditsShelf,kr as DownLoad,j as Evaluate,Ft as EventSchedule,$ as Faq,et as FeatureCards,lt as FeatureShowcase,tt as FeaturedBlogPosts,Dr as Features,Wr as FootCharger,ne as FooterNavigation,Lr as GiftBox,n as GiftShelf,u as GiftTierShelf,W as Graphic,pe as GraphicAttractionBlock,br as GraphicMore,Fe as GraphicOverlay,fe as HeaderNavigation,V as HeroBanner,xe as IPC_SEARCH_PAGE,Rr as IPRedirect,ro as ImageOverlayShelf,Zr as ImageTextFeature,so as ImageTextOverlay,at as ImageWithText,Qr as Ksp,s as MainProductArea,_ as Marquee,te as MarqueeImageContent,re as MarqueeItem,J as MarqueeReview,oe as MarqueeTextContent,Xt as MediaEndorsement,H as MediaPlayerBase,K as MediaPlayerMulti,q as MediaPlayerSticky,ht as MediaSceneSwitcher,Ct as MediaSceneSwitcherV2,Nt as MediaShelf,$t as MediaTextOverlay,P as MemberEquity,fo as MiniCart,no as MiniCartCircleProgress,uo as MiniCartDialog,mo as MiniCartDialogComponent,Lo as ModalCoupon,Do as ModalRegisterSubscribe,Vo as ModalSmsSubscribe,jo as ModalSubscribeConfirm,ko as ModalVerify,ie as MultiLayoutGraphicBlock,gr as NotifyMeDialog,e as PAYLOAD_COMPONENT_MAP,Sr as PaidShipping,He as ProductActions,ir as ProductBanner,Ke as ProductBenefits,qe as ProductBenefitsTabs,rr as ProductBundle,Yr as ProductCompare,or as ProductCoupon,Je as ProductFreeGift,Xe as ProductFunctionFreeGift,fr as ProductGallery,pr as ProductGridBox,mt as ProductHero,_e as ProductHighlight,Ur as ProductLottery,Tt as ProductNav,$e as ProductOptions,vr as ProductPaidShipping,Br as ProductServiceBenefits,nr as ProductSummary,i as PromoBanner,At as PromotionalBar,We as PurchaseBar,zt as SceneProductCard,qt as SceneShelf,Ut as SceneShelfV2,_t as SceneShelfV2ProductCard,Jt as SceneShelfV3,ue as SearchPage,ye as SearchPageTabType,Gt as SecondaryBanner,a as SectionHeader,Vr as SelectStore,b as ShelfDisplay,D as ShelfDisplayHorizontal,g as Slogan,v as Spacer,Ge as Specs,yt as SpecsComparison,Te as SwiperBox,Oe as TabGroup,ct as TabWithImage,Me as Tabs,dt as TabsWithMedia,Mt as ThreeDCarousel,B as Title,st as VideoFeature,Ie as VideoModal,yo as WebPushPopup,zr as WheelLottery,X as WhyChoose,bo as useAiuiContext,ke as useBizProductContext,ho as useEmarsysWebPush,he as withLayout};
|
|
@@ -5,6 +5,14 @@ interface ScrollLoadVideoProps {
|
|
|
5
5
|
eagerPoster?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
videoClassName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 1490: 视频层(包裹 video 的容器 div)的初始附加类名。
|
|
10
|
+
* 传入 'opacity-0' 可让视频在真实 playing 前保持不可见——
|
|
11
|
+
* WebKit 会在 readyState≥2 时绘制视频当前帧(Chromium 不会),
|
|
12
|
+
* 未加载的 lazy 封面图是透明的,视频首帧会先闪现。
|
|
13
|
+
* 由调用方在 onPlaying/onWaiting 中增删 'opacity-0' 控制。
|
|
14
|
+
*/
|
|
15
|
+
videoLayerClassName?: string;
|
|
8
16
|
autoplay?: boolean;
|
|
9
17
|
muted?: boolean;
|
|
10
18
|
loop?: boolean;
|
|
@@ -17,5 +25,5 @@ interface ScrollLoadVideoProps {
|
|
|
17
25
|
};
|
|
18
26
|
[key: string]: any;
|
|
19
27
|
}
|
|
20
|
-
declare const ScrollLoadVideo: ({ src, poster, eagerPoster, className, videoClassName, autoplay, muted, loop, controls, playsInline, videoRef, intersectionObserverConfig, ...attr }: ScrollLoadVideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const ScrollLoadVideo: ({ src, poster, eagerPoster, className, videoClassName, videoLayerClassName, autoplay, muted, loop, controls, playsInline, videoRef, intersectionObserverConfig, ...attr }: ScrollLoadVideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
29
|
export default ScrollLoadVideo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as m}from"react/jsx-runtime";import{useRef as i,useEffect as l,useState as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{useRef as i,useEffect as l,useState as C}from"react";import{cn as v}from"../helpers/utils.js";const H=({src:b,poster:c,eagerPoster:p=!1,className:y="",videoClassName:h="",videoLayerClassName:g="",autoplay:L=!0,muted:E=!0,loop:t=!0,controls:R=!1,playsInline:P=!0,videoRef:M,intersectionObserverConfig:V={threshold:0,rootMargin:"200px"},...w})=>{const[o,I]=C(!1),N=i(null),u=i(null),s=i(!1),r=M||N,{threshold:d,rootMargin:f}=V;return l(()=>{const e=r.current;if(!e||t)return;const n=()=>{s.current=!0};return e.addEventListener("ended",n),()=>{e.removeEventListener("ended",n)}},[r,t,o]),l(()=>{const e=r.current;if(!e||!o)return;const n=()=>{!e.paused||e.ended||!t&&s.current||(e.muted=!0,e.play().catch(()=>{}))};return e.addEventListener("canplay",n),()=>e.removeEventListener("canplay",n)},[r,o,t]),l(()=>{const e=new IntersectionObserver(S=>{S.forEach(k=>{if(k.isIntersecting){if(o||I(!0),r.current){const a=r.current;if(!t&&s.current)return;a.muted=!0,a.currentTime=0,a.play().catch(T=>{console.warn("\u89C6\u9891\u81EA\u52A8\u64AD\u653E\u5931\u8D25:",T)})}}else r.current&&r.current.pause()})},{threshold:d,rootMargin:f}),n=u.current;return n&&e.observe(n),()=>{n&&e.unobserve(n)}},[r,t,f,o,d]),m("div",{ref:u,className:v("relative size-full",y,g),children:m("video",{ref:r,src:o?b:void 0,poster:p||o?c:void 0,className:v("size-full object-cover",h),loop:t,muted:E,controls:R,playsInline:P,preload:"metadata",disablePictureInPicture:!0,"webkit-playsinline":!0,autoPlay:L,...w})})};var j=H;export{j as default};
|