@anker-in/headless-ui 1.1.84 → 1.1.85

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.
Files changed (140) hide show
  1. package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -2
  2. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  3. package/dist/cjs/biz-components/ActiveShelf/index.js.map +3 -3
  4. package/dist/cjs/biz-components/EventSchedule/index.d.ts +2 -7
  5. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  6. package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
  7. package/dist/cjs/biz-components/FeaturedBlogPosts/index.d.ts +1 -6
  8. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js +1 -1
  9. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js.map +3 -3
  10. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  11. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  12. package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +2 -2
  13. package/dist/cjs/biz-components/ImageOverlayShelf/index.js +1 -1
  14. package/dist/cjs/biz-components/ImageOverlayShelf/index.js.map +3 -3
  15. package/dist/cjs/biz-components/LotteryShared/BaseModal.d.ts +61 -0
  16. package/dist/cjs/biz-components/LotteryShared/BaseModal.js +2 -0
  17. package/dist/cjs/biz-components/LotteryShared/BaseModal.js.map +7 -0
  18. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.d.ts +25 -0
  19. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js +2 -0
  20. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js.map +7 -0
  21. package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +47 -0
  22. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js +2 -0
  23. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +7 -0
  24. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +101 -0
  25. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +2 -0
  26. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +7 -0
  27. package/dist/cjs/biz-components/LotteryShared/PrizePool.d.ts +29 -0
  28. package/dist/cjs/biz-components/LotteryShared/PrizePool.js +2 -0
  29. package/dist/cjs/biz-components/LotteryShared/PrizePool.js.map +7 -0
  30. package/dist/cjs/biz-components/LotteryShared/RulesModal.d.ts +56 -0
  31. package/dist/cjs/biz-components/LotteryShared/RulesModal.js +2 -0
  32. package/dist/cjs/biz-components/LotteryShared/RulesModal.js.map +7 -0
  33. package/dist/cjs/biz-components/LotteryShared/ShareModal.d.ts +79 -0
  34. package/dist/cjs/biz-components/LotteryShared/ShareModal.js +2 -0
  35. package/dist/cjs/biz-components/LotteryShared/ShareModal.js.map +7 -0
  36. package/dist/cjs/biz-components/LotteryShared/WinnerModal.d.ts +27 -0
  37. package/dist/cjs/biz-components/LotteryShared/WinnerModal.js +2 -0
  38. package/dist/cjs/biz-components/LotteryShared/WinnerModal.js.map +7 -0
  39. package/dist/cjs/biz-components/LotteryShared/index.d.ts +23 -0
  40. package/dist/cjs/biz-components/LotteryShared/index.js +2 -0
  41. package/dist/cjs/biz-components/LotteryShared/index.js.map +7 -0
  42. package/dist/cjs/biz-components/LotteryShared/types.d.ts +760 -0
  43. package/dist/cjs/biz-components/LotteryShared/types.js +2 -0
  44. package/dist/cjs/biz-components/LotteryShared/types.js.map +7 -0
  45. package/dist/cjs/biz-components/MediaEndorsement/index.js +2 -2
  46. package/dist/cjs/biz-components/MediaEndorsement/index.js.map +2 -2
  47. package/dist/cjs/biz-components/MediaShelf/index.d.ts +2 -2
  48. package/dist/cjs/biz-components/MediaShelf/index.js +1 -1
  49. package/dist/cjs/biz-components/MediaShelf/index.js.map +3 -3
  50. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.d.ts +4 -0
  51. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js +2 -0
  52. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js.map +7 -0
  53. package/dist/cjs/biz-components/ProductLottery/index.d.ts +17 -0
  54. package/dist/cjs/biz-components/ProductLottery/index.js +2 -0
  55. package/dist/cjs/biz-components/ProductLottery/index.js.map +7 -0
  56. package/dist/cjs/biz-components/ProductLottery/types.d.ts +363 -0
  57. package/dist/cjs/biz-components/ProductLottery/types.js +2 -0
  58. package/dist/cjs/biz-components/ProductLottery/types.js.map +7 -0
  59. package/dist/cjs/biz-components/Specs/index.js +1 -1
  60. package/dist/cjs/biz-components/Specs/index.js.map +3 -3
  61. package/dist/cjs/biz-components/WheelLottery/index.d.ts +11 -11
  62. package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
  63. package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
  64. package/dist/cjs/biz-components/WheelLottery/types.d.ts +17 -723
  65. package/dist/cjs/biz-components/WheelLottery/types.js +1 -1
  66. package/dist/cjs/biz-components/WheelLottery/types.js.map +3 -3
  67. package/dist/cjs/biz-components/index.d.ts +2 -0
  68. package/dist/cjs/biz-components/index.js +1 -1
  69. package/dist/cjs/biz-components/index.js.map +3 -3
  70. package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -2
  71. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  72. package/dist/esm/biz-components/ActiveShelf/index.js.map +3 -3
  73. package/dist/esm/biz-components/EventSchedule/index.d.ts +2 -7
  74. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  75. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  76. package/dist/esm/biz-components/FeaturedBlogPosts/index.d.ts +1 -6
  77. package/dist/esm/biz-components/FeaturedBlogPosts/index.js +1 -1
  78. package/dist/esm/biz-components/FeaturedBlogPosts/index.js.map +3 -3
  79. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  80. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  81. package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +2 -2
  82. package/dist/esm/biz-components/ImageOverlayShelf/index.js +1 -1
  83. package/dist/esm/biz-components/ImageOverlayShelf/index.js.map +3 -3
  84. package/dist/esm/biz-components/LotteryShared/BaseModal.d.ts +61 -0
  85. package/dist/esm/biz-components/LotteryShared/BaseModal.js +2 -0
  86. package/dist/esm/biz-components/LotteryShared/BaseModal.js.map +7 -0
  87. package/dist/esm/biz-components/LotteryShared/ChanceMethods.d.ts +25 -0
  88. package/dist/esm/biz-components/LotteryShared/ChanceMethods.js +2 -0
  89. package/dist/esm/biz-components/LotteryShared/ChanceMethods.js.map +7 -0
  90. package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +47 -0
  91. package/dist/esm/biz-components/LotteryShared/ErrorModal.js +2 -0
  92. package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +7 -0
  93. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +101 -0
  94. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +2 -0
  95. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +7 -0
  96. package/dist/esm/biz-components/LotteryShared/PrizePool.d.ts +29 -0
  97. package/dist/esm/biz-components/LotteryShared/PrizePool.js +2 -0
  98. package/dist/esm/biz-components/LotteryShared/PrizePool.js.map +7 -0
  99. package/dist/esm/biz-components/LotteryShared/RulesModal.d.ts +56 -0
  100. package/dist/esm/biz-components/LotteryShared/RulesModal.js +2 -0
  101. package/dist/esm/biz-components/LotteryShared/RulesModal.js.map +7 -0
  102. package/dist/esm/biz-components/LotteryShared/ShareModal.d.ts +79 -0
  103. package/dist/esm/biz-components/LotteryShared/ShareModal.js +2 -0
  104. package/dist/esm/biz-components/LotteryShared/ShareModal.js.map +7 -0
  105. package/dist/esm/biz-components/LotteryShared/WinnerModal.d.ts +27 -0
  106. package/dist/esm/biz-components/LotteryShared/WinnerModal.js +2 -0
  107. package/dist/esm/biz-components/LotteryShared/WinnerModal.js.map +7 -0
  108. package/dist/esm/biz-components/LotteryShared/index.d.ts +23 -0
  109. package/dist/esm/biz-components/LotteryShared/index.js +2 -0
  110. package/dist/esm/biz-components/LotteryShared/index.js.map +7 -0
  111. package/dist/esm/biz-components/LotteryShared/types.d.ts +760 -0
  112. package/dist/esm/biz-components/LotteryShared/types.js +2 -0
  113. package/dist/esm/biz-components/LotteryShared/types.js.map +7 -0
  114. package/dist/esm/biz-components/MediaEndorsement/index.js +2 -2
  115. package/dist/esm/biz-components/MediaEndorsement/index.js.map +3 -3
  116. package/dist/esm/biz-components/MediaShelf/index.d.ts +2 -2
  117. package/dist/esm/biz-components/MediaShelf/index.js +1 -1
  118. package/dist/esm/biz-components/MediaShelf/index.js.map +3 -3
  119. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.d.ts +4 -0
  120. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js +2 -0
  121. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js.map +7 -0
  122. package/dist/esm/biz-components/ProductLottery/index.d.ts +17 -0
  123. package/dist/esm/biz-components/ProductLottery/index.js +2 -0
  124. package/dist/esm/biz-components/ProductLottery/index.js.map +7 -0
  125. package/dist/esm/biz-components/ProductLottery/types.d.ts +363 -0
  126. package/dist/esm/biz-components/ProductLottery/types.js +2 -0
  127. package/dist/esm/biz-components/ProductLottery/types.js.map +7 -0
  128. package/dist/esm/biz-components/Specs/index.js +1 -1
  129. package/dist/esm/biz-components/Specs/index.js.map +3 -3
  130. package/dist/esm/biz-components/WheelLottery/index.d.ts +11 -11
  131. package/dist/esm/biz-components/WheelLottery/index.js +1 -1
  132. package/dist/esm/biz-components/WheelLottery/index.js.map +3 -3
  133. package/dist/esm/biz-components/WheelLottery/types.d.ts +17 -723
  134. package/dist/esm/biz-components/WheelLottery/types.js +1 -1
  135. package/dist/esm/biz-components/WheelLottery/types.js.map +3 -3
  136. package/dist/esm/biz-components/index.d.ts +2 -0
  137. package/dist/esm/biz-components/index.js +1 -1
  138. package/dist/esm/biz-components/index.js.map +2 -2
  139. package/package.json +1 -1
  140. package/style.css +77 -0
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as s,jsxs as h}from"react/jsx-runtime";import*as i from"react";import{cn as g}from"../../helpers/index.js";import{Text as D,Picture as R,Heading as z,Container as j}from"../../components/index.js";import{Swiper as F,SwiperSlide as L}from"swiper/react";import w from"dayjs";import{cva as b}from"class-variance-authority";const x=(r,t)=>{const d=w(),c=w(r).startOf("day"),u=w(t).endOf("day");return d.isAfter(u)?"completed":d.isBefore(c)?"not-started":"in-progress"},H=b("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),$=b("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),k=b("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),O=b("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),q=({timeStatus:r,theme:t="light",className:d,index:c,nodeLength:u})=>{const o=`${r}-${t}`,n=c===0,a=c===u-1;return h("div",{className:"relative my-2 flex h-1 w-full items-center justify-center",children:[s("div",{className:g(H({state:o}),n&&"rounded-l-full",a&&"rounded-r-full",d)}),s("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:s("div",{className:$({state:o})})})]})},G=(r,t)=>{if(r)return t==="in-progress"?r.active:t==="completed"&&r.completed||r.inactive},J=({timeStatus:r,item:t,theme:d="light",className:c,scheduleCount:u})=>{const o=i.useMemo(()=>G(t.icon,r),[t.icon,r]),n=`${r}-${d}`;return h("div",{className:g(O({state:n}),c),children:[o&&s("div",{className:"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]",children:s(R,{source:o.url,alt:o.alt,className:"aspect-square"})}),h("div",{className:"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8",children:[s(z,{html:t.title,className:g(u>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",k({state:n}))}),s("div",{className:"flex flex-col gap-0.5",children:t.items.map((a,l)=>h("div",{className:"flex items-center gap-2",children:[a.icon&&s(D,{className:g("desktop:size-6 size-5 shrink-0",k({state:n})),html:a.icon}),s(D,{html:a.label,className:g("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]",k({state:n}))})]},l))})]})]})},V=i.forwardRef(({classNames:r={},data:t,className:d,...c},u)=>{const o=t.theme||"light",n=i.useRef(null),a=i.useRef(null),l=i.useRef(!1),f=i.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),S=i.useMemo(()=>t.scheduleList.findIndex(e=>x(e.startDate,e.endDate)==="in-progress"),[t.scheduleList]),v=i.useCallback((e,m=!1)=>{const p=P=>{switch(P){case"mobile":return{slidesPerView:1.17};case"tablet":return e===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return e===2?{}:e===4?{slidesPerView:3.2}:{slidesPerView:e};case"desktop":return e===2?{slidesPerView:2}:{slidesPerView:e}}},T=p("mobile"),C=p("tablet"),N=p("laptop"),y=p("desktop");return m?{0:{...T,spaceBetween:12},768:{...C,spaceBetween:12},1024:{...N,spaceBetween:16},1440:{...y,spaceBetween:16}}:{0:T,768:C,1024:N,1440:y}},[]),A=i.useMemo(()=>v(f,!0),[f,v]),I=i.useMemo(()=>v(f,!1),[f,v]),E=t.showTimeline!==!1,M=i.useCallback(e=>{l.current||!a.current||(l.current=!0,a.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]),B=i.useCallback(e=>{l.current||!n.current||(l.current=!0,n.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]);return i.useEffect(()=>{n.current&&a.current&&S>=0&&setTimeout(()=>{l.current=!0,n.current?.slideTo(S,500),a.current?.slideTo(S,500),setTimeout(()=>{l.current=!1},600)},100)},[S]),h(j,{...c,ref:u,className:g("overflow-hidden",r?.root,d),children:[E&&s(F,{breakpoints:I,className:"h-4 w-full !overflow-visible",onSwiper:e=>{a.current=e},onSlideChange:B,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(L,{className:"",children:s(q,{className:r?.timeline,timeStatus:p,theme:o,index:m,nodeLength:t.scheduleList.length})},"timelineNode"+m)})}),s(F,{breakpoints:A,className:"w-full !overflow-visible",onSwiper:e=>{n.current=e},onSlideChange:M,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(L,{children:s(J,{timeStatus:p,className:g(E?"laptop:mt-4 mt-2":"",r?.eventScheduleCard),item:e,theme:o,scheduleCount:t.scheduleList.length})},"SwiperSlideItem"+m)})})]})});V.displayName="EventSchedule";var Y=V;export{Y as default};
1
+ "use client";import{jsx as s,jsxs as h}from"react/jsx-runtime";import*as i from"react";import{cn as g}from"../../helpers/index.js";import{withLayout as R}from"../../shared/Styles.js";import{Text as D,Picture as z,Heading as j,Container as H}from"../../components/index.js";import{Swiper as L,SwiperSlide as F}from"swiper/react";import w from"dayjs";import{cva as b}from"class-variance-authority";const x=(r,t)=>{const d=w(),c=w(r).startOf("day"),u=w(t).endOf("day");return d.isAfter(u)?"completed":d.isBefore(c)?"not-started":"in-progress"},$=b("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),O=b("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),k=b("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),q=b("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),G=({timeStatus:r,theme:t="light",className:d,index:c,nodeLength:u})=>{const o=`${r}-${t}`,n=c===0,a=c===u-1;return h("div",{className:"relative my-2 flex h-1 w-full items-center justify-center",children:[s("div",{className:g($({state:o}),n&&"rounded-l-full",a&&"rounded-r-full",d)}),s("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:s("div",{className:O({state:o})})})]})},J=(r,t)=>{if(r)return t==="in-progress"?r.active:t==="completed"&&r.completed||r.inactive},K=({timeStatus:r,item:t,theme:d="light",className:c,scheduleCount:u})=>{const o=i.useMemo(()=>J(t.icon,r),[t.icon,r]),n=`${r}-${d}`;return h("div",{className:g(q({state:n}),c),children:[o&&s("div",{className:"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]",children:s(z,{source:o.url,alt:o.alt,className:"aspect-square"})}),h("div",{className:"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8",children:[s(j,{html:t.title,className:g(u>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",k({state:n}))}),s("div",{className:"flex flex-col gap-0.5",children:t.items.map((a,l)=>h("div",{className:"flex items-center gap-2",children:[a.icon&&s(D,{className:g("desktop:size-6 size-5 shrink-0",k({state:n})),html:a.icon}),s(D,{html:a.label,className:g("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]",k({state:n}))})]},l))})]})]})},V=i.forwardRef(({classNames:r={},data:t,className:d,...c},u)=>{const o=t.theme||"light",n=i.useRef(null),a=i.useRef(null),l=i.useRef(!1),f=i.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),S=i.useMemo(()=>t.scheduleList.findIndex(e=>x(e.startDate,e.endDate)==="in-progress"),[t.scheduleList]),v=i.useCallback((e,m=!1)=>{const p=P=>{switch(P){case"mobile":return{slidesPerView:1.17};case"tablet":return e===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return e===2?{}:e===4?{slidesPerView:3.2}:{slidesPerView:e};case"desktop":return e===2?{slidesPerView:2}:{slidesPerView:e}}},T=p("mobile"),C=p("tablet"),N=p("laptop"),y=p("desktop");return m?{0:{...T,spaceBetween:12},768:{...C,spaceBetween:12},1024:{...N,spaceBetween:16},1440:{...y,spaceBetween:16}}:{0:T,768:C,1024:N,1440:y}},[]),A=i.useMemo(()=>v(f,!0),[f,v]),I=i.useMemo(()=>v(f,!1),[f,v]),E=t.showTimeline!==!1,M=i.useCallback(e=>{l.current||!a.current||(l.current=!0,a.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]),B=i.useCallback(e=>{l.current||!n.current||(l.current=!0,n.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]);return i.useEffect(()=>{n.current&&a.current&&S>=0&&setTimeout(()=>{l.current=!0,n.current?.slideTo(S,500),a.current?.slideTo(S,500),setTimeout(()=>{l.current=!1},600)},100)},[S]),h(H,{...c,ref:u,className:g("overflow-hidden",r?.root,d),children:[E&&s(L,{breakpoints:I,className:"h-4 w-full !overflow-visible",onSwiper:e=>{a.current=e},onSlideChange:B,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(F,{className:"",children:s(G,{className:r?.timeline,timeStatus:p,theme:o,index:m,nodeLength:t.scheduleList.length})},"timelineNode"+m)})}),s(L,{breakpoints:A,className:"w-full !overflow-visible",onSwiper:e=>{n.current=e},onSlideChange:M,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(F,{children:s(K,{timeStatus:p,className:g(E?"laptop:mt-4 mt-2":"",r?.eventScheduleCard),item:e,theme:o,scheduleCount:t.scheduleList.length})},"SwiperSlideItem"+m)})})]})});V.displayName="EventSchedule";var _=R(V);export{_ as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/EventSchedule/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Heading, Container } from '../../components/index.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport type { Swiper as SwiperType } from 'swiper'\nimport dayjs from 'dayjs'\nimport { cva } from 'class-variance-authority'\nimport type { Media } from '../../types/props.js'\nexport type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard'\n\n/**\n * \u65F6\u95F4\u72B6\u6001\u7C7B\u578B\n */\nexport type TimeStatus = 'completed' | 'in-progress' | 'not-started'\n\n/**\n * \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n */\nexport interface StateIcon {\n /** \u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807\uFF08\u8FDB\u884C\u4E2D\uFF09 */\n active: Media\n /** \u975E\u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807\uFF08\u672A\u5F00\u59CB\uFF09 */\n inactive: Media\n /** \u5DF2\u5B8C\u6210\u72B6\u6001\u7684\u56FE\u6807\uFF08\u53EF\u9009\uFF0C\u4E0D\u63D0\u4F9B\u5219\u4F7F\u7528 inactive\uFF09 */\n completed?: Media\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleItem {\n /** \u6807\u9898 */\n title: string\n /** \u5F00\u59CB\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-01'\uFF09 */\n startDate: string\n /** \u7ED3\u675F\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-31'\uFF09 */\n endDate: string\n /**\n * \u5361\u7247\u80CC\u666F\u56FE\u6807\u914D\u7F6E\uFF0C\u72B6\u6001\u5316\u56FE\u6807\uFF08\u5FC5\u987B\u5305\u542B active \u548C inactive\uFF09\n *\n * @example\n * icon: {\n * active: { url: \"https://example.com/active-icon.svg\", alt: \"Active Icon\" },\n * inactive: { url: \"https://example.com/inactive-icon.svg\", alt: \"Inactive Icon\" }\n * }\n */\n icon?: StateIcon\n /** \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */\n items: {\n /** \u56FE\u6807 (SVG \u5B57\u7B26\u4E32\u6216 URL) */\n icon?: string\n /** \u6587\u672C\u5185\u5BB9 */\n label: string\n }[]\n}\n\n/**\n * EventSchedule \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleData {\n /** \u65E5\u7A0B\u5217\u8868 */\n scheduleList: EventScheduleItem[]\n /** \u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true */\n showTimeline?: boolean\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n}\n\nexport interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: EventScheduleData\n classNames?: Partial<Record<EventScheduleSemanticName, string>>\n}\n\n/**\n * \u83B7\u53D6\u65F6\u95F4\u72B6\u6001\n * @param startDate \u5F00\u59CB\u65E5\u671F\n * @param endDate \u7ED3\u675F\u65E5\u671F\n * @returns \u65F6\u95F4\u72B6\u6001\uFF1Acompleted\uFF08\u5DF2\u5B8C\u6210\uFF09\u3001in-progress\uFF08\u8FDB\u884C\u4E2D\uFF09\u3001not-started\uFF08\u672A\u5F00\u59CB\uFF09\n */\nconst getTimeStatus = (startDate: string, endDate: string): TimeStatus => {\n const now = dayjs()\n const start = dayjs(startDate).startOf('day')\n const end = dayjs(endDate).endOf('day')\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E - \u5DF2\u5B8C\u6210\n if (now.isAfter(end)) {\n return 'completed'\n }\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u5F00\u59CB\u65F6\u95F4\u4E4B\u524D - \u672A\u5F00\u59CB\n if (now.isBefore(start)) {\n return 'not-started'\n }\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u5F00\u59CB\u548C\u7ED3\u675F\u4E4B\u95F4 - \u8FDB\u884C\u4E2D\n return 'in-progress'\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8FDB\u5EA6\u6761\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst timelineProgressActiveVariants = cva('h-1 w-full overflow-hidden', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F6CD4E]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\n 'completed-light': 'bg-[#F6CD4E]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst timelineNodeActiveVariants = cva('size-4 rounded-full transition-colors', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F6CD4E]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\uFF08\u4E0E\u8FDB\u884C\u4E2D\u989C\u8272\u4E00\u81F4\uFF09\n 'completed-light': 'bg-[#F6CD4E]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u5361\u7247\u6587\u672C\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst cardTextVariants = cva('font-bold leading-[1.2]', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\uFF08\u4FDD\u6301\u539F\u6709\u989C\u8272\uFF09\n 'in-progress-light': 'text-[#080A0F]',\n 'in-progress-dark': 'text-white',\n // \u672A\u5F00\u59CB\uFF0860% \u900F\u660E\u5EA6\uFF09\n 'not-started-light': 'text-[#080A0F]',\n 'not-started-dark': 'text-[#F5F6F7]',\n // \u5DF2\u5B8C\u6210\uFF0860% \u900F\u660E\u5EA6\uFF09\n 'completed-light': 'text-[#4A4C56]/60',\n 'completed-dark': 'text-[#F5F6F7]/60',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u5361\u7247\u5BB9\u5668\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst eventScheduleCardVariants = cva(\n 'laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden',\n {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F4E8BC]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\n 'completed-light': 'bg-[#F4E8BC]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n }\n)\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6 Props\n */\ninterface TimelineNodeProps {\n /** \u65F6\u95F4\u72B6\u6001 */\n timeStatus: TimeStatus\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n /** \u5F53\u524D\u8282\u70B9\u7D22\u5F15 */\n index: number\n /** \u8282\u70B9\u603B\u6570 */\n nodeLength: number\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6\n */\nconst TimelineNode = ({ timeStatus, theme = 'light', className, index, nodeLength }: TimelineNodeProps) => {\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const state = `${timeStatus}-${theme}` as\n | 'in-progress-light'\n | 'in-progress-dark'\n | 'not-started-light'\n | 'not-started-dark'\n | 'completed-light'\n | 'completed-dark'\n\n // \u5224\u65AD\u9996\u5C3E\u4F4D\u7F6E\n const isFirst = index === 0\n const isLast = index === nodeLength - 1\n\n return (\n <div className=\"relative my-2 flex h-1 w-full items-center justify-center\">\n {/* \u8FDB\u5EA6\u6761\u80CC\u666F */}\n <div\n className={cn(\n timelineProgressActiveVariants({ state }),\n isFirst && 'rounded-l-full',\n isLast && 'rounded-r-full',\n className\n )}\n />\n {/* \u65F6\u95F4\u8282\u70B9\u5706\u70B9 */}\n <div className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2\">\n <div className={timelineNodeActiveVariants({ state })} />\n </div>\n </div>\n )\n}\n\n/**\n * \u6839\u636E\u65F6\u95F4\u72B6\u6001\u83B7\u53D6\u5BF9\u5E94\u7684\u56FE\u6807\n * @param icon \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n * @param timeStatus \u65F6\u95F4\u72B6\u6001\n * @returns \u56FE\u6807 Media \u5BF9\u8C61\n */\nconst getIconByTimeStatus = (icon: StateIcon | undefined, timeStatus: TimeStatus): Media | undefined => {\n if (!icon) return undefined\n // \u8FDB\u884C\u4E2D\u4F7F\u7528 active \u56FE\u6807\n if (timeStatus === 'in-progress') return icon.active\n // \u5DF2\u5B8C\u6210\u4F7F\u7528 completed \u56FE\u6807\uFF08\u5982\u679C\u6709\uFF09\uFF0C\u5426\u5219\u4F7F\u7528 inactive\n if (timeStatus === 'completed') return icon.completed || icon.inactive\n // \u672A\u5F00\u59CB\u4F7F\u7528 inactive \u56FE\u6807\n return icon.inactive\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u5361\u7247\u7EC4\u4EF6\n */\nconst EventScheduleCard = ({\n timeStatus,\n item,\n theme = 'light',\n className,\n scheduleCount,\n}: {\n timeStatus: TimeStatus\n item: EventScheduleItem\n theme?: 'light' | 'dark'\n className?: string\n scheduleCount: number\n}) => {\n const currentIcon = React.useMemo(() => {\n return getIconByTimeStatus(item.icon, timeStatus)\n }, [item.icon, timeStatus])\n\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const cardState = `${timeStatus}-${theme}` as\n | 'in-progress-light'\n | 'in-progress-dark'\n | 'not-started-light'\n | 'not-started-dark'\n | 'completed-light'\n | 'completed-dark'\n\n return (\n <div className={cn(eventScheduleCardVariants({ state: cardState }), className)}>\n {/* \u80CC\u666F\u56FE\u6807 */}\n {currentIcon && (\n <div className=\"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]\">\n <Picture source={currentIcon.url} alt={currentIcon.alt} className=\"aspect-square\" />\n </div>\n )}\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8\">\n <Heading\n html={item.title}\n className={cn(\n scheduleCount >= 4 ? 'desktop:text-[24px]' : 'desktop:text-[32px]',\n 'laptop:text-[24px] line-clamp-1 text-[20px]',\n cardTextVariants({ state: cardState })\n )}\n />\n {/* \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */}\n <div className=\"flex flex-col gap-0.5\">\n {item.items.map((detail, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n {/* \u56FE\u6807 */}\n {detail.icon && (\n <Text\n className={cn('desktop:size-6 size-5 shrink-0', cardTextVariants({ state: cardState }))}\n html={detail.icon}\n />\n )}\n {/* \u6587\u672C */}\n <Text\n html={detail.label}\n className={cn(\n 'lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]',\n cardTextVariants({ state: cardState })\n )}\n />\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * EventSchedule - \u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6\n *\n * @description \u663E\u793A\u6D3B\u52A8\u65E5\u7A0B\u65F6\u95F4\u8F74\u548C\u6D3B\u52A8\u5361\u7247\u5217\u8868\n */\nconst EventSchedule = React.forwardRef<HTMLDivElement, EventScheduleProps>(\n ({ classNames = {}, data, className, ...rest }, ref) => {\n const theme = data.theme || 'light'\n const swiperRef = React.useRef<SwiperType | null>(null)\n const timelineSwiperRef = React.useRef<SwiperType | null>(null)\n const isSyncingRef = React.useRef(false) // \u9632\u6B62\u5FAA\u73AF\u89E6\u53D1\n const itemsPerRow = React.useMemo(() => {\n return data?.scheduleList?.length || 2\n }, [data?.scheduleList])\n\n // \u8BA1\u7B97\u8FDB\u884C\u4E2D item \u7684\u7D22\u5F15\uFF08\u7528\u4E8E\u81EA\u52A8\u6EDA\u52A8\uFF09\n const activeIndex = React.useMemo(() => {\n return data.scheduleList.findIndex(item => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return timeStatus === 'in-progress'\n })\n }, [data.scheduleList])\n\n /**\n * \u751F\u6210\u7EDF\u4E00\u7684 Swiper \u65AD\u70B9\u914D\u7F6E\n * @param itemsPerRow \u6BCF\u884C\u663E\u793A\u7684\u9879\u76EE\u6570\n * @param withSpaceBetween \u662F\u5426\u5305\u542B\u95F4\u8DDD\u914D\u7F6E\n * @returns Swiper \u65AD\u70B9\u914D\u7F6E\u5BF9\u8C61\n */\n const generateSwiperBreakpoints = React.useCallback((itemsPerRow: number, withSpaceBetween: boolean = false) => {\n // \u6839\u636E itemsPerRow \u786E\u5B9A\u4E0D\u540C\u65AD\u70B9\u4E0B\u7684 slidesPerView\n const getBreakpointConfig = (breakpoint: 'mobile' | 'tablet' | 'laptop' | 'desktop') => {\n switch (breakpoint) {\n case 'mobile':\n return { slidesPerView: 1.17 }\n case 'tablet':\n if (itemsPerRow === 2) return { slidesPerView: 2 }\n return { slidesPerView: 2.4 }\n case 'laptop':\n if (itemsPerRow === 2) return {}\n if (itemsPerRow === 4) return { slidesPerView: 3.2 }\n return { slidesPerView: itemsPerRow }\n case 'desktop':\n if (itemsPerRow === 2) return { slidesPerView: 2 }\n return { slidesPerView: itemsPerRow }\n }\n }\n\n const mobileConfig = getBreakpointConfig('mobile')\n const tabletConfig = getBreakpointConfig('tablet')\n const laptopConfig = getBreakpointConfig('laptop')\n const desktopConfig = getBreakpointConfig('desktop')\n\n // \u5982\u679C\u9700\u8981 spaceBetween\uFF0C\u5219\u6DFB\u52A0\u5230\u914D\u7F6E\u4E2D\n if (withSpaceBetween) {\n return {\n 0: { ...mobileConfig, spaceBetween: 12 },\n 768: { ...tabletConfig, spaceBetween: 12 },\n 1024: { ...laptopConfig, spaceBetween: 16 },\n 1440: { ...desktopConfig, spaceBetween: 16 },\n }\n }\n\n return {\n 0: mobileConfig,\n 768: tabletConfig,\n 1024: laptopConfig,\n 1440: desktopConfig,\n }\n }, [])\n\n // \u6839\u636E itemsPerRow \u914D\u7F6E\u54CD\u5E94\u5F0F\u65AD\u70B9\uFF08\u5361\u7247 Swiper - \u5305\u542B\u95F4\u8DDD\uFF09\n const swiperBreakpoints = React.useMemo(() => {\n return generateSwiperBreakpoints(itemsPerRow, true)\n }, [itemsPerRow, generateSwiperBreakpoints])\n\n // \u65F6\u95F4\u8F74 Swiper \u65AD\u70B9\u914D\u7F6E\uFF08\u4E0D\u5305\u542B\u95F4\u8DDD\uFF09\n const timeNodeSwiperBreakpoints = React.useMemo(() => {\n return generateSwiperBreakpoints(itemsPerRow, false)\n }, [itemsPerRow, generateSwiperBreakpoints])\n\n const showTimeline = data.showTimeline !== false // \u9ED8\u8BA4\u4E3A true\n\n // \u540C\u6B65\u4E24\u4E2A Swiper \u7684\u6ED1\u52A8\n const handleCardSwiperSlideChange = React.useCallback((swiper: SwiperType) => {\n if (isSyncingRef.current || !timelineSwiperRef.current) return\n isSyncingRef.current = true\n timelineSwiperRef.current.slideTo(swiper.activeIndex, swiper.params.speed)\n // \u5EF6\u8FDF\u91CD\u7F6E\u6807\u5FD7\uFF0C\u786E\u4FDD\u540C\u6B65\u5B8C\u6210\n setTimeout(() => {\n isSyncingRef.current = false\n }, 50)\n }, [])\n\n const handleTimelineSwiperSlideChange = React.useCallback((swiper: SwiperType) => {\n if (isSyncingRef.current || !swiperRef.current) return\n isSyncingRef.current = true\n swiperRef.current.slideTo(swiper.activeIndex, swiper.params.speed)\n // \u5EF6\u8FDF\u91CD\u7F6E\u6807\u5FD7\uFF0C\u786E\u4FDD\u540C\u6B65\u5B8C\u6210\n setTimeout(() => {\n isSyncingRef.current = false\n }, 50)\n }, [])\n\n // \u81EA\u52A8\u6EDA\u52A8\u5230 active item\n React.useEffect(() => {\n if (swiperRef.current && timelineSwiperRef.current && activeIndex >= 0) {\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u786E\u4FDD Swiper \u5DF2\u7ECF\u5B8C\u5168\u521D\u59CB\u5316\n setTimeout(() => {\n isSyncingRef.current = true\n swiperRef.current?.slideTo(activeIndex, 500)\n timelineSwiperRef.current?.slideTo(activeIndex, 500)\n setTimeout(() => {\n isSyncingRef.current = false\n }, 600)\n }, 100)\n }\n }, [activeIndex])\n\n return (\n <Container {...rest} ref={ref} className={cn('overflow-hidden', classNames?.root, className)}>\n {showTimeline && (\n <Swiper\n breakpoints={timeNodeSwiperBreakpoints}\n className=\"h-4 w-full !overflow-visible\"\n onSwiper={swiper => {\n timelineSwiperRef.current = swiper\n }}\n onSlideChange={handleTimelineSwiperSlideChange}\n >\n {data.scheduleList.map((item, index) => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return (\n <SwiperSlide key={'timelineNode' + index} className=\"\">\n <TimelineNode\n className={classNames?.timeline}\n timeStatus={timeStatus}\n theme={theme}\n index={index}\n nodeLength={data.scheduleList.length}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n )}\n <Swiper\n breakpoints={swiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={swiper => {\n swiperRef.current = swiper\n }}\n onSlideChange={handleCardSwiperSlideChange}\n >\n {data.scheduleList.map((item, index) => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return (\n <SwiperSlide key={'SwiperSlideItem' + index}>\n <EventScheduleCard\n timeStatus={timeStatus}\n className={cn(showTimeline ? 'laptop:mt-4 mt-2' : '', classNames?.eventScheduleCard)}\n item={item}\n theme={theme}\n scheduleCount={data.scheduleList.length}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n </Container>\n )\n }\n)\n\nEventSchedule.displayName = 'EventSchedule'\nexport default EventSchedule\n\n// \u5BFC\u51FA\u7C7B\u578B\u4F9B\u5916\u90E8\u4F7F\u7528\n// export type { StateIcon, EventScheduleItem, EventScheduleData, EventScheduleProps }\n"],
5
- "mappings": "aAkOI,OAEE,OAAAA,EAFF,QAAAC,MAAA,oBAhOJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,QAAAC,EAAM,WAAAC,EAAS,WAAAC,EAAS,aAAAC,MAAiB,4BAClD,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eAEpC,OAAOC,MAAW,QAClB,OAAS,OAAAC,MAAW,2BA0EpB,MAAMC,EAAgB,CAACC,EAAmBC,IAAgC,CACxE,MAAMC,EAAML,EAAM,EACZM,EAAQN,EAAMG,CAAS,EAAE,QAAQ,KAAK,EACtCI,EAAMP,EAAMI,CAAO,EAAE,MAAM,KAAK,EAGtC,OAAIC,EAAI,QAAQE,CAAG,EACV,YAILF,EAAI,SAASC,CAAK,EACb,cAIF,aACT,EAKME,EAAiCP,EAAI,6BAA8B,CACvE,SAAU,CACR,MAAO,CAEL,oBAAqB,eACrB,mBAAoB,eAEpB,oBAAqB,eACrB,mBAAoB,eAEpB,kBAAmB,eACnB,iBAAkB,cACpB,CACF,EACA,gBAAiB,CACf,MAAO,mBACT,CACF,CAAC,EAKKQ,EAA6BR,EAAI,wCAAyC,CAC9E,SAAU,CACR,MAAO,CAEL,oBAAqB,eACrB,mBAAoB,eAEpB,oBAAqB,eACrB,mBAAoB,eAE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,EAAA,CACC,YAAaiD,EACb,UAAU,2BACV,SAAUI,GAAU,CAClBjB,EAAU,QAAUiB,CACtB,EACA,cAAeD,EAEd,SAAAnB,EAAK,aAAa,IAAI,CAACP,EAAMR,IAAU,CACtC,MAAMH,EAAaX,EAAcsB,EAAK,UAAWA,EAAK,OAAO,EAC7D,OACElC,EAACS,EAAA,CACC,SAAAT,EAACiC,EAAA,CACC,WAAYV,EACZ,UAAWpB,EAAGwD,EAAe,mBAAqB,GAAInB,GAAY,iBAAiB,EACnF,KAAMN,EACN,MAAOV,EACP,cAAeiB,EAAK,aAAa,OACnC,GAPgB,kBAAoBf,CAQtC,CAEJ,CAAC,EACH,GACF,CAEJ,CACF,EAEAa,EAAc,YAAc,gBAC5B,IAAOwB,EAAQxB",
6
- "names": ["jsx", "jsxs", "React", "cn", "Text", "Picture", "Heading", "Container", "Swiper", "SwiperSlide", "dayjs", "cva", "getTimeStatus", "startDate", "endDate", "now", "start", "end", "timelineProgressActiveVariants", "timelineNodeActiveVariants", "cardTextVariants", "eventScheduleCardVariants", "TimelineNode", "timeStatus", "theme", "className", "index", "nodeLength", "state", "isFirst", "isLast", "getIconByTimeStatus", "icon", "EventScheduleCard", "item", "scheduleCount", "currentIcon", "cardState", "detail", "EventSchedule", "classNames", "data", "rest", "ref", "swiperRef", "timelineSwiperRef", "isSyncingRef", "itemsPerRow", "activeIndex", "generateSwiperBreakpoints", "withSpaceBetween", "getBreakpointConfig", "breakpoint", "mobileConfig", "tabletConfig", "laptopConfig", "desktopConfig", "swiperBreakpoints", "timeNodeSwiperBreakpoints", "showTimeline", "handleCardSwiperSlideChange", "swiper", "handleTimelineSwiperSlideChange", "EventSchedule_default"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Text, Picture, Heading, Container } from '../../components/index.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport type { Swiper as SwiperType } from 'swiper'\nimport dayjs from 'dayjs'\nimport { cva } from 'class-variance-authority'\nimport type { Media } from '../../types/props.js'\nexport type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard'\n\n/**\n * \u65F6\u95F4\u72B6\u6001\u7C7B\u578B\n */\nexport type TimeStatus = 'completed' | 'in-progress' | 'not-started'\n\n/**\n * \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n */\nexport interface StateIcon {\n /** \u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807\uFF08\u8FDB\u884C\u4E2D\uFF09 */\n active: Media\n /** \u975E\u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807\uFF08\u672A\u5F00\u59CB\uFF09 */\n inactive: Media\n /** \u5DF2\u5B8C\u6210\u72B6\u6001\u7684\u56FE\u6807\uFF08\u53EF\u9009\uFF0C\u4E0D\u63D0\u4F9B\u5219\u4F7F\u7528 inactive\uFF09 */\n completed?: Media\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleItem {\n /** \u6807\u9898 */\n title: string\n /** \u5F00\u59CB\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-01'\uFF09 */\n startDate: string\n /** \u7ED3\u675F\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-31'\uFF09 */\n endDate: string\n /**\n * \u5361\u7247\u80CC\u666F\u56FE\u6807\u914D\u7F6E\uFF0C\u72B6\u6001\u5316\u56FE\u6807\uFF08\u5FC5\u987B\u5305\u542B active \u548C inactive\uFF09\n *\n * @example\n * icon: {\n * active: { url: \"https://example.com/active-icon.svg\", alt: \"Active Icon\" },\n * inactive: { url: \"https://example.com/inactive-icon.svg\", alt: \"Inactive Icon\" }\n * }\n */\n icon?: StateIcon\n /** \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */\n items: {\n /** \u56FE\u6807 (SVG \u5B57\u7B26\u4E32\u6216 URL) */\n icon?: string\n /** \u6587\u672C\u5185\u5BB9 */\n label: string\n }[]\n}\n\n/**\n * EventSchedule \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleData {\n /** \u65E5\u7A0B\u5217\u8868 */\n scheduleList: EventScheduleItem[]\n /** \u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true */\n showTimeline?: boolean\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n}\n\nexport interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: EventScheduleData\n classNames?: Partial<Record<EventScheduleSemanticName, string>>\n}\n\n/**\n * \u83B7\u53D6\u65F6\u95F4\u72B6\u6001\n * @param startDate \u5F00\u59CB\u65E5\u671F\n * @param endDate \u7ED3\u675F\u65E5\u671F\n * @returns \u65F6\u95F4\u72B6\u6001\uFF1Acompleted\uFF08\u5DF2\u5B8C\u6210\uFF09\u3001in-progress\uFF08\u8FDB\u884C\u4E2D\uFF09\u3001not-started\uFF08\u672A\u5F00\u59CB\uFF09\n */\nconst getTimeStatus = (startDate: string, endDate: string): TimeStatus => {\n const now = dayjs()\n const start = dayjs(startDate).startOf('day')\n const end = dayjs(endDate).endOf('day')\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E - \u5DF2\u5B8C\u6210\n if (now.isAfter(end)) {\n return 'completed'\n }\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u5F00\u59CB\u65F6\u95F4\u4E4B\u524D - \u672A\u5F00\u59CB\n if (now.isBefore(start)) {\n return 'not-started'\n }\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u5F00\u59CB\u548C\u7ED3\u675F\u4E4B\u95F4 - \u8FDB\u884C\u4E2D\n return 'in-progress'\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8FDB\u5EA6\u6761\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst timelineProgressActiveVariants = cva('h-1 w-full overflow-hidden', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F6CD4E]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\n 'completed-light': 'bg-[#F6CD4E]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst timelineNodeActiveVariants = cva('size-4 rounded-full transition-colors', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F6CD4E]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\uFF08\u4E0E\u8FDB\u884C\u4E2D\u989C\u8272\u4E00\u81F4\uFF09\n 'completed-light': 'bg-[#F6CD4E]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u5361\u7247\u6587\u672C\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst cardTextVariants = cva('font-bold leading-[1.2]', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\uFF08\u4FDD\u6301\u539F\u6709\u989C\u8272\uFF09\n 'in-progress-light': 'text-[#080A0F]',\n 'in-progress-dark': 'text-white',\n // \u672A\u5F00\u59CB\uFF0860% \u900F\u660E\u5EA6\uFF09\n 'not-started-light': 'text-[#080A0F]',\n 'not-started-dark': 'text-[#F5F6F7]',\n // \u5DF2\u5B8C\u6210\uFF0860% \u900F\u660E\u5EA6\uFF09\n 'completed-light': 'text-[#4A4C56]/60',\n 'completed-dark': 'text-[#F5F6F7]/60',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u5361\u7247\u5BB9\u5668\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst eventScheduleCardVariants = cva(\n 'laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden',\n {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F4E8BC]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\n 'completed-light': 'bg-[#F4E8BC]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n }\n)\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6 Props\n */\ninterface TimelineNodeProps {\n /** \u65F6\u95F4\u72B6\u6001 */\n timeStatus: TimeStatus\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n /** \u5F53\u524D\u8282\u70B9\u7D22\u5F15 */\n index: number\n /** \u8282\u70B9\u603B\u6570 */\n nodeLength: number\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6\n */\nconst TimelineNode = ({ timeStatus, theme = 'light', className, index, nodeLength }: TimelineNodeProps) => {\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const state = `${timeStatus}-${theme}` as\n | 'in-progress-light'\n | 'in-progress-dark'\n | 'not-started-light'\n | 'not-started-dark'\n | 'completed-light'\n | 'completed-dark'\n\n // \u5224\u65AD\u9996\u5C3E\u4F4D\u7F6E\n const isFirst = index === 0\n const isLast = index === nodeLength - 1\n\n return (\n <div className=\"relative my-2 flex h-1 w-full items-center justify-center\">\n {/* \u8FDB\u5EA6\u6761\u80CC\u666F */}\n <div\n className={cn(\n timelineProgressActiveVariants({ state }),\n isFirst && 'rounded-l-full',\n isLast && 'rounded-r-full',\n className\n )}\n />\n {/* \u65F6\u95F4\u8282\u70B9\u5706\u70B9 */}\n <div className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2\">\n <div className={timelineNodeActiveVariants({ state })} />\n </div>\n </div>\n )\n}\n\n/**\n * \u6839\u636E\u65F6\u95F4\u72B6\u6001\u83B7\u53D6\u5BF9\u5E94\u7684\u56FE\u6807\n * @param icon \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n * @param timeStatus \u65F6\u95F4\u72B6\u6001\n * @returns \u56FE\u6807 Media \u5BF9\u8C61\n */\nconst getIconByTimeStatus = (icon: StateIcon | undefined, timeStatus: TimeStatus): Media | undefined => {\n if (!icon) return undefined\n // \u8FDB\u884C\u4E2D\u4F7F\u7528 active \u56FE\u6807\n if (timeStatus === 'in-progress') return icon.active\n // \u5DF2\u5B8C\u6210\u4F7F\u7528 completed \u56FE\u6807\uFF08\u5982\u679C\u6709\uFF09\uFF0C\u5426\u5219\u4F7F\u7528 inactive\n if (timeStatus === 'completed') return icon.completed || icon.inactive\n // \u672A\u5F00\u59CB\u4F7F\u7528 inactive \u56FE\u6807\n return icon.inactive\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u5361\u7247\u7EC4\u4EF6\n */\nconst EventScheduleCard = ({\n timeStatus,\n item,\n theme = 'light',\n className,\n scheduleCount,\n}: {\n timeStatus: TimeStatus\n item: EventScheduleItem\n theme?: 'light' | 'dark'\n className?: string\n scheduleCount: number\n}) => {\n const currentIcon = React.useMemo(() => {\n return getIconByTimeStatus(item.icon, timeStatus)\n }, [item.icon, timeStatus])\n\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const cardState = `${timeStatus}-${theme}` as\n | 'in-progress-light'\n | 'in-progress-dark'\n | 'not-started-light'\n | 'not-started-dark'\n | 'completed-light'\n | 'completed-dark'\n\n return (\n <div className={cn(eventScheduleCardVariants({ state: cardState }), className)}>\n {/* \u80CC\u666F\u56FE\u6807 */}\n {currentIcon && (\n <div className=\"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]\">\n <Picture source={currentIcon.url} alt={currentIcon.alt} className=\"aspect-square\" />\n </div>\n )}\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8\">\n <Heading\n html={item.title}\n className={cn(\n scheduleCount >= 4 ? 'desktop:text-[24px]' : 'desktop:text-[32px]',\n 'laptop:text-[24px] line-clamp-1 text-[20px]',\n cardTextVariants({ state: cardState })\n )}\n />\n {/* \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */}\n <div className=\"flex flex-col gap-0.5\">\n {item.items.map((detail, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n {/* \u56FE\u6807 */}\n {detail.icon && (\n <Text\n className={cn('desktop:size-6 size-5 shrink-0', cardTextVariants({ state: cardState }))}\n html={detail.icon}\n />\n )}\n {/* \u6587\u672C */}\n <Text\n html={detail.label}\n className={cn(\n 'lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]',\n cardTextVariants({ state: cardState })\n )}\n />\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * EventSchedule - \u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6\n *\n * @description \u663E\u793A\u6D3B\u52A8\u65E5\u7A0B\u65F6\u95F4\u8F74\u548C\u6D3B\u52A8\u5361\u7247\u5217\u8868\n */\nconst EventSchedule = React.forwardRef<HTMLDivElement, EventScheduleProps>(\n ({ classNames = {}, data, className, ...rest }, ref) => {\n const theme = data.theme || 'light'\n const swiperRef = React.useRef<SwiperType | null>(null)\n const timelineSwiperRef = React.useRef<SwiperType | null>(null)\n const isSyncingRef = React.useRef(false) // \u9632\u6B62\u5FAA\u73AF\u89E6\u53D1\n const itemsPerRow = React.useMemo(() => {\n return data?.scheduleList?.length || 2\n }, [data?.scheduleList])\n\n // \u8BA1\u7B97\u8FDB\u884C\u4E2D item \u7684\u7D22\u5F15\uFF08\u7528\u4E8E\u81EA\u52A8\u6EDA\u52A8\uFF09\n const activeIndex = React.useMemo(() => {\n return data.scheduleList.findIndex(item => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return timeStatus === 'in-progress'\n })\n }, [data.scheduleList])\n\n /**\n * \u751F\u6210\u7EDF\u4E00\u7684 Swiper \u65AD\u70B9\u914D\u7F6E\n * @param itemsPerRow \u6BCF\u884C\u663E\u793A\u7684\u9879\u76EE\u6570\n * @param withSpaceBetween \u662F\u5426\u5305\u542B\u95F4\u8DDD\u914D\u7F6E\n * @returns Swiper \u65AD\u70B9\u914D\u7F6E\u5BF9\u8C61\n */\n const generateSwiperBreakpoints = React.useCallback((itemsPerRow: number, withSpaceBetween: boolean = false) => {\n // \u6839\u636E itemsPerRow \u786E\u5B9A\u4E0D\u540C\u65AD\u70B9\u4E0B\u7684 slidesPerView\n const getBreakpointConfig = (breakpoint: 'mobile' | 'tablet' | 'laptop' | 'desktop') => {\n switch (breakpoint) {\n case 'mobile':\n return { slidesPerView: 1.17 }\n case 'tablet':\n if (itemsPerRow === 2) return { slidesPerView: 2 }\n return { slidesPerView: 2.4 }\n case 'laptop':\n if (itemsPerRow === 2) return {}\n if (itemsPerRow === 4) return { slidesPerView: 3.2 }\n return { slidesPerView: itemsPerRow }\n case 'desktop':\n if (itemsPerRow === 2) return { slidesPerView: 2 }\n return { slidesPerView: itemsPerRow }\n }\n }\n\n const mobileConfig = getBreakpointConfig('mobile')\n const tabletConfig = getBreakpointConfig('tablet')\n const laptopConfig = getBreakpointConfig('laptop')\n const desktopConfig = getBreakpointConfig('desktop')\n\n // \u5982\u679C\u9700\u8981 spaceBetween\uFF0C\u5219\u6DFB\u52A0\u5230\u914D\u7F6E\u4E2D\n if (withSpaceBetween) {\n return {\n 0: { ...mobileConfig, spaceBetween: 12 },\n 768: { ...tabletConfig, spaceBetween: 12 },\n 1024: { ...laptopConfig, spaceBetween: 16 },\n 1440: { ...desktopConfig, spaceBetween: 16 },\n }\n }\n\n return {\n 0: mobileConfig,\n 768: tabletConfig,\n 1024: laptopConfig,\n 1440: desktopConfig,\n }\n }, [])\n\n // \u6839\u636E itemsPerRow \u914D\u7F6E\u54CD\u5E94\u5F0F\u65AD\u70B9\uFF08\u5361\u7247 Swiper - \u5305\u542B\u95F4\u8DDD\uFF09\n const swiperBreakpoints = React.useMemo(() => {\n return generateSwiperBreakpoints(itemsPerRow, true)\n }, [itemsPerRow, generateSwiperBreakpoints])\n\n // \u65F6\u95F4\u8F74 Swiper \u65AD\u70B9\u914D\u7F6E\uFF08\u4E0D\u5305\u542B\u95F4\u8DDD\uFF09\n const timeNodeSwiperBreakpoints = React.useMemo(() => {\n return generateSwiperBreakpoints(itemsPerRow, false)\n }, [itemsPerRow, generateSwiperBreakpoints])\n\n const showTimeline = data.showTimeline !== false // \u9ED8\u8BA4\u4E3A true\n\n // \u540C\u6B65\u4E24\u4E2A Swiper \u7684\u6ED1\u52A8\n const handleCardSwiperSlideChange = React.useCallback((swiper: SwiperType) => {\n if (isSyncingRef.current || !timelineSwiperRef.current) return\n isSyncingRef.current = true\n timelineSwiperRef.current.slideTo(swiper.activeIndex, swiper.params.speed)\n // \u5EF6\u8FDF\u91CD\u7F6E\u6807\u5FD7\uFF0C\u786E\u4FDD\u540C\u6B65\u5B8C\u6210\n setTimeout(() => {\n isSyncingRef.current = false\n }, 50)\n }, [])\n\n const handleTimelineSwiperSlideChange = React.useCallback((swiper: SwiperType) => {\n if (isSyncingRef.current || !swiperRef.current) return\n isSyncingRef.current = true\n swiperRef.current.slideTo(swiper.activeIndex, swiper.params.speed)\n // \u5EF6\u8FDF\u91CD\u7F6E\u6807\u5FD7\uFF0C\u786E\u4FDD\u540C\u6B65\u5B8C\u6210\n setTimeout(() => {\n isSyncingRef.current = false\n }, 50)\n }, [])\n\n // \u81EA\u52A8\u6EDA\u52A8\u5230 active item\n React.useEffect(() => {\n if (swiperRef.current && timelineSwiperRef.current && activeIndex >= 0) {\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u786E\u4FDD Swiper \u5DF2\u7ECF\u5B8C\u5168\u521D\u59CB\u5316\n setTimeout(() => {\n isSyncingRef.current = true\n swiperRef.current?.slideTo(activeIndex, 500)\n timelineSwiperRef.current?.slideTo(activeIndex, 500)\n setTimeout(() => {\n isSyncingRef.current = false\n }, 600)\n }, 100)\n }\n }, [activeIndex])\n\n return (\n <Container {...rest} ref={ref} className={cn('overflow-hidden', classNames?.root, className)}>\n {showTimeline && (\n <Swiper\n breakpoints={timeNodeSwiperBreakpoints}\n className=\"h-4 w-full !overflow-visible\"\n onSwiper={swiper => {\n timelineSwiperRef.current = swiper\n }}\n onSlideChange={handleTimelineSwiperSlideChange}\n >\n {data.scheduleList.map((item, index) => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return (\n <SwiperSlide key={'timelineNode' + index} className=\"\">\n <TimelineNode\n className={classNames?.timeline}\n timeStatus={timeStatus}\n theme={theme}\n index={index}\n nodeLength={data.scheduleList.length}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n )}\n <Swiper\n breakpoints={swiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={swiper => {\n swiperRef.current = swiper\n }}\n onSlideChange={handleCardSwiperSlideChange}\n >\n {data.scheduleList.map((item, index) => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return (\n <SwiperSlide key={'SwiperSlideItem' + index}>\n <EventScheduleCard\n timeStatus={timeStatus}\n className={cn(showTimeline ? 'laptop:mt-4 mt-2' : '', classNames?.eventScheduleCard)}\n item={item}\n theme={theme}\n scheduleCount={data.scheduleList.length}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n </Container>\n )\n }\n)\n\nEventSchedule.displayName = 'EventSchedule'\nexport default withLayout(EventSchedule)\n\n// \u5BFC\u51FA\u7C7B\u578B\u4F9B\u5916\u90E8\u4F7F\u7528\n// export type { StateIcon, EventScheduleItem, EventScheduleData, EventScheduleProps }\n"],
5
+ "mappings": "aAmOI,OAEE,OAAAA,EAFF,QAAAC,MAAA,oBAjOJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,QAAAC,EAAM,WAAAC,EAAS,WAAAC,EAAS,aAAAC,MAAiB,4BAClD,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eAEpC,OAAOC,MAAW,QAClB,OAAS,OAAAC,MAAW,2BA0EpB,MAAMC,EAAgB,CAACC,EAAmBC,IAAgC,CACxE,MAAMC,EAAML,EAAM,EACZM,EAAQN,EAAMG,CAAS,EAAE,QAAQ,KAAK,EACtCI,EAAMP,EAAMI,CAAO,EAAE,MAAM,KAAK,EAGtC,OAAIC,EAAI,QAAQE,CAAG,EACV,YAILF,EAAI,SAASC,CAAK,EACb,cAIF,aACT,EAKME,EAAiCP,EAAI,6BAA8B,CACvE,SAAU,CACR,MAAO,CAEL,oBAAqB,eACrB,mBAAoB,eAEpB,oBAAqB,eACrB,mBAAoB,eAEpB,kBAAmB,eACnB,iBAAkB,cACpB,CACF,EACA,gBAAiB,CACf,MAAO,mBACT,CACF,CAAC,EAKKQ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YjB,EACZ,MAAOC,EACP,MAAOE,EACP,WAAYe,EAAK,aAAa,OAChC,GAPgB,eAAiBf,CAQnC,CAEJ,CAAC,EACH,EAEF3B,EAACS,EAAA,CACC,YAAaiD,EACb,UAAU,2BACV,SAAUI,GAAU,CAClBjB,EAAU,QAAUiB,CACtB,EACA,cAAeD,EAEd,SAAAnB,EAAK,aAAa,IAAI,CAACP,EAAMR,IAAU,CACtC,MAAMH,EAAaX,EAAcsB,EAAK,UAAWA,EAAK,OAAO,EAC7D,OACEnC,EAACU,EAAA,CACC,SAAAV,EAACkC,EAAA,CACC,WAAYV,EACZ,UAAWrB,EAAGyD,EAAe,mBAAqB,GAAInB,GAAY,iBAAiB,EACnF,KAAMN,EACN,MAAOV,EACP,cAAeiB,EAAK,aAAa,OACnC,GAPgB,kBAAoBf,CAQtC,CAEJ,CAAC,EACH,GACF,CAEJ,CACF,EAEAa,EAAc,YAAc,gBAC5B,IAAOwB,EAAQ5D,EAAWoC,CAAa",
6
+ "names": ["jsx", "jsxs", "React", "cn", "withLayout", "Text", "Picture", "Heading", "Container", "Swiper", "SwiperSlide", "dayjs", "cva", "getTimeStatus", "startDate", "endDate", "now", "start", "end", "timelineProgressActiveVariants", "timelineNodeActiveVariants", "cardTextVariants", "eventScheduleCardVariants", "TimelineNode", "timeStatus", "theme", "className", "index", "nodeLength", "state", "isFirst", "isLast", "getIconByTimeStatus", "icon", "EventScheduleCard", "item", "scheduleCount", "currentIcon", "cardState", "detail", "EventSchedule", "classNames", "data", "rest", "ref", "swiperRef", "timelineSwiperRef", "isSyncingRef", "itemsPerRow", "activeIndex", "generateSwiperBreakpoints", "withSpaceBetween", "getBreakpointConfig", "breakpoint", "mobileConfig", "tabletConfig", "laptopConfig", "desktopConfig", "swiperBreakpoints", "timeNodeSwiperBreakpoints", "showTimeline", "handleCardSwiperSlideChange", "swiper", "handleTimelineSwiperSlideChange", "EventSchedule_default"]
7
7
  }
@@ -47,10 +47,5 @@ export interface FeaturedBlogPostsProps extends React.HTMLAttributes<HTMLDivElem
47
47
  /** 卡片点击回调 */
48
48
  onItemClick?: (item: FeaturedBlogPostItem, index: number, event: React.MouseEvent) => void;
49
49
  }
50
- /**
51
- * FeaturedBlogPosts - 精选博文
52
- *
53
- * @description 展示经过筛选的优质文章,支持不同宽度和布局的卡片组合
54
- */
55
- declare const FeaturedBlogPosts: React.ForwardRefExoticComponent<FeaturedBlogPostsProps & React.RefAttributes<HTMLDivElement>>;
50
+ declare const FeaturedBlogPosts: any;
56
51
  export default FeaturedBlogPosts;
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as l,jsxs as p}from"react/jsx-runtime";import*as u from"react";import{cn as r}from"../../helpers/index.js";import y from"../../components/picture.js";import{Heading as h,Text as m}from"../../index.js";import"../../shared/Styles.js";const P=o=>{const t=[{key:"lgDesktop",width:1920},{key:"desktop",width:1440},{key:"laptop",width:1024},{key:"pad",width:768},{key:"mobile",width:390}],s=t.filter(({key:a})=>o[a]?.url).map(({key:a,width:d})=>`${o[a].url} ${d}`);if(s.length>0)return s.join(", ");for(const{key:a}of t)if(o[a]?.url)return o[a].url;return""},F=(o,t)=>{const s=["desktop","laptop","pad","mobile","lgDesktop"];for(const a of s)if(o[a]?.alt)return o[a].alt;return t},I=(o="full")=>({full:"laptop:col-span-3","2/3":"laptop:col-span-2","1/3":"laptop:col-span-1"})[o],w=(o="full")=>o==="1/3"?"":"laptop:flex-row",B=(o="full")=>({full:"laptop:h-full laptop:w-2/3","2/3":"laptop:h-full laptop:w-1/2","1/3":"laptop:flex-1 h-[200px] lg-desktop:h-[240px]"})[o],k=u.forwardRef(({className:o,classNames:t={},data:s,onItemClick:a,...d},x)=>{const{title:n,subtitle:g,items:f}=s,b=u.useCallback((e,i)=>c=>{a?.(e,i,c)},[a]);return p("div",{ref:x,className:r("blog-posts-root","text-info-primary w-full",o,t.root),...d,children:[(n||g)&&p("div",{className:r("blog-posts-header mb-6",t.header),children:[n&&l(h,{as:"h2",size:4,html:n,className:r("blog-posts-title",t.title)}),g&&l(m,{as:"p",size:3,className:r("",t?.subtitle),html:g})]}),l("div",{className:r("blog-posts-grid","laptop:grid-cols-3 grid grid-cols-1 gap-4",t.grid),children:f.map((e,i)=>{const c=e.link?"a":"div",v=e.link?{href:e.link}:{};return p(u.Fragment,{children:[p(c,{...v,className:r("blog-posts-card rounded-box","flex cursor-pointer flex-col gap-4","laptop:h-[336px] desktop:h-[448px] lg-desktop:h-[560px]","laptop:bg-container-secondary-0 laptop:p-4 desktop:p-6 lg-desktop:p-8","laptop:overflow-hidden laptop:transition-opacity ","bg-container-secondary-1",I(e.width||"full"),w(e.width||"full"),t.card),onClick:b(e,i),children:[l("div",{className:r("blog-posts-card-image","relative w-full overflow-hidden","h-[200px] shrink-0",B(e.width||"full"),t.cardImage),children:l(y,{source:P(e.image),alt:F(e.image,e.title),className:"rounded-box h-full object-cover",imgClassName:"h-full"})}),p("div",{className:r("blog-posts-card-content","desktop:gap-6 flex flex-col justify-center gap-4",t.cardContent),children:[p("div",{className:"desktop:gap-2 flex flex-col gap-1",children:[l(h,{size:2,as:"h6",className:r("blog-posts-card-title line-clamp-3",t.cardTitle),html:e.title}),e.description&&l(m,{className:r("blog-posts-card-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",t.cardDescription),html:e.description})]}),e.date&&l(m,{className:r("blog-posts-card-meta","text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",t.cardMeta),html:e.date})]})]}),i<f.length-1&&l("div",{className:r("blog-posts-separator","bg-lines-primary laptop:hidden h-px w-full",t.separator)})]},i)})})]})});k.displayName="FeaturedBlogPosts";var N=k;export{N as default};
1
+ "use client";import{jsx as l,jsxs as p}from"react/jsx-runtime";import*as u from"react";import{cn as r}from"../../helpers/index.js";import y from"../../components/picture.js";import{Heading as h,Text as m}from"../../index.js";import{withLayout as P}from"../../shared/Styles.js";const F=o=>{const t=[{key:"lgDesktop",width:1920},{key:"desktop",width:1440},{key:"laptop",width:1024},{key:"pad",width:768},{key:"mobile",width:390}],s=t.filter(({key:a})=>o[a]?.url).map(({key:a,width:d})=>`${o[a].url} ${d}`);if(s.length>0)return s.join(", ");for(const{key:a}of t)if(o[a]?.url)return o[a].url;return""},B=(o,t)=>{const s=["desktop","laptop","pad","mobile","lgDesktop"];for(const a of s)if(o[a]?.alt)return o[a].alt;return t},I=(o="full")=>({full:"laptop:col-span-3","2/3":"laptop:col-span-2","1/3":"laptop:col-span-1"})[o],w=(o="full")=>o==="1/3"?"":"laptop:flex-row",R=(o="full")=>({full:"laptop:h-full laptop:w-2/3","2/3":"laptop:h-full laptop:w-1/2","1/3":"laptop:flex-1 h-[200px] lg-desktop:h-[240px]"})[o],k=u.forwardRef(({className:o,classNames:t={},data:s,onItemClick:a,...d},x)=>{const{title:n,subtitle:g,items:f}=s,b=u.useCallback((e,i)=>c=>{a?.(e,i,c)},[a]);return p("div",{ref:x,className:r("blog-posts-root","text-info-primary w-full",o,t.root),...d,children:[(n||g)&&p("div",{className:r("blog-posts-header mb-6",t.header),children:[n&&l(h,{as:"h2",size:4,html:n,className:r("blog-posts-title",t.title)}),g&&l(m,{as:"p",size:3,className:r("",t?.subtitle),html:g})]}),l("div",{className:r("blog-posts-grid","laptop:grid-cols-3 grid grid-cols-1 gap-4",t.grid),children:f.map((e,i)=>{const c=e.link?"a":"div",v=e.link?{href:e.link}:{};return p(u.Fragment,{children:[p(c,{...v,className:r("blog-posts-card rounded-box","flex cursor-pointer flex-col gap-4","laptop:h-[336px] desktop:h-[448px] lg-desktop:h-[560px]","laptop:bg-container-secondary-0 laptop:p-4 desktop:p-6 lg-desktop:p-8","laptop:overflow-hidden laptop:transition-opacity ","bg-container-secondary-1",I(e.width||"full"),w(e.width||"full"),t.card),onClick:b(e,i),children:[l("div",{className:r("blog-posts-card-image","relative w-full overflow-hidden","h-[200px] shrink-0",R(e.width||"full"),t.cardImage),children:l(y,{source:F(e.image),alt:B(e.image,e.title),className:"rounded-box h-full object-cover",imgClassName:"h-full"})}),p("div",{className:r("blog-posts-card-content","desktop:gap-6 flex flex-col justify-center gap-4",t.cardContent),children:[p("div",{className:"desktop:gap-2 flex flex-col gap-1",children:[l(h,{size:2,as:"h6",className:r("blog-posts-card-title line-clamp-3",t.cardTitle),html:e.title}),e.description&&l(m,{className:r("blog-posts-card-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",t.cardDescription),html:e.description})]}),e.date&&l(m,{className:r("blog-posts-card-meta","text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",t.cardMeta),html:e.date})]})]}),i<f.length-1&&l("div",{className:r("blog-posts-separator","bg-lines-primary laptop:hidden h-px w-full",t.separator)})]},i)})})]})});k.displayName="FeaturedBlogPosts";const C=P(k);var z=C;export{z as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/FeaturedBlogPosts/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport Picture from '../../components/picture.js'\nimport type { Img } from '../../types/props.js'\nimport { Heading, Text } from '../../index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport type FeaturedBlogPostsSemanticName =\n | 'root'\n | 'header'\n | 'title'\n | 'subtitle'\n | 'grid'\n | 'card'\n | 'cardImage'\n | 'cardContent'\n | 'cardTitle'\n | 'cardDescription'\n | 'cardMeta'\n | 'separator'\n\n/**\n * \u5361\u7247\u5BBD\u5EA6\u6BD4\u4F8B\n */\nexport type FeaturedBlogPostSpan = 'full' | '2/3' | '1/3'\n\n/**\n * \u535A\u6587\u5361\u7247\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface FeaturedBlogPostItem {\n /** \u5C01\u9762\u56FE\u7247 */\n image: {\n mobile?: Img\n pad?: Img\n laptop?: Img\n desktop?: Img\n lgDesktop?: Img\n }\n /** \u6587\u7AE0\u6807\u9898 */\n title: string\n /** \u6587\u7AE0\u63CF\u8FF0 */\n description?: string\n /** \u65E5\u671F\u4FE1\u606F\uFF08\u5206\u7C7B\u00B7\u65E5\u671F\u00B7\u4F5C\u8005\uFF09 */\n date?: string\n /** \u6587\u7AE0\u94FE\u63A5 */\n link?: string\n /** \u5361\u7247\u5BBD\u5EA6\u6BD4\u4F8B\uFF0C\u9ED8\u8BA4 full */\n width?: FeaturedBlogPostSpan\n}\n\n/**\n * FeaturedBlogPosts \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface FeaturedBlogPostsData {\n /** \u4E3B\u6807\u9898 */\n title?: string\n /** \u526F\u6807\u9898 */\n subtitle?: string\n /** \u535A\u6587\u5217\u8868 */\n items: FeaturedBlogPostItem[]\n}\n\nexport interface FeaturedBlogPostsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: FeaturedBlogPostsData\n /** \u8BED\u4E49\u5316\u7C7B\u540D\u8986\u76D6 */\n classNames?: Partial<Record<FeaturedBlogPostsSemanticName, string>>\n /** \u5361\u7247\u70B9\u51FB\u56DE\u8C03 */\n onItemClick?: (item: FeaturedBlogPostItem, index: number, event: React.MouseEvent) => void\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u7C7B\u578B\n */\ntype ResponsiveImage = FeaturedBlogPostItem['image']\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61\u8F6C\u4E3A Picture source \u683C\u5F0F\u5B57\u7B26\u4E32\n * \u683C\u5F0F: \"url1 1920, url2 1440, url3 1024, url4 768, url5 390\"\n */\nconst getImageSource = (image: ResponsiveImage): string => {\n const breakpoints: { key: keyof ResponsiveImage; width: number }[] = [\n { key: 'lgDesktop', width: 1920 },\n { key: 'desktop', width: 1440 },\n { key: 'laptop', width: 1024 },\n { key: 'pad', width: 768 },\n { key: 'mobile', width: 390 },\n ]\n\n const sources = breakpoints\n .filter(({ key }) => image[key]?.url)\n .map(({ key, width }) => `${image[key]!.url} ${width}`)\n\n // \u5982\u679C\u6709 sources\uFF0C\u8FD4\u56DE\u62FC\u63A5\u7ED3\u679C\uFF1B\u5426\u5219\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u6709\u6548\u7684 url\n if (sources.length > 0) {\n return sources.join(', ')\n }\n\n // fallback: \u8FD4\u56DE\u4EFB\u610F\u4E00\u4E2A\u6709\u6548\u7684 url\n for (const { key } of breakpoints) {\n if (image[key]?.url) return image[key]!.url\n }\n\n return ''\n}\n\n/**\n * \u4ECE\u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61\u83B7\u53D6 alt \u6587\u672C\n */\nconst getImageAlt = (image: ResponsiveImage, fallback: string): string => {\n const keys: (keyof ResponsiveImage)[] = ['desktop', 'laptop', 'pad', 'mobile', 'lgDesktop']\n for (const key of keys) {\n if (image[key]?.alt) return image[key]!.alt!\n }\n return fallback\n}\n\n/**\n * \u6839\u636E span \u83B7\u53D6\u5361\u7247 grid \u5217\u6570 (laptop+)\n */\nconst getSpanClass = (span: FeaturedBlogPostSpan = 'full') => {\n const spanMap: Record<FeaturedBlogPostSpan, string> = {\n full: 'laptop:col-span-3',\n '2/3': 'laptop:col-span-2',\n '1/3': 'laptop:col-span-1',\n }\n return spanMap[span]\n}\n\n/**\n * \u6839\u636E span \u83B7\u53D6\u5361\u7247\u5E03\u5C40\u65B9\u5411 (laptop+)\n * 1/3: \u4E0A\u4E0B\u5E03\u5C40\uFF0C\u5176\u4ED6: \u5DE6\u53F3\u5E03\u5C40\n */\nconst getLayoutClass = (span: FeaturedBlogPostSpan = 'full') => {\n return span === '1/3' ? '' : 'laptop:flex-row'\n}\n\n/**\n * \u6839\u636E span \u83B7\u53D6\u56FE\u7247\u5C3A\u5BF8\u6837\u5F0F (laptop+)\n * full: \u5DE6\u53F3\u5E03\u5C40\uFF0C\u56FE\u7247\u5BBD\u5EA6\u5360 2/3\n * 2/3: \u5DE6\u53F3\u5E03\u5C40\uFF0C\u56FE\u7247\u5BBD\u5EA6\u5360 1/2\n * 1/3: \u4E0A\u4E0B\u5E03\u5C40\uFF0C\u56FE\u7247\u9AD8\u5EA6\u586B\u6EE1\u5269\u4F59\u7A7A\u95F4\n */\nconst getImageSizeClass = (span: FeaturedBlogPostSpan = 'full') => {\n const sizeMap: Record<FeaturedBlogPostSpan, string> = {\n full: 'laptop:h-full laptop:w-2/3',\n '2/3': 'laptop:h-full laptop:w-1/2',\n '1/3': 'laptop:flex-1 h-[200px] lg-desktop:h-[240px]',\n }\n return sizeMap[span]\n}\n\n/**\n * FeaturedBlogPosts - \u7CBE\u9009\u535A\u6587\n *\n * @description \u5C55\u793A\u7ECF\u8FC7\u7B5B\u9009\u7684\u4F18\u8D28\u6587\u7AE0\uFF0C\u652F\u6301\u4E0D\u540C\u5BBD\u5EA6\u548C\u5E03\u5C40\u7684\u5361\u7247\u7EC4\u5408\n */\nconst FeaturedBlogPosts = React.forwardRef<HTMLDivElement, FeaturedBlogPostsProps>(\n ({ className, classNames = {}, data, onItemClick, ...props }, ref) => {\n const { title, subtitle, items } = data\n\n const handleCardClick = React.useCallback(\n (item: FeaturedBlogPostItem, index: number) => (event: React.MouseEvent) => {\n onItemClick?.(item, index, event)\n },\n [onItemClick]\n )\n\n return (\n <div\n ref={ref}\n className={cn('blog-posts-root', 'text-info-primary w-full', className, classNames.root)}\n {...props}\n >\n {/* \u6807\u9898\u533A\u57DF */}\n {(title || subtitle) && (\n <div className={cn('blog-posts-header mb-6', classNames.header)}>\n {title && <Heading as=\"h2\" size={4} html={title} className={cn('blog-posts-title', classNames.title)} />}\n {subtitle && <Text as=\"p\" size={3} className={cn('', classNames?.subtitle)} html={subtitle} />}\n </div>\n )}\n <div className={cn('blog-posts-grid', 'laptop:grid-cols-3 grid grid-cols-1 gap-4', classNames.grid)}>\n {items.map((item, index) => {\n const CardWrapper = item.link ? 'a' : 'div'\n const cardProps = item.link ? { href: item.link } : {}\n\n return (\n <React.Fragment key={index}>\n <CardWrapper\n {...cardProps}\n className={cn(\n 'blog-posts-card rounded-box',\n 'flex cursor-pointer flex-col gap-4',\n 'laptop:h-[336px] desktop:h-[448px] lg-desktop:h-[560px]',\n 'laptop:bg-container-secondary-0 laptop:p-4 desktop:p-6 lg-desktop:p-8',\n 'laptop:overflow-hidden laptop:transition-opacity ',\n 'bg-container-secondary-1',\n getSpanClass(item.width || 'full'),\n getLayoutClass(item.width || 'full'),\n classNames.card\n )}\n onClick={handleCardClick(item, index)}\n >\n {/* \u56FE\u7247 */}\n <div\n className={cn(\n 'blog-posts-card-image',\n 'relative w-full overflow-hidden',\n 'h-[200px] shrink-0',\n getImageSizeClass(item.width || 'full'),\n classNames.cardImage\n )}\n >\n <Picture\n source={getImageSource(item.image)}\n alt={getImageAlt(item.image, item.title)}\n className=\"rounded-box h-full object-cover\"\n imgClassName=\"h-full\"\n />\n </div>\n\n {/* \u5185\u5BB9 */}\n <div\n className={cn(\n 'blog-posts-card-content',\n 'desktop:gap-6 flex flex-col justify-center gap-4',\n classNames.cardContent\n )}\n >\n <div className=\"desktop:gap-2 flex flex-col gap-1\">\n <Heading\n size={2}\n as=\"h6\"\n className={cn('blog-posts-card-title line-clamp-3', classNames.cardTitle)}\n html={item.title}\n />\n\n {item.description && (\n <Text\n className={cn(\n 'blog-posts-card-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]',\n classNames.cardDescription\n )}\n html={item.description}\n />\n )}\n </div>\n {item.date && (\n <Text\n className={cn(\n 'blog-posts-card-meta',\n 'text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]',\n classNames.cardMeta\n )}\n html={item.date}\n />\n )}\n </div>\n </CardWrapper>\n\n {/* \u5206\u5272\u7EBF - \u4EC5 mobile/tablet \u663E\u793A */}\n {index < items.length - 1 && (\n <div\n className={cn(\n 'blog-posts-separator',\n 'bg-lines-primary laptop:hidden h-px w-full',\n classNames.separator\n )}\n />\n )}\n </React.Fragment>\n )\n })}\n </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A,QAASQ,EAAgBC,EAAMC,CAAK,EAGpC,UAAAhC,EAAC,OACC,UAAWG,EACT,wBACA,kCACA,qBACAgB,EAAkBY,EAAK,OAAS,MAAM,EACtCT,EAAW,SACb,EAEA,SAAAtB,EAACI,EAAA,CACC,OAAQG,EAAewB,EAAK,KAAK,EACjC,IAAKlB,EAAYkB,EAAK,MAAOA,EAAK,KAAK,EACvC,UAAU,kCACV,aAAa,SACf,EACF,EAGA9B,EAAC,OACC,UAAWE,EACT,0BACA,mDACAmB,EAAW,WACb,EAEA,UAAArB,EAAC,OAAI,UAAU,oCACb,UAAAD,EAACK,EAAA,CACC,KAAM,EACN,GAAG,KACH,UAAWF,EAAG,qCAAsCmB,EAAW,SAAS,EACxE,KAAMS,EAAK,MACb,EAECA,EAAK,aACJ/B,EAACM,EAAA,CACC,UAAWH,EACT,kGACAmB,EAAW,eACb,EACA,KAAMS,EAAK,YACb,GAEJ,EACCA,EAAK,MACJ/B,EAACM,EAAA,CACC,UAAWH,EACT,uBACA,4EACAmB,EAAW,QACb,EACA,KAAMS,EAAK,KACb,GAEJ,GACF,EAGCC,EAAQH,EAAM,OAAS,GACtB7B,EAAC,OACC,UAAWG,EACT,uBACA,6CACAmB,EAAW,SACb,EACF,IAjFiBU,CAmFrB,CAEJ,CAAC,EACH,GACF,CAEJ,CACF,EAEAZ,EAAkB,YAAc,oBAChC,IAAOgB,EAAQhB",
6
- "names": ["jsx", "jsxs", "React", "cn", "Picture", "Heading", "Text", "getImageSource", "image", "breakpoints", "sources", "key", "width", "getImageAlt", "fallback", "keys", "getSpanClass", "span", "getLayoutClass", "getImageSizeClass", "FeaturedBlogPosts", "className", "classNames", "data", "onItemClick", "props", "ref", "title", "subtitle", "items", "handleCardClick", "item", "index", "event", "CardWrapper", "cardProps", "FeaturedBlogPosts_default"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport Picture from '../../components/picture.js'\nimport type { Img } from '../../types/props.js'\nimport { Heading, Text } from '../../index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport type FeaturedBlogPostsSemanticName =\n | 'root'\n | 'header'\n | 'title'\n | 'subtitle'\n | 'grid'\n | 'card'\n | 'cardImage'\n | 'cardContent'\n | 'cardTitle'\n | 'cardDescription'\n | 'cardMeta'\n | 'separator'\n\n/**\n * \u5361\u7247\u5BBD\u5EA6\u6BD4\u4F8B\n */\nexport type FeaturedBlogPostSpan = 'full' | '2/3' | '1/3'\n\n/**\n * \u535A\u6587\u5361\u7247\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface FeaturedBlogPostItem {\n /** \u5C01\u9762\u56FE\u7247 */\n image: {\n mobile?: Img\n pad?: Img\n laptop?: Img\n desktop?: Img\n lgDesktop?: Img\n }\n /** \u6587\u7AE0\u6807\u9898 */\n title: string\n /** \u6587\u7AE0\u63CF\u8FF0 */\n description?: string\n /** \u65E5\u671F\u4FE1\u606F\uFF08\u5206\u7C7B\u00B7\u65E5\u671F\u00B7\u4F5C\u8005\uFF09 */\n date?: string\n /** \u6587\u7AE0\u94FE\u63A5 */\n link?: string\n /** \u5361\u7247\u5BBD\u5EA6\u6BD4\u4F8B\uFF0C\u9ED8\u8BA4 full */\n width?: FeaturedBlogPostSpan\n}\n\n/**\n * FeaturedBlogPosts \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface FeaturedBlogPostsData {\n /** \u4E3B\u6807\u9898 */\n title?: string\n /** \u526F\u6807\u9898 */\n subtitle?: string\n /** \u535A\u6587\u5217\u8868 */\n items: FeaturedBlogPostItem[]\n}\n\nexport interface FeaturedBlogPostsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: FeaturedBlogPostsData\n /** \u8BED\u4E49\u5316\u7C7B\u540D\u8986\u76D6 */\n classNames?: Partial<Record<FeaturedBlogPostsSemanticName, string>>\n /** \u5361\u7247\u70B9\u51FB\u56DE\u8C03 */\n onItemClick?: (item: FeaturedBlogPostItem, index: number, event: React.MouseEvent) => void\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u7C7B\u578B\n */\ntype ResponsiveImage = FeaturedBlogPostItem['image']\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61\u8F6C\u4E3A Picture source \u683C\u5F0F\u5B57\u7B26\u4E32\n * \u683C\u5F0F: \"url1 1920, url2 1440, url3 1024, url4 768, url5 390\"\n */\nconst getImageSource = (image: ResponsiveImage): string => {\n const breakpoints: { key: keyof ResponsiveImage; width: number }[] = [\n { key: 'lgDesktop', width: 1920 },\n { key: 'desktop', width: 1440 },\n { key: 'laptop', width: 1024 },\n { key: 'pad', width: 768 },\n { key: 'mobile', width: 390 },\n ]\n\n const sources = breakpoints\n .filter(({ key }) => image[key]?.url)\n .map(({ key, width }) => `${image[key]!.url} ${width}`)\n\n // \u5982\u679C\u6709 sources\uFF0C\u8FD4\u56DE\u62FC\u63A5\u7ED3\u679C\uFF1B\u5426\u5219\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u6709\u6548\u7684 url\n if (sources.length > 0) {\n return sources.join(', ')\n }\n\n // fallback: \u8FD4\u56DE\u4EFB\u610F\u4E00\u4E2A\u6709\u6548\u7684 url\n for (const { key } of breakpoints) {\n if (image[key]?.url) return image[key]!.url\n }\n\n return ''\n}\n\n/**\n * \u4ECE\u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61\u83B7\u53D6 alt \u6587\u672C\n */\nconst getImageAlt = (image: ResponsiveImage, fallback: string): string => {\n const keys: (keyof ResponsiveImage)[] = ['desktop', 'laptop', 'pad', 'mobile', 'lgDesktop']\n for (const key of keys) {\n if (image[key]?.alt) return image[key]!.alt!\n }\n return fallback\n}\n\n/**\n * \u6839\u636E span \u83B7\u53D6\u5361\u7247 grid \u5217\u6570 (laptop+)\n */\nconst getSpanClass = (span: FeaturedBlogPostSpan = 'full') => {\n const spanMap: Record<FeaturedBlogPostSpan, string> = {\n full: 'laptop:col-span-3',\n '2/3': 'laptop:col-span-2',\n '1/3': 'laptop:col-span-1',\n }\n return spanMap[span]\n}\n\n/**\n * \u6839\u636E span \u83B7\u53D6\u5361\u7247\u5E03\u5C40\u65B9\u5411 (laptop+)\n * 1/3: \u4E0A\u4E0B\u5E03\u5C40\uFF0C\u5176\u4ED6: \u5DE6\u53F3\u5E03\u5C40\n */\nconst getLayoutClass = (span: FeaturedBlogPostSpan = 'full') => {\n return span === '1/3' ? '' : 'laptop:flex-row'\n}\n\n/**\n * \u6839\u636E span \u83B7\u53D6\u56FE\u7247\u5C3A\u5BF8\u6837\u5F0F (laptop+)\n * full: \u5DE6\u53F3\u5E03\u5C40\uFF0C\u56FE\u7247\u5BBD\u5EA6\u5360 2/3\n * 2/3: \u5DE6\u53F3\u5E03\u5C40\uFF0C\u56FE\u7247\u5BBD\u5EA6\u5360 1/2\n * 1/3: \u4E0A\u4E0B\u5E03\u5C40\uFF0C\u56FE\u7247\u9AD8\u5EA6\u586B\u6EE1\u5269\u4F59\u7A7A\u95F4\n */\nconst getImageSizeClass = (span: FeaturedBlogPostSpan = 'full') => {\n const sizeMap: Record<FeaturedBlogPostSpan, string> = {\n full: 'laptop:h-full laptop:w-2/3',\n '2/3': 'laptop:h-full laptop:w-1/2',\n '1/3': 'laptop:flex-1 h-[200px] lg-desktop:h-[240px]',\n }\n return sizeMap[span]\n}\n\n/**\n * FeaturedBlogPosts - \u7CBE\u9009\u535A\u6587\n *\n * @description \u5C55\u793A\u7ECF\u8FC7\u7B5B\u9009\u7684\u4F18\u8D28\u6587\u7AE0\uFF0C\u652F\u6301\u4E0D\u540C\u5BBD\u5EA6\u548C\u5E03\u5C40\u7684\u5361\u7247\u7EC4\u5408\n */\nconst FeaturedBlogPostsBase = React.forwardRef<HTMLDivElement, FeaturedBlogPostsProps>(\n ({ className, classNames = {}, data, onItemClick, ...props }, ref) => {\n const { title, subtitle, items } = data\n\n const handleCardClick = React.useCallback(\n (item: FeaturedBlogPostItem, index: number) => (event: React.MouseEvent) => {\n onItemClick?.(item, index, event)\n },\n [onItemClick]\n )\n\n return (\n <div\n ref={ref}\n className={cn('blog-posts-root', 'text-info-primary w-full', className, classNames.root)}\n {...props}\n >\n {/* \u6807\u9898\u533A\u57DF */}\n {(title || subtitle) && (\n <div className={cn('blog-posts-header mb-6', classNames.header)}>\n {title && <Heading as=\"h2\" size={4} html={title} className={cn('blog-posts-title', classNames.title)} />}\n {subtitle && <Text as=\"p\" size={3} className={cn('', classNames?.subtitle)} html={subtitle} />}\n </div>\n )}\n <div className={cn('blog-posts-grid', 'laptop:grid-cols-3 grid grid-cols-1 gap-4', classNames.grid)}>\n {items.map((item, index) => {\n const CardWrapper = item.link ? 'a' : 'div'\n const cardProps = item.link ? { href: item.link } : {}\n\n return (\n <React.Fragment key={index}>\n <CardWrapper\n {...cardProps}\n className={cn(\n 'blog-posts-card rounded-box',\n 'flex cursor-pointer flex-col gap-4',\n 'laptop:h-[336px] desktop:h-[448px] lg-desktop:h-[560px]',\n 'laptop:bg-container-secondary-0 laptop:p-4 desktop:p-6 lg-desktop:p-8',\n 'laptop:overflow-hidden laptop:transition-opacity ',\n 'bg-container-secondary-1',\n getSpanClass(item.width || 'full'),\n getLayoutClass(item.width || 'full'),\n classNames.card\n )}\n onClick={handleCardClick(item, index)}\n >\n {/* \u56FE\u7247 */}\n <div\n className={cn(\n 'blog-posts-card-image',\n 'relative w-full overflow-hidden',\n 'h-[200px] shrink-0',\n getImageSizeClass(item.width || 'full'),\n classNames.cardImage\n )}\n >\n <Picture\n source={getImageSource(item.image)}\n alt={getImageAlt(item.image, item.title)}\n className=\"rounded-box h-full object-cover\"\n imgClassName=\"h-full\"\n />\n </div>\n\n {/* \u5185\u5BB9 */}\n <div\n className={cn(\n 'blog-posts-card-content',\n 'desktop:gap-6 flex flex-col justify-center gap-4',\n classNames.cardContent\n )}\n >\n <div className=\"desktop:gap-2 flex flex-col gap-1\">\n <Heading\n size={2}\n as=\"h6\"\n className={cn('blog-posts-card-title line-clamp-3', classNames.cardTitle)}\n html={item.title}\n />\n\n {item.description && (\n <Text\n className={cn(\n 'blog-posts-card-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]',\n classNames.cardDescription\n )}\n html={item.description}\n />\n )}\n </div>\n {item.date && (\n <Text\n className={cn(\n 'blog-posts-card-meta',\n 'text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]',\n classNames.cardMeta\n )}\n html={item.date}\n />\n )}\n </div>\n </CardWrapper>\n\n {/* \u5206\u5272\u7EBF - \u4EC5 mobile/tablet \u663E\u793A */}\n {index < items.length - 1 && (\n <div\n className={cn(\n 'blog-posts-separator',\n 'bg-lines-primary laptop:hidden h-px w-full',\n classNames.separator\n )}\n />\n )}\n </React.Fragment>\n )\n })}\n </div>\n </div>\n )\n }\n)\n\nFeaturedBlogPostsBase.displayName = 'FeaturedBlogPosts'\n\nconst FeaturedBlogPosts = withLayout(FeaturedBlogPostsBase)\n\nexport default FeaturedBlogPosts\n"],
5
+ "mappings": "aAkLU,OACY,OAAAA,EADZ,QAAAC,MAAA,oBAhLV,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BAEpB,OAAS,WAAAC,EAAS,QAAAC,MAAY,iBAC9B,OAAS,cAAAC,MAAkB,yBA2E3B,MAAMC,EAAkBC,GAAmC,CACzD,MAAMC,EAA+D,CACnE,CAAE,IAAK,YAAa,MAAO,IAAK,EAChC,CAAE,IAAK,UAAW,MAAO,IAAK,EAC9B,CAAE,IAAK,SAAU,MAAO,IAAK,EAC7B,CAAE,IAAK,MAAO,MAAO,GAAI,EACzB,CAAE,IAAK,SAAU,MAAO,GAAI,CAC9B,EAEMC,EAAUD,EACb,OAAO,CAAC,CAAE,IAAAE,CAAI,IAAMH,EAAMG,CAAG,GAAG,GAAG,EACnC,IAAI,CAAC,CAAE,IAAAA,EAAK,MAAAC,CAAM,IAAM,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ACb,EACA,KAAMS,EAAK,KACb,GAEJ,GACF,EAGCC,EAAQH,EAAM,OAAS,GACtB9B,EAAC,OACC,UAAWG,EACT,uBACA,6CACAoB,EAAW,SACb,EACF,IAjFiBU,CAmFrB,CAEJ,CAAC,EACH,GACF,CAEJ,CACF,EAEAZ,EAAsB,YAAc,oBAEpC,MAAMgB,EAAoB9B,EAAWc,CAAqB,EAE1D,IAAOiB,EAAQD",
6
+ "names": ["jsx", "jsxs", "React", "cn", "Picture", "Heading", "Text", "withLayout", "getImageSource", "image", "breakpoints", "sources", "key", "width", "getImageAlt", "fallback", "keys", "getSpanClass", "span", "getLayoutClass", "getImageSizeClass", "FeaturedBlogPostsBase", "className", "classNames", "data", "onItemClick", "props", "ref", "title", "subtitle", "items", "handleCardClick", "item", "index", "event", "CardWrapper", "cardProps", "FeaturedBlogPosts", "FeaturedBlogPosts_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as e,jsxs as c}from"react/jsx-runtime";import Q,{useImperativeHandle as ce,useRef as b,useState as ue,useEffect as me}from"react";import y from"gsap";import{ScrollTrigger as v}from"gsap/dist/ScrollTrigger";import{useMediaQuery as Z}from"react-responsive";import{useInView as de}from"react-intersection-observer";import ge from"../../helpers/ScrollLoadVideo.js";import{Button as P,Heading as fe,Picture as J,Text as S,Countdown as be}from"../../components/index.js";import{cn as n}from"../../helpers/index.js";import{cva as w}from"class-variance-authority";import{withLayout as xe}from"../../shared/Styles.js";import{useExposure as he}from"../../hooks/useExposure.js";import{trackUrlRef as R}from"../../shared/trackUrlRef.js";import{getLocalizedPath as ye}from"../../helpers/utils.js";import{useAiuiContext as ve}from"../AiuiProvider/index.js";import{sizeMap as we}from"../../components/button.js";import{VideoModal as ke}from"../VideoModal/index.js";const s="image",i="hero_banner",Ne=w("hero-banner-content laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]",center:"left-1/2 -translate-x-1/2 items-center text-center"}},defaultVariants:{align:"left"}}),$e=w("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ve=w("hero-banner-button-group lg-desktop:gap-3 flex items-center gap-2",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Be=w("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),ze=({size:u="base"})=>{const{width:k,height:x}=we[u];return e("svg",{width:k,height:x,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},K=Q.forwardRef(({data:u,className:k,classNames:x={},onSecondaryClick:O,onPrimaryClick:W,...X},ee)=>{const{locale:L}=ve(),N=t=>!t||!L?t:ye(t,L),{label:M,title:r,subtitle:o,endDate:D,endDate_tz:te,dateFormat:ae,pcImage:$,padImage:E,mobileImage:h,pcVideo:re,padVideo:oe,mobileVideo:j,isShowVideo:le,isVideoLoop:ne=!0,primaryButton:l,secondaryButton:a,theme:se="light",size:V="default",titleSize:B,caption:z=[],blockLink:U,iconArray:ie,align:m="left"}=u,_=Z({query:"(max-width: 768px)"}),G=Z({query:"(max-width: 1024px)"}),[F,A]=ue(!1),{ref:pe,inView:q}=de(),H=b(null),T=b(null),I=b(null),d=b(null),p=b(null);return he(p,{componentType:s,componentName:i,componentTitle:r,componentDescription:o}),ce(ee,()=>p.current),me(()=>{y.registerPlugin(v);function t(){if(!d.current)return;const C=p.current?.clientHeight||100;window.innerHeight<=C?H.current=v.create({trigger:p.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:g=>{const f=g.progress*40-20;y.set(d.current,{yPercent:f})}}):(I.current=v.create({trigger:p.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:g=>{const f=g.progress*20-20;y.set(d.current,{yPercent:f})}}),T.current=v.create({trigger:p.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:g=>{const f=g.progress*20;y.set(d.current,{yPercent:f})}}))}return q&&t(),()=>{H.current&&H.current.kill(),I.current&&I.current.kill(),T.current&&T.current.kill()}},[q]),e("div",{...X,ref:pe,"data-ui-component-id":"HeroBanner",children:c("div",{ref:p,className:n(se==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520] tablet:aspect-[768/660] aspect-[390/660]":V==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":V==="sm"},k),children:[U&&e("a",{className:"absolute inset-0 z-10",href:R(N(U),`${s}_${i}`),"data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${r}#${o}`,tabIndex:-1,"aria-hidden":"true","aria-label":r}),e("div",{ref:d,className:n("absolute left-0 top-0 size-full"),children:le?e(ge,{poster:_?h?.url:G?E?.url||h?.url:$?.url,src:_?j?.url:G?oe?.url||j?.url:re?.url,className:"laptop:w-full h-full",videoClassName:"h-full object-cover",muted:!0,loop:ne,playsInline:!0}):e(J,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:$?.alt||"",source:`${$?.url||""} , ${E?.url??(h?.url||"")} 1024, ${h?.url||""} 767`})}),c("div",{className:Ne({align:m}),children:[c("div",{className:$e({align:m}),children:[M&&e(S,{size:2,as:"p",className:n("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:M}),r&&e(fe,{as:B==="4"?"h1":"h2",html:r,className:n("hero-banner-title",x.title),size:B?Number(B||"5"):V==="sm"?4:5}),o&&e(S,{as:"p",size:2,className:n("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm"),html:o}),D&&e("div",{className:"mt-3",children:e(be,{endDate:D,endDate_tz:te,dateFormat:ae,variant:"spacious",align:m})})]}),c("div",{className:Ve({align:m}),children:[a?.isShowPlayVideoButton&&a?.playVideoButtonText?c(P,{onClick:()=>A(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button","data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${r}#${o}#${a?.playVideoButtonText}`,children:[a?.playVideoButtonText," ",e(ze,{size:"lg"})]}):a?.text?c(P,{"aria-label":r??o,size:"lg",variant:"secondary",className:"hero-banner-secondary-button",as:a?.isCustomSecondaryButton?"button":"a",href:R(N(a?.link),`${s}_${i}`),onClick:t=>a?.isCustomSecondaryButton&&O?.(u,t,a?.customSecondaryEventId),"data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${r}#${o}#${a?.text}`,children:[a?.text,e("span",{className:"sr-only",children:r??o})]}):null,l&&l.text&&e(P,{"aria-label":r??o,size:"lg",variant:"primary",className:"hero-banner-primary-button",as:l?.isCustomPrimaryButton?"button":"a",href:R(N(l.link),`${s}_${i}`),onClick:t=>l?.isCustomPrimaryButton&&W?.(u,t,l?.customPrimaryEventId),"data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${r}#${o}#${l?.text}`,children:l.text})]}),e("div",{className:Be({align:m}),children:ie?.map(t=>e("div",{className:"h-12",children:e(J,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:t?.pcImage?.alt||"",source:t?.pcImage?.url})},t?.pcImage?.url||t?.pcImage?.alt))})]}),z.length>0&&e("div",{className:n("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",x.captionGroup),children:z.map((t,C)=>c(Q.Fragment,{children:[e(S,{size:2,className:n("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:t.title}),C<z.length-1&&e("div",{className:n("bg-info-primary w-px")})]},t.title))}),F&&e(ke,{visible:F,videoUrl:a?.isYoutubeVideo?void 0:a?.videoUrl?.url,youTubeId:a?.isYoutubeVideo?a?.youtubeId:void 0,onCloseModal:()=>A(!1)})]})})});K.displayName="HeroBanner";var qe=xe(K);export{qe as default};
1
+ "use client";import{jsx as e,jsxs as c}from"react/jsx-runtime";import Q,{useImperativeHandle as ce,useRef as b,useState as ue,useEffect as de}from"react";import y from"gsap";import{ScrollTrigger as v}from"gsap/dist/ScrollTrigger";import{useMediaQuery as Z}from"react-responsive";import{useInView as me}from"react-intersection-observer";import ge from"../../helpers/ScrollLoadVideo.js";import{Button as P,Heading as fe,Picture as J,Text as S,Countdown as be}from"../../components/index.js";import{cn as n}from"../../helpers/index.js";import{cva as w}from"class-variance-authority";import{withLayout as xe}from"../../shared/Styles.js";import{useExposure as he}from"../../hooks/useExposure.js";import{trackUrlRef as R}from"../../shared/trackUrlRef.js";import{getLocalizedPath as ye}from"../../helpers/utils.js";import{useAiuiContext as ve}from"../AiuiProvider/index.js";import{sizeMap as we}from"../../components/button.js";import{VideoModal as ke}from"../VideoModal/index.js";const s="image",i="hero_banner",Ne=w("hero-banner-content lg-desktop:gap-[32px] absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),$e=w("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ve=w("hero-banner-button-group lg-desktop:gap-3 flex items-center gap-2",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Be=w("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),ze=({size:u="base"})=>{const{width:k,height:x}=we[u];return e("svg",{width:k,height:x,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},K=Q.forwardRef(({data:u,className:k,classNames:x={},onSecondaryClick:O,onPrimaryClick:W,...X},ee)=>{const{locale:L}=ve(),N=t=>!t||!L?t:ye(t,L),{label:M,title:o,subtitle:r,endDate:D,endDate_tz:te,dateFormat:ae,pcImage:$,padImage:E,mobileImage:h,pcVideo:oe,padVideo:re,mobileVideo:j,isShowVideo:le,isVideoLoop:ne=!0,primaryButton:l,secondaryButton:a,theme:se="light",size:V="default",titleSize:B,caption:z=[],blockLink:U,iconArray:ie,align:d="left"}=u,_=Z({query:"(max-width: 768px)"}),G=Z({query:"(max-width: 1024px)"}),[F,A]=ue(!1),{ref:pe,inView:q}=me(),H=b(null),T=b(null),I=b(null),m=b(null),p=b(null);return he(p,{componentType:s,componentName:i,componentTitle:o,componentDescription:r}),ce(ee,()=>p.current),de(()=>{y.registerPlugin(v);function t(){if(!m.current)return;const C=p.current?.clientHeight||100;window.innerHeight<=C?H.current=v.create({trigger:p.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:g=>{const f=g.progress*40-20;y.set(m.current,{yPercent:f})}}):(I.current=v.create({trigger:p.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:g=>{const f=g.progress*20-20;y.set(m.current,{yPercent:f})}}),T.current=v.create({trigger:p.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:g=>{const f=g.progress*20;y.set(m.current,{yPercent:f})}}))}return q&&t(),()=>{H.current&&H.current.kill(),I.current&&I.current.kill(),T.current&&T.current.kill()}},[q]),e("div",{...X,ref:pe,"data-ui-component-id":"HeroBanner",children:c("div",{ref:p,className:n(se==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520] tablet:aspect-[768/660] aspect-[390/660]":V==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":V==="sm"},k),children:[U&&e("a",{className:"absolute inset-0 z-10",href:R(N(U),`${s}_${i}`),"data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${o}#${r}`,tabIndex:-1,"aria-hidden":"true","aria-label":o}),e("div",{ref:m,className:n("absolute left-0 top-0 size-full"),children:le?e(ge,{poster:_?h?.url:G?E?.url||h?.url:$?.url,src:_?j?.url:G?re?.url||j?.url:oe?.url,className:"laptop:w-full h-full",videoClassName:"h-full object-cover",muted:!0,loop:ne,playsInline:!0}):e(J,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:$?.alt||"",source:`${$?.url||""} , ${E?.url??(h?.url||"")} 1024, ${h?.url||""} 767`})}),c("div",{className:Ne({align:d}),children:[c("div",{className:$e({align:d}),children:[M&&e(S,{size:2,as:"p",className:n("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:M}),o&&e(fe,{as:B==="4"?"h1":"h2",html:o,className:n("hero-banner-title",x.title),size:B?Number(B||"5"):V==="sm"?4:5}),r&&e(S,{as:"p",size:2,className:n("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm"),html:r}),D&&e("div",{className:"mt-3",children:e(be,{endDate:D,endDate_tz:te,dateFormat:ae,variant:"spacious",align:d})})]}),c("div",{className:Ve({align:d}),children:[a?.isShowPlayVideoButton&&a?.playVideoButtonText?c(P,{onClick:()=>A(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button","data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${o}#${r}#${a?.playVideoButtonText}`,children:[a?.playVideoButtonText," ",e(ze,{size:"lg"})]}):a?.text?c(P,{"aria-label":o??r,size:"lg",variant:"secondary",className:"hero-banner-secondary-button",as:a?.isCustomSecondaryButton?"button":"a",href:R(N(a?.link),`${s}_${i}`),onClick:t=>a?.isCustomSecondaryButton&&O?.(u,t,a?.customSecondaryEventId),"data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${o}#${r}#${a?.text}`,children:[a?.text,e("span",{className:"sr-only",children:o??r})]}):null,l&&l.text&&e(P,{"aria-label":o??r,size:"lg",variant:"primary",className:"hero-banner-primary-button",as:l?.isCustomPrimaryButton?"button":"a",href:R(N(l.link),`${s}_${i}`),onClick:t=>l?.isCustomPrimaryButton&&W?.(u,t,l?.customPrimaryEventId),"data-headless-type-name":`${s}#${i}`,"data-headless-title-desc-button":`${o}#${r}#${l?.text}`,children:l.text})]}),e("div",{className:Be({align:d}),children:ie?.map(t=>e("div",{className:"h-12",children:e(J,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:t?.pcImage?.alt||"",source:t?.pcImage?.url})},t?.pcImage?.url||t?.pcImage?.alt))})]}),z.length>0&&e("div",{className:n("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",x.captionGroup),children:z.map((t,C)=>c(Q.Fragment,{children:[e(S,{size:2,className:n("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:t.title}),C<z.length-1&&e("div",{className:n("bg-info-primary w-px")})]},t.title))}),F&&e(ke,{visible:F,videoUrl:a?.isYoutubeVideo?void 0:a?.videoUrl?.url,youTubeId:a?.isYoutubeVideo?a?.youtubeId:void 0,onCloseModal:()=>A(!1)})]})})});K.displayName="HeroBanner";var qe=xe(K);export{qe as default};
2
2
  //# sourceMappingURL=HeroBanner.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeroBanner/HeroBanner.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState, useEffect } from 'react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { HeroBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useInView } from 'react-intersection-observer'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text, Countdown } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { cva } from 'class-variance-authority'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'hero_banner'\n\n// CVA variants for align\nconst contentVariants = cva(\n 'hero-banner-content laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] absolute top-24 z-10 flex w-full flex-col gap-[24px]',\n {\n variants: {\n align: {\n left: 'tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]',\n center: 'left-1/2 -translate-x-1/2 items-center text-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n }\n)\n\nconst textVariants = cva(\n 'hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]',\n {\n variants: {\n align: {\n left: 'laptop:text-left',\n center: 'text-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n }\n)\n\nconst buttonGroupVariants = cva('hero-banner-button-group lg-desktop:gap-3 flex items-center gap-2', {\n variants: {\n align: {\n left: 'laptop:justify-start',\n center: 'justify-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n})\n\nconst iconGroupVariants = cva('hero-banner-icon-group flex items-center gap-2', {\n variants: {\n align: {\n left: 'justify-start',\n center: 'justify-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n})\n\nexport type HeroBannerSemanticName =\n | 'root'\n | 'title'\n | 'subtitle'\n | 'buttonGroup'\n | 'primaryButton'\n | 'secondaryButton'\n | 'captionGroup'\n\nconst PlayButtonAppendIcon = ({ size = 'base' }: { size: 'base' | 'lg' | 'sm' }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n fill=\"currentcolor\"\n />\n </svg>\n )\n}\n\nconst HeroBanner = React.forwardRef<\n HTMLDivElement,\n HeroBannerProps & {\n classNames?: Partial<Record<HeroBannerSemanticName, string>>\n }\n>(({ data, className, classNames = {}, onSecondaryClick, onPrimaryClick, ...rest }, ref) => {\n const { locale } = useAiuiContext()\n\n // \u5305\u88C5\u94FE\u63A5\uFF0C\u81EA\u52A8\u6DFB\u52A0 locale \u524D\u7F00\n const localizeUrl = (url?: string) => {\n if (!url || !locale) return url\n return getLocalizedPath(url, locale)\n }\n\n const {\n label,\n title,\n subtitle,\n endDate,\n endDate_tz,\n dateFormat,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n isVideoLoop = true,\n primaryButton,\n secondaryButton,\n theme = 'light',\n size = 'default',\n titleSize,\n caption = [],\n blockLink,\n iconArray,\n align = 'left',\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const [visible, setVisible] = useState<boolean>(false)\n const { ref: inViewRef, inView } = useInView()\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const bgTriggerRef = useRef<ScrollTrigger | null>(null)\n const boxTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n boxTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n bgTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n if (inView) gsapResize()\n return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n boxTriggerRef.current && boxTriggerRef.current.kill()\n bgTriggerRef.current && bgTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div {...rest} ref={inViewRef} data-ui-component-id=\"HeroBanner\">\n <div\n ref={boxRef}\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n 'text-info-primary relative w-full overflow-hidden',\n {\n 'lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520] tablet:aspect-[768/660] aspect-[390/660]':\n size === 'default',\n 'lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]':\n size === 'sm',\n },\n className\n )}\n >\n {blockLink && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(localizeUrl(blockLink), `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}`}\n tabIndex={-1}\n aria-hidden=\"true\"\n aria-label={title}\n ></a>\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileImage?.url : isPad ? padImage?.url || mobileImage?.url : pcImage?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop={isVideoLoop}\n playsInline\n />\n ) : (\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n fetchPriority=\"high\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className={contentVariants({ align })}>\n <div className={textVariants({ align })}>\n {label && (\n <Text\n size={2}\n as=\"p\"\n className={cn('hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm')}\n html={label}\n />\n )}\n {title && (\n <Heading\n as={titleSize === '4' ? 'h1' : 'h2'}\n html={title}\n className={cn('hero-banner-title', classNames.title)}\n size={titleSize ? (Number(titleSize || '5') as any) : size === 'sm' ? 4 : 5}\n />\n )}\n {subtitle && (\n <Text\n as=\"p\"\n size={2}\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm'\n )}\n html={subtitle}\n />\n )}\n {endDate && (\n <div className=\"mt-3\">\n <Countdown\n endDate={endDate}\n endDate_tz={endDate_tz}\n dateFormat={dateFormat}\n variant=\"spacious\"\n align={align}\n />\n </div>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className={buttonGroupVariants({ align })}>\n {secondaryButton?.isShowPlayVideoButton && secondaryButton?.playVideoButtonText ? (\n <Button\n onClick={() => setVisible(true)}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-play-video-button\"\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.playVideoButtonText}`}\n >\n {secondaryButton?.playVideoButtonText} <PlayButtonAppendIcon size=\"lg\" />\n </Button>\n ) : secondaryButton?.text ? (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-secondary-button\"\n as={secondaryButton?.isCustomSecondaryButton ? 'button' : 'a'}\n href={trackUrlRef(localizeUrl(secondaryButton?.link), `${componentType}_${componentName}`)}\n onClick={e =>\n secondaryButton?.isCustomSecondaryButton &&\n onSecondaryClick?.(data, e, secondaryButton?.customSecondaryEventId)\n }\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.text}`}\n >\n {secondaryButton?.text}\n <span className=\"sr-only\">{title ?? subtitle}</span>\n </Button>\n ) : null}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"primary\"\n className=\"hero-banner-primary-button\"\n as={primaryButton?.isCustomPrimaryButton ? 'button' : 'a'}\n href={trackUrlRef(localizeUrl(primaryButton.link), `${componentType}_${componentName}`)}\n onClick={e =>\n primaryButton?.isCustomPrimaryButton && onPrimaryClick?.(data, e, primaryButton?.customPrimaryEventId)\n }\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${primaryButton?.text}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n <div className={iconGroupVariants({ align })}>\n {iconArray?.map(icon => (\n <div key={icon?.pcImage?.url || icon?.pcImage?.alt} className=\"h-12\">\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n alt={icon?.pcImage?.alt || ''}\n source={icon?.pcImage?.url}\n />\n </div>\n ))}\n </div>\n </div>\n\n {/* \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */}\n {caption.length > 0 && (\n <div\n className={cn(\n 'hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]',\n classNames.captionGroup\n )}\n >\n {caption.map((c, index) => (\n <React.Fragment key={c.title}>\n <Text\n size={2}\n className={cn(\n 'hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]'\n )}\n html={c.title}\n />\n {index < caption.length - 1 && <div className={cn('bg-info-primary w-px')} />}\n </React.Fragment>\n ))}\n </div>\n )}\n\n {/* \u89C6\u9891\u5F39\u7A97 */}\n {visible && (\n <VideoModal\n visible={visible}\n videoUrl={secondaryButton?.isYoutubeVideo ? undefined : secondaryButton?.videoUrl?.url}\n youTubeId={secondaryButton?.isYoutubeVideo ? secondaryButton?.youtubeId : undefined}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n </div>\n )\n})\n\nHeroBanner.displayName = 'HeroBanner'\n\nexport default withLayout(HeroBanner)\n"],
5
- "mappings": "aA0FM,cAAAA,EAmLI,QAAAC,MAnLJ,oBAzFN,OAAOC,GAAS,uBAAAC,GAAqB,UAAAC,EAAQ,YAAAC,GAAU,aAAAC,OAAiB,QACxE,OAAOC,MAAU,OACjB,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,aAAAC,OAAiB,8BAC1B,OAAOC,OAAqB,mCAC5B,OAAS,UAAAC,EAAQ,WAAAC,GAAS,WAAAC,EAAS,QAAAC,EAAM,aAAAC,OAAiB,4BAC1D,OAAS,MAAAC,MAAU,yBACnB,OAAS,OAAAC,MAAW,2BACpB,OAAS,cAAAC,OAAkB,yBAC3B,OAAS,eAAAC,OAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,oBAAAC,OAAwB,yBACjC,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,WAAAC,OAAe,6BACxB,OAAS,cAAAC,OAAkB,yBAE3B,MAAMC,EAAgB,QAChBC,EAAgB,cAGhBC,GAAkBV,EACtB,wIACA,CACE,SAAU,CACR,MAAO,CACL,KAAM,qFACN,OAAQ,oDACV,CACF,EACA,gBAAiB,CACf,MAAO,MACT,CACF,CACF,EAEMW,GAAeX,EACnB,+HACA,CACE,SAAU,CACR,MAAO,CACL,KAAM,mBACN,OAAQ,aACV,CACF,EACA,gBAAiB,CACf,MAAO,MACT,CACF,CACF,E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AAE,KASvB,CACD,EACH,EAIDf,GACCvE,EAACyB,GAAA,CACC,QAAS8C,EACT,SAAUT,GAAiB,eAAiB,OAAYA,GAAiB,UAAU,IACnF,UAAWA,GAAiB,eAAiBA,GAAiB,UAAY,OAC1E,aAAc,IAAMU,EAAW,EAAK,EACtC,GAEJ,EACF,CAEJ,CAAC,EAEDpC,EAAW,YAAc,aAEzB,IAAOoD,GAAQrE,GAAWiB,CAAU",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState, useEffect } from 'react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { HeroBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useInView } from 'react-intersection-observer'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text, Countdown } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { cva } from 'class-variance-authority'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'hero_banner'\n\n// CVA variants for align\nconst contentVariants = cva(\n 'hero-banner-content lg-desktop:gap-[32px] absolute top-24 z-10 flex w-full flex-col gap-[24px]',\n {\n variants: {\n align: {\n left: 'tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]',\n center:\n 'tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n }\n)\n\nconst textVariants = cva(\n 'hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]',\n {\n variants: {\n align: {\n left: 'laptop:text-left',\n center: 'text-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n }\n)\n\nconst buttonGroupVariants = cva('hero-banner-button-group lg-desktop:gap-3 flex items-center gap-2', {\n variants: {\n align: {\n left: 'laptop:justify-start',\n center: 'justify-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n})\n\nconst iconGroupVariants = cva('hero-banner-icon-group flex items-center gap-2', {\n variants: {\n align: {\n left: 'justify-start',\n center: 'justify-center',\n },\n },\n defaultVariants: {\n align: 'left',\n },\n})\n\nexport type HeroBannerSemanticName =\n | 'root'\n | 'title'\n | 'subtitle'\n | 'buttonGroup'\n | 'primaryButton'\n | 'secondaryButton'\n | 'captionGroup'\n\nconst PlayButtonAppendIcon = ({ size = 'base' }: { size: 'base' | 'lg' | 'sm' }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n fill=\"currentcolor\"\n />\n </svg>\n )\n}\n\nconst HeroBanner = React.forwardRef<\n HTMLDivElement,\n HeroBannerProps & {\n classNames?: Partial<Record<HeroBannerSemanticName, string>>\n }\n>(({ data, className, classNames = {}, onSecondaryClick, onPrimaryClick, ...rest }, ref) => {\n const { locale } = useAiuiContext()\n\n // \u5305\u88C5\u94FE\u63A5\uFF0C\u81EA\u52A8\u6DFB\u52A0 locale \u524D\u7F00\n const localizeUrl = (url?: string) => {\n if (!url || !locale) return url\n return getLocalizedPath(url, locale)\n }\n\n const {\n label,\n title,\n subtitle,\n endDate,\n endDate_tz,\n dateFormat,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n isVideoLoop = true,\n primaryButton,\n secondaryButton,\n theme = 'light',\n size = 'default',\n titleSize,\n caption = [],\n blockLink,\n iconArray,\n align = 'left',\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const [visible, setVisible] = useState<boolean>(false)\n const { ref: inViewRef, inView } = useInView()\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const bgTriggerRef = useRef<ScrollTrigger | null>(null)\n const boxTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n boxTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n bgTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n if (inView) gsapResize()\n return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n boxTriggerRef.current && boxTriggerRef.current.kill()\n bgTriggerRef.current && bgTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div {...rest} ref={inViewRef} data-ui-component-id=\"HeroBanner\">\n <div\n ref={boxRef}\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n 'text-info-primary relative w-full overflow-hidden',\n {\n 'lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520] tablet:aspect-[768/660] aspect-[390/660]':\n size === 'default',\n 'lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]':\n size === 'sm',\n },\n className\n )}\n >\n {blockLink && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(localizeUrl(blockLink), `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}`}\n tabIndex={-1}\n aria-hidden=\"true\"\n aria-label={title}\n ></a>\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileImage?.url : isPad ? padImage?.url || mobileImage?.url : pcImage?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop={isVideoLoop}\n playsInline\n />\n ) : (\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n fetchPriority=\"high\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className={contentVariants({ align })}>\n <div className={textVariants({ align })}>\n {label && (\n <Text\n size={2}\n as=\"p\"\n className={cn('hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm')}\n html={label}\n />\n )}\n {title && (\n <Heading\n as={titleSize === '4' ? 'h1' : 'h2'}\n html={title}\n className={cn('hero-banner-title', classNames.title)}\n size={titleSize ? (Number(titleSize || '5') as any) : size === 'sm' ? 4 : 5}\n />\n )}\n {subtitle && (\n <Text\n as=\"p\"\n size={2}\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm'\n )}\n html={subtitle}\n />\n )}\n {endDate && (\n <div className=\"mt-3\">\n <Countdown\n endDate={endDate}\n endDate_tz={endDate_tz}\n dateFormat={dateFormat}\n variant=\"spacious\"\n align={align}\n />\n </div>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className={buttonGroupVariants({ align })}>\n {secondaryButton?.isShowPlayVideoButton && secondaryButton?.playVideoButtonText ? (\n <Button\n onClick={() => setVisible(true)}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-play-video-button\"\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.playVideoButtonText}`}\n >\n {secondaryButton?.playVideoButtonText} <PlayButtonAppendIcon size=\"lg\" />\n </Button>\n ) : secondaryButton?.text ? (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-secondary-button\"\n as={secondaryButton?.isCustomSecondaryButton ? 'button' : 'a'}\n href={trackUrlRef(localizeUrl(secondaryButton?.link), `${componentType}_${componentName}`)}\n onClick={e =>\n secondaryButton?.isCustomSecondaryButton &&\n onSecondaryClick?.(data, e, secondaryButton?.customSecondaryEventId)\n }\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.text}`}\n >\n {secondaryButton?.text}\n <span className=\"sr-only\">{title ?? subtitle}</span>\n </Button>\n ) : null}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"primary\"\n className=\"hero-banner-primary-button\"\n as={primaryButton?.isCustomPrimaryButton ? 'button' : 'a'}\n href={trackUrlRef(localizeUrl(primaryButton.link), `${componentType}_${componentName}`)}\n onClick={e =>\n primaryButton?.isCustomPrimaryButton && onPrimaryClick?.(data, e, primaryButton?.customPrimaryEventId)\n }\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${primaryButton?.text}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n <div className={iconGroupVariants({ align })}>\n {iconArray?.map(icon => (\n <div key={icon?.pcImage?.url || icon?.pcImage?.alt} className=\"h-12\">\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n alt={icon?.pcImage?.alt || ''}\n source={icon?.pcImage?.url}\n />\n </div>\n ))}\n </div>\n </div>\n\n {/* \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */}\n {caption.length > 0 && (\n <div\n className={cn(\n 'hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]',\n classNames.captionGroup\n )}\n >\n {caption.map((c, index) => (\n <React.Fragment key={c.title}>\n <Text\n size={2}\n className={cn(\n 'hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]'\n )}\n html={c.title}\n />\n {index < caption.length - 1 && <div className={cn('bg-info-primary w-px')} />}\n </React.Fragment>\n ))}\n </div>\n )}\n\n {/* \u89C6\u9891\u5F39\u7A97 */}\n {visible && (\n <VideoModal\n visible={visible}\n videoUrl={secondaryButton?.isYoutubeVideo ? undefined : secondaryButton?.videoUrl?.url}\n youTubeId={secondaryButton?.isYoutubeVideo ? secondaryButton?.youtubeId : undefined}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n </div>\n )\n})\n\nHeroBanner.displayName = 'HeroBanner'\n\nexport default withLayout(HeroBanner)\n"],
5
+ "mappings": "aA2FM,cAAAA,EAmLI,QAAAC,MAnLJ,oBA1FN,OAAOC,GAAS,uBAAAC,GAAqB,UAAAC,EAAQ,YAAAC,GAAU,aAAAC,OAAiB,QACxE,OAAOC,MAAU,OACjB,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,aAAAC,OAAiB,8BAC1B,OAAOC,OAAqB,mCAC5B,OAAS,UAAAC,EAAQ,WAAAC,GAAS,WAAAC,EAAS,QAAAC,EAAM,aAAAC,OAAiB,4BAC1D,OAAS,MAAAC,MAAU,yBACnB,OAAS,OAAAC,MAAW,2BACpB,OAAS,cAAAC,OAAkB,yBAC3B,OAAS,eAAAC,OAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,oBAAAC,OAAwB,yBACjC,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,WAAAC,OAAe,6BACxB,OAAS,cAAAC,OAAkB,yBAE3B,MAAMC,EAAgB,QAChBC,EAAgB,cAGhBC,GAAkBV,EACtB,iGACA,CACE,SAAU,CACR,MAAO,CACL,KAAM,4HACN,OACE,4JACJ,CACF,EACA,gBAAiB,CACf,MAAO,MACT,CACF,CACF,EAEMW,GAAeX,EACnB,+HACA,CACE,SAAU,CACR,MAAO,CACL,KAAM,mBACN,OAAQ,aACV,CACF,EACA,gBAAiB,CACf,MAAO,MACT,CACF,CACF,EAEMY,GAAsBZ,EAAI,oEAAqE,CACnG,SAAU,CACR,MAAO,CACL,KAAM,uBACN,OAAQ,gBACV,CACF,EACA,gBAAiB,CACf,MAAO,MACT,CACF,CAAC,EAEKa,GAAoBb,EAAI,iDA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C1E,aAAc,IAAMU,EAAW,EAAK,EACtC,GAEJ,EACF,CAEJ,CAAC,EAEDpC,EAAW,YAAc,aAEzB,IAAOoD,GAAQrE,GAAWiB,CAAU",
6
6
  "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useState", "useEffect", "gsap", "ScrollTrigger", "useMediaQuery", "useInView", "ScrollLoadVideo", "Button", "Heading", "Picture", "Text", "Countdown", "cn", "cva", "withLayout", "useExposure", "trackUrlRef", "getLocalizedPath", "useAiuiContext", "sizeMap", "VideoModal", "componentType", "componentName", "contentVariants", "textVariants", "buttonGroupVariants", "iconGroupVariants", "PlayButtonAppendIcon", "size", "width", "height", "HeroBanner", "data", "className", "classNames", "onSecondaryClick", "onPrimaryClick", "rest", "ref", "locale", "localizeUrl", "url", "label", "title", "subtitle", "endDate", "endDate_tz", "dateFormat", "pcImage", "padImage", "mobileImage", "pcVideo", "padVideo", "mobileVideo", "isShowVideo", "isVideoLoop", "primaryButton", "secondaryButton", "theme", "titleSize", "caption", "blockLink", "iconArray", "align", "isMobile", "isPad", "visible", "setVisible", "inViewRef", "inView", "scrollTriggerRef", "bgTriggerRef", "boxTriggerRef", "bgRef", "boxRef", "gsapResize", "clientHeight", "self", "value", "e", "icon", "c", "index", "HeroBanner_default"]
7
7
  }
@@ -62,6 +62,6 @@ export interface ImageOverlayShelfComponent extends React.ForwardRefExoticCompon
62
62
  /** 独立的 ProductCard 组件 */
63
63
  ProductCard: typeof ProductCard;
64
64
  }
