@anker-in/headless-ui 1.3.80 → 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/ActiveShelf/ProductCard.d.ts +2 -0
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -0
- package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/styles.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/DiscountBadge.d.ts +25 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/DiscountBadge.js +1 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +0 -3
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductTags.d.ts +14 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductTags.js +1 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.d.ts +2 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +70 -3
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js +1 -1
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- 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/MediaShelf/ProductCard.d.ts +2 -0
- package/dist/cjs/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/MediaShelf/index.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/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/Title/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/cjs/material/breakpoints.d.ts +97 -0
- package/dist/cjs/material/breakpoints.js +1 -0
- package/dist/cjs/material/contract.d.ts +72 -0
- package/dist/cjs/material/contract.js +1 -0
- package/dist/cjs/material/index.d.ts +17 -0
- package/dist/cjs/material/index.js +1 -0
- package/dist/cjs/material/material-meta.d.ts +76 -0
- package/dist/cjs/material/material-meta.js +1 -0
- package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +2 -0
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -0
- package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/styles.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/DiscountBadge.d.ts +25 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/DiscountBadge.js +1 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +0 -3
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductTags.d.ts +14 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductTags.js +1 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.d.ts +2 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +70 -3
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.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/MediaShelf/ProductCard.d.ts +2 -0
- package/dist/esm/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/MediaShelf/index.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/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/Title/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/dist/esm/material/breakpoints.d.ts +97 -0
- package/dist/esm/material/breakpoints.js +1 -0
- package/dist/esm/material/contract.d.ts +72 -0
- package/dist/esm/material/contract.js +1 -0
- package/dist/esm/material/index.d.ts +17 -0
- package/dist/esm/material/index.js +1 -0
- package/dist/esm/material/material-meta.d.ts +76 -0
- package/dist/esm/material/material-meta.js +1 -0
- package/package.json +13 -2
- package/style.css +26 -2
|
@@ -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 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as G,jsx as a,jsxs as r}from"react/jsx-runtime";import*as s from"react";import{cn as t}from"../../helpers/index.js";import{Button as k,Badge as q,Card as $,CardContent as E,Picture as H,Text as y,Heading as c,Progress as R}from"../../components/index.js";const I=5;function O(e,l,d,f){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return l===void 0?!0:d<=l;case"below-percentage":return l===void 0?!0:d/f*100<=l;default:return!0}}const g=s.forwardRef(({product:e,className:l,stockDisplayMode:d,stockThresholdValue:f,onLearnMore:C,onShopNow:S,onAddToCart:P,classNames:i,secondaryButtonText:b,secondaryButtonFun:v,primaryButtonText:u,primaryButtonFun:h,showOriginalPrice:N,copy:p,onProductImageClick:o,showTags:M=!0,showMemberPrice:F=!0},L)=>{const[B,D]=s.useState(!1),[T,z]=s.useState(!1),_=s.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?I:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),x=async(n,m)=>{if(!n)return;const w=m==="primary"?D:z;w(!0);try{switch(n){case"buyNow":await S?.(e);break;case"addCart":await P?.(e);break;case"learnMore":await C?.(e);break;default:break}}finally{w(!1)}},A=e.availableForSale&&e.quantityAvailable<=0;return r($,{ref:L,className:t("tablet:min-w-[auto] hover:bg-container-secondary-0 flex h-full min-w-[296px] flex-col overflow-hidden border-none",e.custom_link?"cursor-pointer":"",l,i?.productCard),children:[r("div",{className:t("media-shelf-product-card-image-wrapper desktop:h-[240px] relative h-[200px] shrink-0 overflow-hidden",i?.productCardImageWrapper),children:[a("div",{className:t("media-shelf-product-card-image-bg absolute inset-0 ",i?.productCardImageBg),children:a("a",{onClick:()=>o?.(e),...!o&&{href:e.custom_link||e.listingLink},className:"cursor-pointer",children:a(H,{source:e.custom_image||e.image,alt:e.name,className:t("h-full",i?.productCardImage),imgClassName:"h-full object-contain"})})}),M&&e.tags&&e.tags.length>0&&a("div",{className:"lg-desktop:h-[28px] absolute left-4 top-4 flex h-[24px]",children:e.tags.map((n,m)=>n.label?a(q,{size:"sm",variant:n.variant||"outline",className:t("mr-1"),promotionalType:n.promotionalType,children:n.label},m):a(s.Fragment,{children:n},m))})]}),r(E,{className:"desktop:p-6 bg-container-primary laptop:gap-6 flex h-[calc(100%-240px)] grow flex-col justify-between gap-4 p-4",children:[r("div",{className:"flex-0",children:[a(c,{as:"h3",size:2,className:t("text-info-primary mb-1 line-clamp-2 tracking-tight",o?"cursor-pointer":"",i?.productTitle),onClick:o?()=>o(e):void 0,children:e.custom_name||e.name}),(e.custom_description||e?.description)&&a(y,{size:2,className:t("text-info-primary line-clamp-1",i?.productDescription),html:e.custom_description||e.description})]}),O(d,f,e?.quantityAvailable??0,e?.totalInventory??0)&&r("div",{"data-total":e?.totalInventory??0,"data-available":e?.quantityAvailable??0,className:"space-y-2",children:[a(R,{value:_,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{progressBar:"transition-all duration-300 ease-in-out"}}),a(y,{size:3,className:"text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[12px]",children:A?p?.limitedStock:p?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]}),r("div",{children:[a("div",{className:t("mb-2",i?.productPrice),children:a("div",{className:"flex items-baseline gap-2",children:e.availableForSale?r(G,{children:[a(c,{size:2,className:"text-info-primary",as:"h6",children:e.price}),N&&e.originalPrice&&a(c,{size:2,className:t("text-info-tertiary line-through",i?.originalPrice),as:"h6",children:e.originalPrice})]}):a(c,{size:2,className:"text-info-tertiary",children:p?.outOfStockLabel??"Sold Out"})})}),F&&e?.priceLabel&&e?.availableForSale&&a(y,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[12px]",i?.productPriceLabel),children:e.priceLabel}),r("div",{className:t("lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2",i?.buttonGroup),children:[b&&a(k,{variant:"secondary",size:"base",className:t("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",i?.secondaryButton),onClick:()=>x(v,"secondary"),disabled:!e.availableForSale&&v!=="learnMore",loading:T,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${b}`,"data-headless-sku":e.sku,children:b}),u&&a(k,{variant:"primary",size:"base",className:t("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",i?.primaryButton),onClick:()=>x(h,"primary"),disabled:!e.availableForSale&&h!=="learnMore",loading:B,"data-headless-type-name":"MediaShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${u}`,"data-headless-sku":e.sku,children:u})]})]})]})]})});g.displayName="MediaShelf.ProductCard";var W=g;export{g as ProductCard,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as h}from"react/jsx-runtime";import*as a from"react";import{cn as p}from"../../helpers/index.js";import{withLayout as A}from"../../shared/Styles.js";import{Text as I,Heading as O,Tabs as $,TabsList as W,TabsTrigger as j,TabsContent as q}from"../../components/index.js";import{Swiper as Z,SwiperSlide as _}from"swiper/react";import{Navigation as G}from"swiper/modules";import"swiper/css";import"swiper/css/navigation";import H from"./ProductCard.js";import{useExposure as J}from"../../hooks/useExposure.js";const K="shelf",Q="media_shelf",U=({disabled:o})=>h("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[t("path",{d:"M0 28C0 43.464 12.536 56 28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28Z",fill:"currentColor",fillOpacity:o?"0.2":"0.6"}),t("path",{d:"M31 22L25 28L31 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),X=({disabled:o})=>h("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[t("path",{d:"M0 28C0 12.536 12.536 0 28 0C43.464 0 56 12.536 56 28C56 43.464 43.464 56 28 56C12.536 56 0 43.464 0 28Z",fill:"currentColor",fillOpacity:o?"0.2":"0.6"}),t("path",{d:"M25 22L31 28L25 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),R=a.createContext(null),Y=()=>{const o=a.useContext(R);if(!o)throw new Error("useMediaShelfContext must be used within an MediaShelfProvider");return o},F=a.forwardRef(({products:o,className:n},y)=>{const{copy:l,stockDisplayMode:T,stockThresholdValue:x,onLearnMore:r,onShopNow:M,onAddToCart:S,onProductImageClick:d,classNames:v,secondaryButtonText:P,primaryButtonText:k,secondaryButtonFun:B,primaryButtonFun:D,showOriginalPrice:L,showTags:N,showMemberPrice:E}=Y(),m=a.useId().replace(/:/g,""),f=`swiper-button-next-custom-${m}`,g=`swiper-button-prev-custom-${m}`,[s,C]=a.useState({isBeginning:!0,isEnd:!1}),b=a.useRef(null),w=a.useCallback(()=>{const e=b.current;if(!e?.slides||e.slides.length===0)return;e.slides.forEach(i=>{i.style.height="auto"});const c=Array.from(e.slides).map(i=>i.scrollHeight),u=Math.max(...c);u>0&&e.slides.forEach(i=>{i.style.height=`${u}px`})},[]);return a.useEffect(()=>{const e=()=>{requestAnimationFrame(w)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[w]),o?.length===0?null:t("div",{ref:y,className:n,children:h("div",{className:"relative",children:[t(Z,{modules:[G],spaceBetween:16,slidesPerView:"auto",navigation:{nextEl:`.${f}`,prevEl:`.${g}`},onSwiper:e=>{b.current=e,C({isBeginning:e.isBeginning,isEnd:e.isEnd}),setTimeout(w,100)},onSlideChange:e=>{C({isBeginning:e.isBeginning,isEnd:e.isEnd})},className:"!overflow-visible",breakpoints:{0:{spaceBetween:12,slidesPerView:1.2},768:{spaceBetween:12,slidesPerView:o.length<=2?2:2.3},1024:{spaceBetween:16,slidesPerView:Math.min(3,o.length)}},children:o.map((e,c)=>t(_,{className:"tablet:!max-w-[50%] overflow-hidden",children:t(H,{product:e,className:"box-border w-full max-w-full",stockDisplayMode:T,stockThresholdValue:x,onLearnMore:r,onShopNow:M,onAddToCart:S,onProductImageClick:d,classNames:v,secondaryButtonText:P,primaryButtonText:k,secondaryButtonFun:B,primaryButtonFun:D,showOriginalPrice:L,copy:l,showTags:N,showMemberPrice:E})},e.shopify_id+"-"+e.sku||c))}),t("button",{className:p(`${g} tablet:block absolute left-4 top-1/2 z-10 hidden -translate-y-1/2`,{"tablet:hidden":o.length<=2,"laptop:hidden":o.length<=3}),"aria-label":l?.previousSlideLabel,disabled:s.isBeginning,children:t(U,{disabled:s.isBeginning})}),t("button",{className:p(`${f} tablet:block absolute right-4 top-1/2 z-10 hidden -translate-y-1/2`,{"tablet:hidden":o.length<=2,"laptop:hidden":o.length<=3}),"aria-label":l?.nextSlideLabel,disabled:s.isEnd,children:t(X,{disabled:s.isEnd})})]})})});F.displayName="ProductsList";const V=a.forwardRef(({className:o,data:n,onLearnMore:y,onShopNow:l,onAddToCart:T,onProductImageClick:x,classNames:r,...M},S)=>{const d=a.useRef(null);J(d,{componentType:K,componentName:Q,componentTitle:n.title,componentDescription:n.description}),a.useImperativeHandle(S,()=>d.current);const{theme:v="light",codeChannel:P,showMemberPrice:k=!0,showDiscount:B=!0,showTags:D=!0,stockDisplayMode:L,stockThresholdValue:N,showOriginalPrice:E=!0,secondaryButtonText:m,primaryButtonText:f,secondaryButtonFun:g,primaryButtonFun:s,isShowTab:C=!0,copy:b}=n,e={codeChannel:P,showMemberPrice:k,showDiscount:B,showTags:D,stockDisplayMode:L,stockThresholdValue:N,showOriginalPrice:E,onLearnMore:y,onShopNow:l,onAddToCart:T,onProductImageClick:x,classNames:r,secondaryButtonText:m,secondaryButtonFun:g,primaryButtonText:f,primaryButtonFun:s,copy:b||{}},c=n.productsTab&&n.productsTab.length>0,u=C&&c;return t(R.Provider,{value:e,children:h("div",{ref:d,className:p("w-full",{"aiui-dark":v==="dark"},o,r?.root),...M,children:[n.title&&t(O,{as:"h2",html:n.title,size:4,className:p("text-info-primary mb-4",r?.title)}),n.description&&t(I,{size:3,as:"p",html:n.description,className:p("text-info-primary mb-6",r?.description)}),h($,{defaultValue:n.productsTab?.[0]?.id,className:"w-full",children:[u&&t(W,{className:"mb-6",children:n.productsTab?.map(i=>t(j,{value:i.id,children:i.tab},"tab-"+i.id))}),u?n.productsTab?.map(i=>t(q,{value:i.id,children:t(F,{products:i.data})},"tab-content-"+i.id)):t(F,{products:n.productsCard})]})]})})});V.displayName="MediaShelf";const z=V;z.ProductCard=H;const ee=A(z);var ce=ee;export{ce as default,Y as useMediaShelfContext};
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as l,jsxs as h}from"react/jsx-runtime";import*as g from"react";import{cn as
|
|
1
|
+
"use client";import{jsx as l,jsxs as h}from"react/jsx-runtime";import*as g from"react";import{cn as s}from"../../helpers/index.js";import{Heading as k,Button as v,Picture as B}from"../../components/index.js";import{withLayout as P}from"../../shared/Styles.js";import{getLocalizedPath as T}from"../../helpers/index.js";import{useAiuiContext as M}from"../AiuiProvider/index.js";import{trackUrlRef as N}from"../../shared/trackUrlRef.js";const D="image",y="PromotionalBar",R=i=>{if(!i)return;const{mobile:e,tablet:m,laptop:u,desktop:d,lgDesktop:f}=i,t=[],r=b=>b?.url,o=r(f),n=r(d),a=r(u),p=r(m),c=r(e);return o?t.push(o):n?t.push(n):a?t.push(a):p?t.push(p):c&&t.push(c),n&&o&&t.push(`${n} 1920`),a&&(n||o)&&t.push(`${a} 1440`),p&&(a||n||o)&&t.push(`${p} 1024`),c&&(p||a||n||o)&&t.push(`${c} 768`),t.length>0?t.join(", "):void 0},x=g.forwardRef(({classNames:i,data:e,className:m,...u},d)=>{const{locale:f="us",pageHandle:t}=M(),{backgroundImage:r,theme:o="dark"}=e,n=g.useMemo(()=>R(r),[r]);return l("div",{ref:d,...u,className:s("laptop:h-[192px] lg-desktop:h-[240px] h-[240px] text-[#080A0F]",{"text-[#F5F6F7]":o==="dark"},i?.root,m),children:h("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[h("div",{className:s("laptop:px-8 laptop:justify-center laptop:box-content lg-desktop:max-w-[686px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",i?.content),children:[e.contentTitle&&l(k,{className:s("line-clamp-2 ",i?.title),html:e.contentTitle,size:3}),e.contentDesc&&l("p",{className:s("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] ",i?.description),dangerouslySetInnerHTML:{__html:e.contentDesc}}),l("div",{className:"laptop:mt-4 mt-2",children:e.buttonText&&l(v,{as:"a",variant:"link",className:s("!p-0 text-[#F5F6F7]",{"text-[#080A0F]":o==="light"},i?.button),href:N(T(e.buttonLink||"",f),`${t}_${D}_${y}`),iconClassName:"size-4",children:e.buttonText})})]}),l(B,{source:n,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});x.displayName="PromotionalBar";var I=P(x);export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as
|
|
1
|
+
"use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as c,Picture as n}from"../../components/index.js";import{useSceneShelfContext as O}from"./context.js";import{LocalizedLink as q}from"../../shared/LocalizedLink.js";const p=T.forwardRef(({className:x,classNames:h,product:e,selected:f,onSelectChange:b,showTags:k,showOriginalPrice:C,onProductImageClick:P,...u},N)=>{const r=O(),S=k??r?.showTags??!0,v=C??r?.showOriginalPrice??!0,s=h??r?.classNames??{},l=f??(r?r.selectedIds.has(e.id):!1),m=b??r?.onSelectChange,g=P??r?.onProductImageClick,o=e.soldOut??!1,w=i=>{o||typeof i=="boolean"&&m?.(i,e)},y=()=>{o||m?.(!l,e)};return d("div",{ref:N,className:t("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",o?"cursor-not-allowed opacity-50":"cursor-pointer",l?t("border-brand-0 bg-container-secondary-0",s?.cardSelected):t("border-lines bg-container-primary",!o&&"hover:bg-container-secondary",s?.card),x),onClick:y,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...u,children:[a("div",{className:t("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",s?.tags),children:S&&e.tags?.map((i,z)=>a(j,{variant:i.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:i.label},z))}),a(L,{checked:l,disabled:o,onCheckedChange:w,onClick:i=>i.stopPropagation(),className:t("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",s?.checkbox)}),a("div",{className:t("flex flex-1 grow-0 items-center justify-center",s?.image),children:g?a("a",{onClick:()=>g(e),role:"button",children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?a(q,{href:e.href,children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),d("div",{className:"flex grow flex-col justify-start gap-4",children:[a(D,{as:"h3",size:2,className:t("text-info-primary line-clamp-2 h-[2.2em]",s?.title),html:e.custom_name??e.title}),d("div",{className:t("flex flex-wrap items-center gap-1",s?.priceWrapper),children:[a(c,{as:"span",size:2,className:t("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",s?.currentPrice),children:e.currentPrice.formatted}),v&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&a(c,{as:"span",size:2,className:t("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",s?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&a(c,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",s?.productPriceLabel),children:e.priceLabel})]})]})});p.displayName="SceneShelf.ProductCard";export{p as SceneProductCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,jsxs as
|
|
1
|
+
"use client";import{jsx as i,jsxs as T}from"react/jsx-runtime";import at,{useEffect as lt,useRef as g,useImperativeHandle as dt,useState as ct}from"react";import{gsap as k}from"gsap";import{SplitText as R}from"gsap/dist/SplitText";import{ScrollTrigger as A}from"gsap/dist/ScrollTrigger";import{cn as s,getLocalizedPath as ut}from"../../helpers/utils.js";import{cva as V}from"class-variance-authority";import{Heading as mt,Text as N,Countdown as pt}from"../../components/index.js";import{withLayout as ft}from"../../shared/Styles.js";import{useAiuiContext as ht}from"../AiuiProvider/index.js";import{convertLexicalToPlaintext as gt}from"@payloadcms/richtext-lexical/plaintext";import{trackUrlRef as xt}from"../../shared/trackUrlRef.js";import{useInView as wt}from"react-intersection-observer";const S="link",$="title";function bt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const a=t?.root?.children;return!Array.isArray(a)||a.length===0?!1:a.some(n=>{const r=n?.children;return!Array.isArray(r)||r.length===0?!1:r.some(o=>typeof o?.text=="string"&&o.text.length>0)})}function _(t){if(!t)return"";if(typeof t=="string")return t;try{return gt({data:t})||""}catch{return""}}const yt=V("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),vt=V("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),B=({data:t,onClick:a,className:n})=>{const{theme:r="light",extensions:o,title:p,caption:x,align:f}=t,{locale:w="us"}=ht();if(!o?.textLink)return null;const d=o?.link?xt(ut(o.link,w),`${S}_${$}`):void 0;return T("a",{className:s({"aiui-dark":r==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":r==="light"},{"text-[#F5F6F7]":r==="dark"},{"justify-center mt-4":f==="center"},{"mt-1 laptop:mt-0":f==="left"},n),...d?{href:d}:{},"data-headless-type-name":`${S}#${$}`,"data-headless-title-desc-button":`${_(p)}#${_(x)}`,...a?{onClick:a}:{},children:[i("div",{className:"truncate whitespace-nowrap",children:o?.textLink}),i("div",{className:"lg-desktop:size-5 size-4",children:i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:r==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]})},I=at.forwardRef(({data:t,className:a,classNames:n,as:r="h2",weight:o="bold",onButtonClick:p,id:x,...f},w)=>{const{title:d,titleSize:j=4,caption:L,subtitle:F,content:H,countdown:e,showCountdown:O=!1,theme:h="light",extensions:C,align:c="left"}=t,D=g(null),u=g(null),l=g(null),m=g(null),[U,W]=ct(!0),{ref:Z,inView:M}=wt();dt(w,()=>D.current);const q=()=>{W(!1)},G=e?.targetDateTime||e?.targetDate||"",J=e?.targetDateTime_tz,K=e?.labels?{day:e.labels.days||"Day",hour:e.labels.hours||"Hours",minute:e.labels.minutes||"Mins",second:e.labels.seconds||"Secs"}:void 0;return lt(()=>{k.registerPlugin(R,A);function Q(){if(!u.current)return;const X=u.current?.clientHeight||80;l.current&&l.current.revert(),m.current&&m.current.kill(),l.current=new R(u.current,{type:"words",wordsClass:"word"});const b=l.current.words;k.set(b,{opacity:0}),m.current=A.create({trigger:u.current,start:"bottom bottom-=4%",end:`bottom+=${X*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:Y=>{const tt=Y.progress,z=b.length||1,et=.5,y=1/z,E=y*(1-et),P=(z-1)*E+y,nt=Math.min(1,P>0?tt/P:0);b.forEach((rt,it)=>{const ot=it*E,st=y;let v=(nt-ot)/st;v=Math.max(0,Math.min(1,v)),k.set(rt,{opacity:v})})}})}return M&&Q(),()=>{l.current&&l.current.revert(),m.current&&m.current.kill()}},[M]),T("div",{id:C?.id?C?.id:x,className:s("titleBottom title-box flex items-end justify-between gap-2 pb-6",a,n?.wrapper),...f,ref:D,children:[T("div",{ref:Z,className:s("flex-1",n?.container,{"aiui-dark":h==="dark","text-center":c==="center","text-left":c==="left"}),children:[(L||d)&&i(mt,{ref:u,as:r,size:j,html:L||d,weight:o,className:s(yt({theme:h}),n?.title)}),F&&i(N,{html:F,as:"div",className:s(vt({theme:h}),n?.subtitle)}),bt(H)&&i(N,{html:H,as:"div",size:4,className:s("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",n?.content)}),i(B,{data:t,className:s({"laptop:hidden":c==="left"},n?.button),onClick:p}),O&&e&&U&&i(pt,{endDate:G,endDate_tz:J,timeLabels:K,showDays:e?.showDays,showHours:e?.showHours,showMinutes:e?.showMinutes,showSeconds:e?.showSeconds,theme:h,onExpire:q,hideWhenExpired:!0,align:c==="center"?"center":"left",className:s("mt-4",n?.countdown)})]}),i(B,{data:t,className:s("hidden",{"laptop:flex":c==="left"},n?.button),onClick:p})]})});I.displayName="Title";var At=ft(I);export{At as default};
|
|
@@ -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';
|