65
- declare const ImageOverlayShelfWithProductCard: ImageOverlayShelfComponent;
66
65
  export { ProductCard };
67
- export default ImageOverlayShelfWithProductCard;
66
+ declare const ImageOverlayShelfWrapped: any;
67
+ export default ImageOverlayShelfWrapped;
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as L}from"react/jsx-runtime";import*as p from"react";import{cn as n}from"../../helpers/utils.js";import{Swiper as D,SwiperSlide as M}from"swiper/react";import"swiper/css";import{Text as N}from"../../components/text.js";import{Heading as R}from"../../components/heading.js";import{forwardRef as F}from"react";import i from"./ProductCard.js";import{useExposure as H}from"../../hooks/useExposure.js";const k="shelf",E="image_overlay_shelf",c=F(({data:e,onLearnMore:l,onShopNow:m,onAddToCart:u,onProductImageClick:f,classNames:r,copy:y,breakpoints:P,className:g="",...h},C)=>{const a=p.useRef(null);H(a,{componentType:k,componentName:E,componentTitle:e.title,componentDescription:e.description}),p.useImperativeHandle(C,()=>a.current);const{productsCard:o=[],showTags:v=!0,showOriginalPrice:w=!0,secondaryButtonText:S,secondaryButtonFun:T,primaryButtonText:x,primaryButtonFun:B}=e,O={showTags:v,showOriginalPrice:w,secondaryButtonText:S,secondaryButtonFun:T,primaryButtonText:x,primaryButtonFun:B,onLearnMore:l,onShopNow:m,onAddToCart:u,onProductImageClick:f,classNames:r,copy:y},I={0:{spaceBetween:12,slidesPerView:1.2},768:{spaceBetween:16,slidesPerView:o.length<=2?2:2.2},1024:{spaceBetween:16,slidesPerView:o.length<=2?2:3},1440:{spaceBetween:16,slidesPerView:Math.max(2,Math.min(4,o.length))}};return L("div",{ref:a,className:n("collection-shelves-wrap w-full",g,r?.root),...h,children:[e.title&&t(R,{as:"h2",size:4,className:n("text-info-primary mb-4",r?.title),children:e.title}),e.description&&t(N,{size:3,as:"p",className:n("text-info-primary mb-6",r?.description),children:e.description}),t(D,{spaceBetween:16,slidesPerView:"auto",className:"!overflow-visible",breakpoints:P||I,children:o.map((s,b)=>t(M,{children:t(i,{product:s,...O})},s.sku||b))})]})});c.displayName="ImageOverlayShelf";const d=c;d.ProductCard=i;var J=d;export{i as ProductCard,J as default};
1
+ "use client";import{jsx as t,jsxs as A}from"react/jsx-runtime";import*as p from"react";import{cn as n}from"../../helpers/utils.js";import{withLayout as D}from"../../shared/Styles.js";import{Swiper as M,SwiperSlide as N}from"swiper/react";import"swiper/css";import{Text as R}from"../../components/text.js";import{Heading as F}from"../../components/heading.js";import{forwardRef as H}from"react";import i from"./ProductCard.js";import{useExposure as L}from"../../hooks/useExposure.js";const k="shelf",E="image_overlay_shelf",c=H(({data:e,onLearnMore:l,onShopNow:m,onAddToCart:u,onProductImageClick:f,classNames:r,copy:y,breakpoints:P,className:g="",...h},v)=>{const a=p.useRef(null);L(a,{componentType:k,componentName:E,componentTitle:e.title,componentDescription:e.description}),p.useImperativeHandle(v,()=>a.current);const{productsCard:o=[],showTags:C=!0,showOriginalPrice:w=!0,secondaryButtonText:S,secondaryButtonFun:T,primaryButtonText:x,primaryButtonFun:B}=e,O={showTags:C,showOriginalPrice:w,secondaryButtonText:S,secondaryButtonFun:T,primaryButtonText:x,primaryButtonFun:B,onLearnMore:l,onShopNow:m,onAddToCart:u,onProductImageClick:f,classNames:r,copy:y},I={0:{spaceBetween:12,slidesPerView:1.2},768:{spaceBetween:16,slidesPerView:o.length<=2?2:2.2},1024:{spaceBetween:16,slidesPerView:o.length<=2?2:3},1440:{spaceBetween:16,slidesPerView:Math.max(2,Math.min(4,o.length))}};return A("div",{ref:a,className:n("collection-shelves-wrap w-full",g,r?.root),...h,children:[e.title&&t(F,{as:"h2",size:4,className:n("text-info-primary mb-4",r?.title),children:e.title}),e.description&&t(R,{size:3,as:"p",className:n("text-info-primary mb-6",r?.description),children:e.description}),t(M,{spaceBetween:16,slidesPerView:"auto",className:"!overflow-visible",breakpoints:P||I,children:o.map((s,b)=>t(N,{children:t(i,{product:s,...O})},s.sku||b))})]})});c.displayName="ImageOverlayShelf";const d=c;d.ProductCard=i;const V=D(d);var U=V;export{i as ProductCard,U as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ImageOverlayShelf/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport 'swiper/css'\n\nimport { Text } from '../../components/text.js'\nimport { Heading } from '../../components/heading.js'\nimport { forwardRef } from 'react'\n\nimport ProductCard from './ProductCard.js'\nimport type {\n ProductCardData,\n ProductCardProps,\n ButtonFunctionType,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n} from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst componentType = 'shelf'\nconst componentName = 'image_overlay_shelf'\n\n// Re-export types for external use\nexport type {\n ButtonFunctionType,\n ProductCardData,\n ProductCardProps,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n ImageObjectPosition,\n} from './types.js'\n\n/**\n * ImageOverlayShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface ImageOverlayShelfData {\n /** \u7EC4\u4EF6\u6807\u9898 */\n title?: string\n /** \u7EC4\u4EF6\u63CF\u8FF0 */\n description?: string\n /** \u4EA7\u54C1\u5217\u8868 */\n productsCard: ProductCardData[]\n /** \u662F\u5426\u663E\u793A\u6807\u7B7E */\n showTags?: boolean\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u529F\u80FD */\n secondaryButtonFun?: ButtonFunctionType\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u529F\u80FD */\n primaryButtonFun?: ButtonFunctionType\n}\n\n/**\n * ImageOverlayShelf Props \u63A5\u53E3\n */\nexport interface ImageOverlayShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: ImageOverlayShelfData\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u4EA7\u54C1\u56FE\u7247\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<ImageOverlayShelfSemanticName, string>>\n /** \u6837\u5F0F\u7C7B\u540D */\n className?: string\n /** \u6587\u6848\u914D\u7F6E */\n copy?: CopyConfig\n /** \u65AD\u70B9\u914D\u7F6E */\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n}\n\n/**\n * ImageOverlayShelf \u590D\u5408\u7EC4\u4EF6\u7C7B\u578B\u5B9A\u4E49\n */\nexport interface ImageOverlayShelfComponent extends React.ForwardRefExoticComponent<\n ImageOverlayShelfProps & React.RefAttributes<HTMLDivElement>\n> {\n /** \u72EC\u7ACB\u7684 ProductCard \u7EC4\u4EF6 */\n ProductCard: typeof ProductCard\n}\n\n/**\n * \u5171\u4EAB Props \u7C7B\u578B\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n */\ntype SharedProductCardProps = Omit<ProductCardProps, 'product' | 'className'>\n\nconst ImageOverlayShelf = forwardRef<HTMLDivElement, ImageOverlayShelfProps>(\n (\n {\n data,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n breakpoints,\n className = '',\n ...props\n },\n ref\n ) => {\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: data.title,\n componentDescription: data.description,\n })\n\n React.useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const {\n productsCard: products = [],\n showTags = true,\n showOriginalPrice = true,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n } = data\n\n // \u6784\u5EFA\u5171\u4EAB props\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n const sharedProps: SharedProductCardProps = {\n showTags,\n showOriginalPrice,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n }\n\n // \u9ED8\u8BA4\u65AD\u70B9\u914D\u7F6E\n const defaultBreakpoints = {\n 0: {\n spaceBetween: 12,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: products.length <= 2 ? 2 : 2.2,\n },\n 1024: {\n spaceBetween: 16,\n slidesPerView: products.length <= 2 ? 2 : 3,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: Math.max(2, Math.min(4, products.length)),\n },\n }\n\n return (\n <div ref={boxRef} className={cn('collection-shelves-wrap w-full', className, classNames?.root)} {...props}>\n {/* \u6807\u9898\u533A\u57DF */}\n {data.title && (\n <Heading as=\"h2\" size={4} className={cn('text-info-primary mb-4', classNames?.title)}>\n {data.title}\n </Heading>\n )}\n {data.description && (\n <Text size={3} as=\"p\" className={cn('text-info-primary mb-6', classNames?.description)}>\n {data.description}\n </Text>\n )}\n\n {/* Swiper \u6A2A\u5411\u6ED1\u52A8\u5E03\u5C40 */}\n <Swiper\n spaceBetween={16}\n slidesPerView=\"auto\"\n className=\"!overflow-visible\"\n breakpoints={breakpoints || defaultBreakpoints}\n >\n {products.map((product, index) => (\n <SwiperSlide key={product.sku || index}>\n <ProductCard product={product} {...sharedProps} />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n )\n }\n)\n\nImageOverlayShelf.displayName = 'ImageOverlayShelf'\n\n// \u521B\u5EFA\u590D\u5408\u7EC4\u4EF6\nconst ImageOverlayShelfWithProductCard = ImageOverlayShelf as ImageOverlayShelfComponent\nImageOverlayShelfWithProductCard.ProductCard = ProductCard\n\nexport { ProductCard }\nexport default ImageOverlayShelfWithProductCard\n"],
5
- "mappings": "aAiLM,OAGI,OAAAA,EAHJ,QAAAC,MAAA,oBAhLN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CACF,EAEA,OACEzB,EAAC,OAAI,IAAKwB,EAAQ,UAAWtB,EAAG,iCAAkCmB,EAAWH,GAAY,IAAI,EAAI,GAAGI,EAEjG,UAAAT,EAAK,OACJd,EAACO,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,UAAWJ,EAAG,yBAA0BgB,GAAY,KAAK,EAChF,SAAAL,EAAK,MACR,EAEDA,EAAK,aACJd,EAACM,EAAA,CAAK,KAAM,EAAG,GAAG,IAAI,UAAWH,EAAG,yBAA0BgB,GAAY,WAAW,EAClF,SAAAL,EAAK,YACR,EAIFd,EAACI,EAAA,CACC,aAAc,GACd,cAAc,OACd,UAAU,oBACV,YAAaiB,GAAea,EAE3B,SAAAR,EAAS,IAAI,CAACS,EAASC,IACtBpC,EAACK,EAAA,CACC,SAAAL,EAACS,EAAA,CAAY,QAAS0B,EAAU,GAAGF,EAAa,GADhCE,EAAQ,KAAOC,CAEjC,CACD,EACH,GACF,CAEJ,CACF,EAEAvB,EAAkB,YAAc,oBAGhC,MAAMwB,EAAmCxB,EACzCwB,EAAiC,YAAc5B,EAG/C,IAAO6B,EAAQD",
6
- "names": ["jsx", "jsxs", "React", "cn", "Swiper", "SwiperSlide", "Text", "Heading", "forwardRef", "ProductCard", "useExposure", "componentType", "componentName", "ImageOverlayShelf", "data", "onLearnMore", "onShopNow", "onAddToCart", "onProductImageClick", "classNames", "copy", "breakpoints", "className", "props", "ref", "boxRef", "products", "showTags", "showOriginalPrice", "secondaryButtonText", "secondaryButtonFun", "primaryButtonText", "primaryButtonFun", "sharedProps", "defaultBreakpoints", "product", "index", "ImageOverlayShelfWithProductCard", "ImageOverlayShelf_default"]
4
+ "sourcesContent": ["'use client'\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport 'swiper/css'\n\nimport { Text } from '../../components/text.js'\nimport { Heading } from '../../components/heading.js'\nimport { forwardRef } from 'react'\n\nimport ProductCard from './ProductCard.js'\nimport type {\n ProductCardData,\n ProductCardProps,\n ButtonFunctionType,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n} from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst componentType = 'shelf'\nconst componentName = 'image_overlay_shelf'\n\n// Re-export types for external use\nexport type {\n ButtonFunctionType,\n ProductCardData,\n ProductCardProps,\n ImageOverlayShelfSemanticName,\n CopyConfig,\n ImageObjectPosition,\n} from './types.js'\n\n/**\n * ImageOverlayShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface ImageOverlayShelfData {\n /** \u7EC4\u4EF6\u6807\u9898 */\n title?: string\n /** \u7EC4\u4EF6\u63CF\u8FF0 */\n description?: string\n /** \u4EA7\u54C1\u5217\u8868 */\n productsCard: ProductCardData[]\n /** \u662F\u5426\u663E\u793A\u6807\u7B7E */\n showTags?: boolean\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7 */\n showOriginalPrice?: boolean\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u529F\u80FD */\n secondaryButtonFun?: ButtonFunctionType\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u529F\u80FD */\n primaryButtonFun?: ButtonFunctionType\n}\n\n/**\n * ImageOverlayShelf Props \u63A5\u53E3\n */\nexport interface ImageOverlayShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: ImageOverlayShelfData\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u4EA7\u54C1\u56FE\u7247\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<ImageOverlayShelfSemanticName, string>>\n /** \u6837\u5F0F\u7C7B\u540D */\n className?: string\n /** \u6587\u6848\u914D\u7F6E */\n copy?: CopyConfig\n /** \u65AD\u70B9\u914D\u7F6E */\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n}\n\n/**\n * ImageOverlayShelf \u590D\u5408\u7EC4\u4EF6\u7C7B\u578B\u5B9A\u4E49\n */\nexport interface ImageOverlayShelfComponent extends React.ForwardRefExoticComponent<\n ImageOverlayShelfProps & React.RefAttributes<HTMLDivElement>\n> {\n /** \u72EC\u7ACB\u7684 ProductCard \u7EC4\u4EF6 */\n ProductCard: typeof ProductCard\n}\n\n/**\n * \u5171\u4EAB Props \u7C7B\u578B\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n */\ntype SharedProductCardProps = Omit<ProductCardProps, 'product' | 'className'>\n\nconst ImageOverlayShelf = forwardRef<HTMLDivElement, ImageOverlayShelfProps>(\n (\n {\n data,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n breakpoints,\n className = '',\n ...props\n },\n ref\n ) => {\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: data.title,\n componentDescription: data.description,\n })\n\n React.useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const {\n productsCard: products = [],\n showTags = true,\n showOriginalPrice = true,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n } = data\n\n // \u6784\u5EFA\u5171\u4EAB props\uFF08\u900F\u4F20\u7ED9 ProductCard\uFF09\n const sharedProps: SharedProductCardProps = {\n showTags,\n showOriginalPrice,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n onLearnMore,\n onShopNow,\n onAddToCart,\n onProductImageClick,\n classNames,\n copy,\n }\n\n // \u9ED8\u8BA4\u65AD\u70B9\u914D\u7F6E\n const defaultBreakpoints = {\n 0: {\n spaceBetween: 12,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: products.length <= 2 ? 2 : 2.2,\n },\n 1024: {\n spaceBetween: 16,\n slidesPerView: products.length <= 2 ? 2 : 3,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: Math.max(2, Math.min(4, products.length)),\n },\n }\n\n return (\n <div ref={boxRef} className={cn('collection-shelves-wrap w-full', className, classNames?.root)} {...props}>\n {/* \u6807\u9898\u533A\u57DF */}\n {data.title && (\n <Heading as=\"h2\" size={4} className={cn('text-info-primary mb-4', classNames?.title)}>\n {data.title}\n </Heading>\n )}\n {data.description && (\n <Text size={3} as=\"p\" className={cn('text-info-primary mb-6', classNames?.description)}>\n {data.description}\n </Text>\n )}\n\n {/* Swiper \u6A2A\u5411\u6ED1\u52A8\u5E03\u5C40 */}\n <Swiper\n spaceBetween={16}\n slidesPerView=\"auto\"\n className=\"!overflow-visible\"\n breakpoints={breakpoints || defaultBreakpoints}\n >\n {products.map((product, index) => (\n <SwiperSlide key={product.sku || index}>\n <ProductCard product={product} {...sharedProps} />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n )\n }\n)\n\nImageOverlayShelf.displayName = 'ImageOverlayShelf'\n\n// \u521B\u5EFA\u590D\u5408\u7EC4\u4EF6\nconst ImageOverlayShelfWithProductCard = ImageOverlayShelf as ImageOverlayShelfComponent\nImageOverlayShelfWithProductCard.ProductCard = ProductCard\n\nexport { ProductCard }\nconst ImageOverlayShelfWrapped = withLayout(ImageOverlayShelfWithProductCard)\nexport default ImageOverlayShelfWrapped\n"],
5
+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J,aAAc,GACd,cAAe,KAAK,IAAI,EAAG,KAAK,IAAI,EAAGA,EAAS,MAAM,CAAC,CACzD,CACF,EAEA,OACE1B,EAAC,OAAI,IAAKyB,EAAQ,UAAWvB,EAAG,iCAAkCoB,EAAWH,GAAY,IAAI,EAAI,GAAGI,EAEjG,UAAAT,EAAK,OACJf,EAACQ,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,UAAWL,EAAG,yBAA0BiB,GAAY,KAAK,EAChF,SAAAL,EAAK,MACR,EAEDA,EAAK,aACJf,EAACO,EAAA,CAAK,KAAM,EAAG,GAAG,IAAI,UAAWJ,EAAG,yBAA0BiB,GAAY,WAAW,EAClF,SAAAL,EAAK,YACR,EAIFf,EAACK,EAAA,CACC,aAAc,GACd,cAAc,OACd,UAAU,oBACV,YAAaiB,GAAea,EAE3B,SAAAR,EAAS,IAAI,CAACS,EAASC,IACtBrC,EAACM,EAAA,CACC,SAAAN,EAACU,EAAA,CAAY,QAAS0B,EAAU,GAAGF,EAAa,GADhCE,EAAQ,KAAOC,CAEjC,CACD,EACH,GACF,CAEJ,CACF,EAEAvB,EAAkB,YAAc,oBAGhC,MAAMwB,EAAmCxB,EACzCwB,EAAiC,YAAc5B,EAG/C,MAAM6B,EAA2BnC,EAAWkC,CAAgC,EAC5E,IAAOE,EAAQD",
6
+ "names": ["jsx", "jsxs", "React", "cn", "withLayout", "Swiper", "SwiperSlide", "Text", "Heading", "forwardRef", "ProductCard", "useExposure", "componentType", "componentName", "ImageOverlayShelf", "data", "onLearnMore", "onShopNow", "onAddToCart", "onProductImageClick", "classNames", "copy", "breakpoints", "className", "props", "ref", "boxRef", "products", "showTags", "showOriginalPrice", "secondaryButtonText", "secondaryButtonFun", "primaryButtonText", "primaryButtonFun", "sharedProps", "defaultBreakpoints", "product", "index", "ImageOverlayShelfWithProductCard", "ImageOverlayShelfWrapped", "ImageOverlayShelf_default"]
7
7
  }