@anker-in/headless-ui 1.0.10-temp-onclick → 1.0.10-temp-21

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 (177) hide show
  1. package/dist/cjs/apps/playground/utils/classnames.d.ts +1 -0
  2. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  3. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  4. package/dist/cjs/biz-components/AccordionCards/useDebounce.d.ts +6 -0
  5. package/dist/cjs/biz-components/CreativeModule/index.d.ts +2 -2
  6. package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
  7. package/dist/cjs/biz-components/CreativeModule/index.js.map +3 -3
  8. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  9. package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
  10. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  11. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  12. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +8 -0
  13. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +2 -0
  14. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +7 -0
  15. package/dist/cjs/biz-components/GraphicOverlay/index.d.ts +2 -0
  16. package/dist/cjs/biz-components/GraphicOverlay/index.js +2 -0
  17. package/dist/cjs/biz-components/GraphicOverlay/index.js.map +7 -0
  18. package/dist/cjs/biz-components/GraphicOverlay/types.d.ts +33 -0
  19. package/dist/cjs/biz-components/GraphicOverlay/types.js +2 -0
  20. package/dist/cjs/biz-components/GraphicOverlay/types.js.map +7 -0
  21. package/dist/cjs/biz-components/MediaPlayerMulti/YouTubePlayer.d.ts +3 -0
  22. package/dist/cjs/biz-components/SectionHeading/SectionHeading.d.ts +4 -0
  23. package/dist/cjs/biz-components/SectionHeading/types.d.ts +6 -0
  24. package/dist/cjs/biz-components/Shelf/Shelf.d.ts +8 -0
  25. package/dist/cjs/biz-components/Shelf/index.d.ts +1 -0
  26. package/dist/cjs/biz-components/Shelf/types.d.ts +6 -0
  27. package/dist/cjs/biz-components/ShelfDisplay/index.js +2 -2
  28. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +2 -2
  29. package/dist/cjs/biz-components/ShelfDisplay/tab.d.ts +7 -0
  30. package/dist/cjs/biz-components/Title/index.js +1 -1
  31. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  32. package/dist/cjs/biz-components/Title/types.d.ts +3 -2
  33. package/dist/cjs/biz-components/Title/types.js +1 -1
  34. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  35. package/dist/cjs/biz-components/index.d.ts +1 -0
  36. package/dist/cjs/biz-components/index.js +1 -1
  37. package/dist/cjs/biz-components/index.js.map +3 -3
  38. package/dist/cjs/components/col.d.ts +29 -0
  39. package/dist/cjs/components/dropdown.d.ts +27 -0
  40. package/dist/cjs/components/row.d.ts +18 -0
  41. package/dist/cjs/helpers/get-subtree.d.ts +12 -0
  42. package/dist/cjs/packages/ui/src/components/avatar.d.ts +26 -0
  43. package/dist/cjs/packages/ui/src/components/index.d.ts +20 -0
  44. package/dist/cjs/packages/ui/src/index.d.ts +1 -0
  45. package/dist/cjs/packages/ui/src/stories/avatar.stories.d.ts +40 -0
  46. package/dist/cjs/packages/ui/src/stories/badge.stories.d.ts +26 -0
  47. package/dist/cjs/packages/ui/src/stories/button.stories.d.ts +48 -0
  48. package/dist/cjs/packages/ui/src/stories/checkbox.stories.d.ts +46 -0
  49. package/dist/cjs/packages/ui/src/stories/container.stories.d.ts +36 -0
  50. package/dist/cjs/packages/ui/src/stories/dialog.stories.d.ts +20 -0
  51. package/dist/cjs/packages/ui/src/stories/grid.stories.d.ts +42 -0
  52. package/dist/cjs/packages/ui/src/stories/heading.stories.d.ts +82 -0
  53. package/dist/cjs/packages/ui/src/stories/input.stories.d.ts +35 -0
  54. package/dist/cjs/packages/ui/src/stories/picture.stories.d.ts +18 -0
  55. package/dist/cjs/packages/ui/src/stories/popover.stories.d.ts +17 -0
  56. package/dist/cjs/packages/ui/src/stories/radio.stories.d.ts +39 -0
  57. package/dist/cjs/packages/ui/src/stories/skeleton.stories.d.ts +20 -0
  58. package/dist/cjs/packages/ui/src/stories/text.stories.d.ts +94 -0
  59. package/dist/cjs/src/components/index.d.ts +21 -0
  60. package/dist/cjs/src/components/input-number.d.ts +47 -0
  61. package/dist/cjs/src/index.d.ts +1 -0
  62. package/dist/cjs/src/stories/avatar.stories.d.ts +40 -0
  63. package/dist/cjs/src/stories/badge.stories.d.ts +26 -0
  64. package/dist/cjs/src/stories/button.stories.d.ts +48 -0
  65. package/dist/cjs/src/stories/checkbox.stories.d.ts +46 -0
  66. package/dist/cjs/src/stories/container.stories.d.ts +36 -0
  67. package/dist/cjs/src/stories/dialog.stories.d.ts +20 -0
  68. package/dist/cjs/src/stories/grid.stories.d.ts +42 -0
  69. package/dist/cjs/src/stories/heading.stories.d.ts +82 -0
  70. package/dist/cjs/src/stories/input-number.stories.d.ts +51 -0
  71. package/dist/cjs/src/stories/input.stories.d.ts +35 -0
  72. package/dist/cjs/src/stories/picture.stories.d.ts +18 -0
  73. package/dist/cjs/src/stories/popover.stories.d.ts +17 -0
  74. package/dist/cjs/src/stories/radio.stories.d.ts +39 -0
  75. package/dist/cjs/src/stories/skeleton.stories.d.ts +20 -0
  76. package/dist/cjs/src/stories/text.stories.d.ts +94 -0
  77. package/dist/cjs/stories/creativeModule.stories.d.ts +2 -1
  78. package/dist/cjs/stories/creativeModule.stories.js +1 -1
  79. package/dist/cjs/stories/creativeModule.stories.js.map +2 -2
  80. package/dist/cjs/stories/shelf.stories.d.ts +17 -0
  81. package/dist/cjs/tailwind.config.d.ts +253 -0
  82. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  83. package/dist/esm/apps/playground/utils/classnames.d.ts +1 -0
  84. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  85. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  86. package/dist/esm/biz-components/AccordionCards/useDebounce.d.ts +6 -0
  87. package/dist/esm/biz-components/CreativeModule/index.d.ts +2 -2
  88. package/dist/esm/biz-components/CreativeModule/index.js +1 -1
  89. package/dist/esm/biz-components/CreativeModule/index.js.map +3 -3
  90. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  91. package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
  92. package/dist/esm/biz-components/Graphic/index.js +1 -1
  93. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  94. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +8 -0
  95. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +2 -0
  96. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +7 -0
  97. package/dist/esm/biz-components/GraphicOverlay/index.d.ts +2 -0
  98. package/dist/esm/biz-components/GraphicOverlay/index.js +2 -0
  99. package/dist/esm/biz-components/GraphicOverlay/index.js.map +7 -0
  100. package/dist/esm/biz-components/GraphicOverlay/types.d.ts +33 -0
  101. package/dist/esm/biz-components/GraphicOverlay/types.js +1 -0
  102. package/dist/esm/biz-components/GraphicOverlay/types.js.map +7 -0
  103. package/dist/esm/biz-components/MediaPlayerMulti/YouTubePlayer.d.ts +3 -0
  104. package/dist/esm/biz-components/SectionHeading/SectionHeading.d.ts +4 -0
  105. package/dist/esm/biz-components/SectionHeading/types.d.ts +6 -0
  106. package/dist/esm/biz-components/Shelf/Shelf.d.ts +8 -0
  107. package/dist/esm/biz-components/Shelf/index.d.ts +1 -0
  108. package/dist/esm/biz-components/Shelf/types.d.ts +6 -0
  109. package/dist/esm/biz-components/ShelfDisplay/index.js +3 -3
  110. package/dist/esm/biz-components/ShelfDisplay/index.js.map +2 -2
  111. package/dist/esm/biz-components/ShelfDisplay/tab.d.ts +7 -0
  112. package/dist/esm/biz-components/Title/index.js +1 -1
  113. package/dist/esm/biz-components/Title/index.js.map +3 -3
  114. package/dist/esm/biz-components/Title/types.d.ts +3 -2
  115. package/dist/esm/biz-components/index.d.ts +1 -0
  116. package/dist/esm/biz-components/index.js +1 -1
  117. package/dist/esm/biz-components/index.js.map +2 -2
  118. package/dist/esm/components/col.d.ts +29 -0
  119. package/dist/esm/components/dropdown.d.ts +27 -0
  120. package/dist/esm/components/row.d.ts +18 -0
  121. package/dist/esm/helpers/get-subtree.d.ts +12 -0
  122. package/dist/esm/packages/ui/src/components/avatar.d.ts +26 -0
  123. package/dist/esm/packages/ui/src/components/index.d.ts +20 -0
  124. package/dist/esm/packages/ui/src/index.d.ts +1 -0
  125. package/dist/esm/packages/ui/src/stories/avatar.stories.d.ts +40 -0
  126. package/dist/esm/packages/ui/src/stories/badge.stories.d.ts +26 -0
  127. package/dist/esm/packages/ui/src/stories/button.stories.d.ts +48 -0
  128. package/dist/esm/packages/ui/src/stories/checkbox.stories.d.ts +46 -0
  129. package/dist/esm/packages/ui/src/stories/container.stories.d.ts +36 -0
  130. package/dist/esm/packages/ui/src/stories/dialog.stories.d.ts +20 -0
  131. package/dist/esm/packages/ui/src/stories/grid.stories.d.ts +42 -0
  132. package/dist/esm/packages/ui/src/stories/heading.stories.d.ts +82 -0
  133. package/dist/esm/packages/ui/src/stories/input.stories.d.ts +35 -0
  134. package/dist/esm/packages/ui/src/stories/picture.stories.d.ts +18 -0
  135. package/dist/esm/packages/ui/src/stories/popover.stories.d.ts +17 -0
  136. package/dist/esm/packages/ui/src/stories/radio.stories.d.ts +39 -0
  137. package/dist/esm/packages/ui/src/stories/skeleton.stories.d.ts +20 -0
  138. package/dist/esm/packages/ui/src/stories/text.stories.d.ts +94 -0
  139. package/dist/esm/src/components/index.d.ts +21 -0
  140. package/dist/esm/src/components/input-number.d.ts +47 -0
  141. package/dist/esm/src/index.d.ts +1 -0
  142. package/dist/esm/src/stories/avatar.stories.d.ts +40 -0
  143. package/dist/esm/src/stories/badge.stories.d.ts +26 -0
  144. package/dist/esm/src/stories/button.stories.d.ts +48 -0
  145. package/dist/esm/src/stories/checkbox.stories.d.ts +46 -0
  146. package/dist/esm/src/stories/container.stories.d.ts +36 -0
  147. package/dist/esm/src/stories/dialog.stories.d.ts +20 -0
  148. package/dist/esm/src/stories/grid.stories.d.ts +42 -0
  149. package/dist/esm/src/stories/heading.stories.d.ts +82 -0
  150. package/dist/esm/src/stories/input-number.stories.d.ts +51 -0
  151. package/dist/esm/src/stories/input.stories.d.ts +35 -0
  152. package/dist/esm/src/stories/picture.stories.d.ts +18 -0
  153. package/dist/esm/src/stories/popover.stories.d.ts +17 -0
  154. package/dist/esm/src/stories/radio.stories.d.ts +39 -0
  155. package/dist/esm/src/stories/skeleton.stories.d.ts +20 -0
  156. package/dist/esm/src/stories/text.stories.d.ts +94 -0
  157. package/dist/esm/stories/creativeModule.stories.d.ts +2 -1
  158. package/dist/esm/stories/creativeModule.stories.js +1 -1
  159. package/dist/esm/stories/creativeModule.stories.js.map +2 -2
  160. package/dist/esm/stories/shelf.stories.d.ts +17 -0
  161. package/dist/esm/tailwind.config.d.ts +253 -0
  162. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  163. package/package.json +1 -1
  164. package/dist/cjs/biz-components/WhyChooses/WhyChoose.d.ts +0 -14
  165. package/dist/cjs/biz-components/WhyChooses/index.d.ts +0 -2
  166. package/dist/cjs/biz-components/WhyChooses/types.d.ts +0 -11
  167. package/dist/esm/biz-components/WhyChooses/WhyChoose.d.ts +0 -14
  168. package/dist/esm/biz-components/WhyChooses/index.d.ts +0 -2
  169. package/dist/esm/biz-components/WhyChooses/types.d.ts +0 -11
  170. /package/dist/cjs/biz-components/{Faq/type.d.ts → SectionHeading/index.d.ts} +0 -0
  171. /package/dist/cjs/{biz-components/WhyChoose/type.d.ts → components/inputnumber.d.ts} +0 -0
  172. /package/dist/cjs/hooks/{useExposure.d.ts → useEXposure.d.ts} +0 -0
  173. /package/dist/cjs/stories/{WhyChoose.stories.d.ts → whychoose.stories.d.ts} +0 -0
  174. /package/dist/esm/biz-components/{Faq/type.d.ts → SectionHeading/index.d.ts} +0 -0
  175. /package/dist/esm/{biz-components/WhyChoose/type.d.ts → components/inputnumber.d.ts} +0 -0
  176. /package/dist/esm/hooks/{useExposure.d.ts → useEXposure.d.ts} +0 -0
  177. /package/dist/esm/stories/{WhyChoose.stories.d.ts → whychoose.stories.d.ts} +0 -0
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { SectionHeadingProps } from './types.js';
3
+ declare const SectionHeading: React.ForwardRefExoticComponent<SectionHeadingProps & React.RefAttributes<HTMLDivElement>>;
4
+ export default SectionHeading;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface SectionHeadingProps {
3
+ title: string;
4
+ className?: string;
5
+ children: React.ReactNode;
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { ShelfProps } from './types.js';
2
+ declare const _default: {
3
+ (props: Omit<ShelfProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from './Shelf.js';
@@ -0,0 +1,6 @@
1
+ export type ShelfProps = {
2
+ id: string;
3
+ title: string;
4
+ subtitle: string;
5
+ products: any[];
6
+ };
@@ -1,6 +1,6 @@
1
- "use strict";"use client";var ne=Object.create;var B=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var oe=(e,t)=>{for(var i in t)B(e,i,{get:t[i],enumerable:!0})},O=(e,t,i,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of re(t))!ae.call(e,p)&&p!==i&&B(e,p,{get:()=>t[p],enumerable:!(d=ie(t,p))||d.enumerable});return e};var f=(e,t,i)=>(i=e!=null?ne(se(e)):{},O(t||!e||!e.__esModule?B(i,"default",{value:e,enumerable:!0}):i,e)),le=e=>O(B({},"__esModule",{value:!0}),e);var fe={};oe(fe,{default:()=>ue});module.exports=le(fe);var n=require("react/jsx-runtime"),s=f(require("react")),w=require("../../helpers/utils.js"),L=f(require("../../components/picture.js")),$=f(require("./tabSwitch.js")),H=f(require("../../components/button.js")),A=f(require("../Title/index.js")),F=f(require("../SwiperBox/index.js")),j=require("../../shared/Styles.js"),q=require("./shelfDisplay.js"),U=require("../../hooks/useExposure.js"),D=require("../../shared/track.js"),z=require("../AiuiProvider/index.js"),W=f(require("../../components/badge.js")),G=require("../../components/heading.js"),J=require("../../components/text.js"),K=require("../../shared/trackUrlRef.js");const E="image",V="product_shelf",pe=999999999e-2;function ce(e){const t=(0,s.useRef)(null),[i,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(i)return;const p=t.current;if(!p||typeof IntersectionObserver>"u")return;const c=new IntersectionObserver(([a])=>{a.isIntersecting&&(d(!0),c.disconnect())},e);return c.observe(p),()=>c.disconnect()},[i,e]),[t,i]}const me=({data:e,configuration:t})=>{const{locale:i="us",copyWriting:d}=(0,z.useAiuiContext)(),p=(r,o,h)=>t?.event?.primaryButton?.(r,o+1,h),c=(r,o,h)=>t?.event?.secondaryButton?.(r,o+1,h),a=e?.variants?.find(r=>r?.sku===e?.sku)||e?.variants?.[0]||{},P=!a?.availableForSale&&a?.price?.amount===pe,y=t?.isShowTag,v=t?.isShowOriginalPrice,b=a?.coupons?.[0],{price:x,basePrice:N}=(0,q.formatVariantPrice)({locale:i,amount:v&&b?b.variant_price4wscode:a.price,baseAmount:v&&b?a.price:0,currencyCode:e?.price?.currencyCode||"USD"}),S=()=>{const r=e?.sku,o=e?.variants;return o?.find(k=>k?.sku===r)?.image?.url||o?.[0]?.image?.url||""},u=e?.custom_name||e?.title,g=e?.custom_description||e?.description;return(0,n.jsx)("div",{className:(0,w.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",t?.itemShape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:(0,n.jsxs)("div",{className:"absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[(0,n.jsx)("div",{className:(0,w.cn)("lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:(0,n.jsx)("a",{"aria-label":u,target:t?.target,href:(0,K.trackUrlRef)(`${i==="us"||!i?"":`/${i}`}/products/${e?.handle}`,`${E}_${V}`),onClick:()=>{(0,D.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||a?.sku,item_name:e?.name,item_variant:a?.name,price:a?.price,index:t?.index+1}]}})},children:(0,n.jsx)(L.default,{source:S(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),y?(0,n.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(r=>r?.startsWith?.("CLtag"))?.map?.(r=>r?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((r,o)=>(0,n.jsx)(W.default,{children:r},o))}):null,u?(0,n.jsx)(G.Heading,{as:"h3",title:u||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start",html:u||""}):null,g?(0,n.jsx)(J.Text,{size:2,className:"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]",html:g||""}):null,(0,n.jsx)("div",{className:"mb-2 mt-[20px] flex items-center",children:P?(0,n.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:d?.soldOutText}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&x||""}),(0,n.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&N||""})]})}),(0,n.jsxs)("div",{className:(0,w.cn)("lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,n.jsx)(H.default,{variant:"secondary",onClick:()=>c(e,t?.index,t),className:`
1
+ "use strict";"use client";var re=Object.create;var B=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var le=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},L=(e,t,r,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of ie(t))!oe.call(e,p)&&p!==r&&B(e,p,{get:()=>t[p],enumerable:!(m=se(t,p))||m.enumerable});return e};var h=(e,t,r)=>(r=e!=null?re(ae(e)):{},L(t||!e||!e.__esModule?B(r,"default",{value:e,enumerable:!0}):r,e)),pe=e=>L(B({},"__esModule",{value:!0}),e);var he={};le(he,{default:()=>fe});module.exports=pe(he);var n=require("react/jsx-runtime"),i=h(require("react")),S=require("../../helpers/utils.js"),$=h(require("../../components/picture.js")),A=h(require("./tabSwitch.js")),H=h(require("../../components/button.js")),F=h(require("../Title/index.js")),j=h(require("../SwiperBox/index.js")),q=require("../../shared/Styles.js"),U=require("./shelfDisplay.js"),z=require("../../hooks/useExposure.js"),D=require("../../shared/track.js"),W=require("../AiuiProvider/index.js"),G=h(require("../../components/badge.js")),J=require("../../components/heading.js"),K=require("../../components/text.js"),Q=require("../../shared/trackUrlRef.js");const E="image",V="product_shelf",ce=999999999e-2;function me(e){const t=(0,i.useRef)(null),[r,m]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{if(r)return;const p=t.current;if(!p||typeof IntersectionObserver>"u")return;const c=new IntersectionObserver(([a])=>{a.isIntersecting&&(m(!0),c.disconnect())},e);return c.observe(p),()=>c.disconnect()},[r,e]),[t,r]}const de=({data:e,configuration:t})=>{const{locale:r="us",copyWriting:m}=(0,W.useAiuiContext)(),p=(s,l,y)=>t?.event?.primaryButton?.(s,l+1,y),c=(s,l,y)=>t?.event?.secondaryButton?.(s,l+1,y),a=e?.variants?.find(s=>s?.sku===e?.sku)||e?.variants?.[0]||{},P=!a?.availableForSale&&a?.price?.amount===ce,v=t?.isShowTag,b=t?.isShowOriginalPrice,g=a?.coupons?.[0],{price:w,basePrice:N}=(0,U.formatVariantPrice)({locale:r,amount:b&&g?g.variant_price4wscode:a.price,baseAmount:b&&g?a.price:0,currencyCode:e?.price?.currencyCode||"USD"}),k=()=>{const s=e?.sku,l=e?.variants;return l?.find(_=>_?.sku===s)?.image?.url||l?.[0]?.image?.url||""},d=e?.custom_name||e?.title,x=e?.custom_description||e?.description;return(0,n.jsx)("div",{className:(0,S.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",t?.itemShape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:(0,n.jsxs)("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[(0,n.jsx)("div",{className:(0,S.cn)("lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:(0,n.jsx)("a",{"aria-label":d,target:t?.target,href:(0,Q.trackUrlRef)(`${r==="us"||!r?"":`/${r}`}/products/${e?.handle}`,`${E}_${V}`),onClick:()=>{(0,D.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||a?.sku,item_name:e?.name,item_variant:a?.name,price:a?.price,index:t?.index+1}]}})},children:(0,n.jsx)($.default,{source:k(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),v?(0,n.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((s,l)=>(0,n.jsx)(G.default,{children:s},l))}):null,d?(0,n.jsx)(J.Heading,{as:"h3",title:d||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start",html:d||""}):null,x?(0,n.jsx)(K.Text,{size:2,className:"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]",html:x||""}):null,(0,n.jsx)("div",{className:"mb-2 mt-[20px] flex items-center",children:P?(0,n.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:m?.soldOutText}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&w||""}),(0,n.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&N||""})]})}),(0,n.jsxs)("div",{className:(0,S.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,n.jsx)(H.default,{variant:"secondary",onClick:()=>c(e,t?.index,t),className:`
2
2
  ${t.direction==="vertical"?"w-full":""}
3
3
  `,children:t?.secondaryButton||""}):null,t?.primaryButton?(0,n.jsx)(H.default,{variant:"primary",onClick:()=>p(e,t?.index,t),className:`
4
4
  ${t.direction==="vertical"?"w-full":""}
5
- `,children:t?.primaryButton||""}):null]})]})},e?.id||e?.handle)},de=s.default.forwardRef(({data:e,buildData:t,className:i="",key:d,event:p,recommendedData:c,target:a="_self"},P)=>{const[y,v]=(0,s.useState)(""),[b,x]=(0,s.useState)([]),[N,S]=ce({threshold:0}),u=(0,s.useRef)(!1),g=(0,s.useRef)(!1),r=(0,s.useRef)(null);(0,s.useImperativeHandle)(P,()=>r.current),(0,U.useExposure)(r,{componentType:E,componentName:V,componentTitle:e?.title,navigation:y});const{productsTab:o=[],productsCard:h=[],title:k,isShowTab:C=!0,tabShape:Q="square",isShowTag:X=!1,isShowOriginalPrice:Y=!0,isShowRecommendedCard:Z=!1,...ee}=e,M=()=>{(0,D.gaTrack)({event:"ga4Event",event_name:"view_item_list",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:c?.map((l,R)=>{const m=l?.variants?.find(T=>T?.sku===l?.sku)||l?.variants?.[0];return{item_id:l?.sku||m?.sku,item_name:l?.name,item_variant:m?.name,price:m?.price,index:R+1}})}})},I=(l,R)=>{if(R){const _=c?.map(m=>({...m,isShowRecommended:!0}));x(_||[])}else{const _=l?.map(m=>{const T=t?.products?.find(te=>te?.handle===m?.handle);if(T)return{sku:m.sku,isShowRecommended:!1,custom_name:m.custom_name,custom_description:m.custom_description,...T}})?.filter(m=>m);x(_||[])}};return(0,s.useEffect)(()=>{S&&c?.length&&!g.current&&(g.current=!0,M())},[S,c]),(0,s.useEffect)(()=>{if(!u.current){if(!u.current&&c?.length&&(u.current=!0),C){v(o?.[0]?.tab||""),I(o?.[0]?.data||[],o?.[0]?.isShowRecommendedTab);return}I(h,Z)}},[c]),(0,n.jsxs)("div",{ref:r,className:(0,w.cn)("shelf-display-wrap w-full",i,{"aiui-dark":e?.theme==="dark"}),children:[k&&(0,n.jsx)(A.default,{data:{title:k}}),C&&(0,n.jsx)("div",{className:"md-tablet:w-full md-tablet:overflow-hidden",children:(0,n.jsx)($.default,{value:y,tabs:o,tabShape:Q,onTabClick:l=>{if(v(l?.tab),I(l?.data||[],l?.isShowRecommendedTab),!l?.isShowRecommendedTab){(0,D.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:E,component_name:V,component_title:e?.title,component_position:1,navigation:l?.tab}});return}M()}})}),(0,n.jsx)("div",{ref:N,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:(0,n.jsx)(F.default,{className:`${C?"mt-6":""} !overflow-visible`,id:`ShelfDisplay${d}${y}`,data:{list:b,configuration:{...ee,event:p,isShowTag:X,isShowOriginalPrice:Y,target:a}},Slide:me,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})})]})});var ue=(0,j.withLayout)(de);
5
+ `,children:t?.primaryButton||""}):null]})]})},e?.id||e?.handle)},ue=i.default.forwardRef(({data:e,buildData:t,className:r="",key:m,event:p,recommendedData:c,target:a="_self"},P)=>{const[v,b]=(0,i.useState)(""),[g,w]=(0,i.useState)([]),[N,k]=me({threshold:0}),d=(0,i.useRef)(!1),x=(0,i.useRef)(!1),s=(0,i.useRef)(null);(0,i.useImperativeHandle)(P,()=>s.current),(0,z.useExposure)(s,{componentType:E,componentName:V,componentTitle:e?.title,navigation:v});const{productsTab:l=[],productsCard:y=[],title:_,isShowTab:C=!0,tabShape:X="square",isShowTag:Y=!1,isShowOriginalPrice:Z=!0,isShowRecommendedCard:ee=!1,...te}=e,M=()=>{(0,D.gaTrack)({event:"ga4Event",event_name:"view_item_list",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:c?.map((o,R)=>{const u=o?.variants?.find(f=>f?.sku===o?.sku)||o?.variants?.[0];return{item_id:o?.sku||u?.sku,item_name:o?.name,item_variant:u?.name,price:u?.price,index:R+1}})}})},I=(o,R)=>{if(R){const T=c?.map?.(u=>({...u,isShowRecommended:!0}));w(T?.length?T||[]:[])}else if(Array.isArray(o)){const u=o?.map?.(f=>{const O=t?.products?.find(ne=>ne?.handle===f?.handle);if(O)return{sku:f.sku,isShowRecommended:!1,custom_name:f.custom_name,custom_description:f.custom_description,...O}})?.filter(f=>f);w(u?.length?u||[]:[])}else w([])};return(0,i.useEffect)(()=>{k&&c?.length&&!x.current&&(x.current=!0,M())},[k,c]),(0,i.useEffect)(()=>{if(!d.current){if(!d.current&&c?.length&&(d.current=!0),C){b(l?.[0]?.tab||""),I(l?.[0]?.data||[],l?.[0]?.isShowRecommendedTab);return}I(y,ee)}},[c]),(0,n.jsxs)("div",{ref:s,className:(0,S.cn)("shelf-display-wrap w-full",r,{"aiui-dark":e?.theme==="dark"}),children:[_&&(0,n.jsx)(F.default,{data:{title:_}}),C&&(0,n.jsx)("div",{className:"md-tablet:w-full md-tablet:overflow-hidden",children:(0,n.jsx)(A.default,{value:v,tabs:l,tabShape:X,onTabClick:o=>{if(b(o?.tab),I(o?.data||[],o?.isShowRecommendedTab),!o?.isShowRecommendedTab){(0,D.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:E,component_name:V,component_title:e?.title,component_position:1,navigation:o?.tab}});return}M()}})}),(0,n.jsx)("div",{ref:N,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:(0,n.jsx)(j.default,{className:`${C?"mt-6":""} !overflow-visible`,id:`ShelfDisplay${m}${v}`,data:{list:g,configuration:{...te,event:p,isShowTag:Y,isShowOriginalPrice:Z,target:a}},Slide:de,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})})]})});var fe=(0,q.withLayout)(ue);
6
6
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport TabSwitch from './tabSwitch.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport Badge from '../../components/badge.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps } from '../../types/props.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport interface ShelfDisplayItem {\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n}\n\ntype ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n className?: string\n key?: string\n target?: '_self' | '_blank'\n}\n\nfunction useOnceInView<T extends Element>(options: any) {\n const ref = useRef<T>(null)\n const [inView, setInView] = useState(false)\n\n useEffect(() => {\n if (inView) return // \u5DF2\u8FDB\u5165\u8FC7\uFF0C\u5219\u4E0D\u518D\u89C2\u5BDF\n const el = ref.current\n if (!el || typeof IntersectionObserver === 'undefined') return\n\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) {\n setInView(true)\n observer.disconnect() // \u505C\u6B62\u89C2\u5BDF\n }\n }, options)\n\n observer.observe(el)\n return () => observer.disconnect()\n }, [inView, options])\n\n return [ref, inView]\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n <div\n className={cn(\n 'lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-[20px] flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n ({ data, buildData, className = '', key, event, recommendedData, target = '_self' }, ref) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const [viewRef, inView] = useOnceInView<HTMLDivElement>({ threshold: 0 })\n const isRecommend = useRef<boolean>(false)\n const isView = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType: componentType,\n componentName: componentName,\n componentTitle: data?.title,\n navigation: tabId,\n })\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData || [])\n } else {\n const newCurrentData = currentData\n ?.map(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData || [])\n }\n }\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [], productsTab?.[0]?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n return (\n <div\n ref={innerRef}\n className={cn('shelf-display-wrap w-full', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <div className=\"md-tablet:w-full md-tablet:overflow-hidden\">\n <TabSwitch\n value={tabId}\n tabs={productsTab}\n tabShape={tabShape}\n onTabClick={v => {\n setTabId(v?.tab)\n handleCurrentTab(v?.data || [], v?.isShowRecommendedTab)\n if (!v?.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: v?.tab,\n },\n })\n return\n }\n gackViewEvent()\n }}\n />\n </div>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n className={`${isShowTab ? 'mt-6' : ''} !overflow-visible`}\n id={`ShelfDisplay${key}${tabId}`}\n data={{\n list: currentItems,\n configuration: { ...other, event: event, isShowTag, isShowOriginalPrice, target: target },\n }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withLayout(ShelfDisplay)\n"],
5
- "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAiMY,IAAAI,EAAA,6BAhMZC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAsB,6BACtBC,EAAmB,yCACnBC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAmC,6BACnCC,EAA4B,sCAC5BC,EAAwB,iCACxBC,EAA+B,oCAC/BC,EAAkB,wCAClBC,EAAwB,uCACxBC,EAAqB,oCAErBC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,GAAiB,aAqEvB,SAASC,GAAiCC,EAAc,CACtD,MAAMC,KAAM,UAAU,IAAI,EACpB,CAACC,EAAQC,CAAS,KAAI,YAAS,EAAK,EAE1C,sBAAU,IAAM,CACd,GAAID,EAAQ,OACZ,MAAME,EAAKH,EAAI,QACf,GAAI,CAACG,GAAM,OAAO,qBAAyB,IAAa,OAExD,MAAMC,EAAW,IAAI,qBAAqB,CAAC,CAACC,CAAK,IAAM,CACjDA,EAAM,iBACRH,EAAU,EAAI,EACdE,EAAS,WAAW,EAExB,EAAGL,CAAO,EAEV,OAAAK,EAAS,QAAQD,CAAE,EACZ,IAAM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,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEA,IAAO9B,MAAQ,cAAWuD,EAAY",
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport TabSwitch from './tabSwitch.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport Badge from '../../components/badge.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps } from '../../types/props.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport interface ShelfDisplayItem {\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n}\n\ntype ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n className?: string\n key?: string\n target?: '_self' | '_blank'\n}\n\nfunction useOnceInView<T extends Element>(options: any) {\n const ref = useRef<T>(null)\n const [inView, setInView] = useState(false)\n\n useEffect(() => {\n if (inView) return // \u5DF2\u8FDB\u5165\u8FC7\uFF0C\u5219\u4E0D\u518D\u89C2\u5BDF\n const el = ref.current\n if (!el || typeof IntersectionObserver === 'undefined') return\n\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) {\n setInView(true)\n observer.disconnect() // \u505C\u6B62\u89C2\u5BDF\n }\n }, options)\n\n observer.observe(el)\n return () => observer.disconnect()\n }, [inView, options])\n\n return [ref, inView]\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n <div\n className={cn(\n 'lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-[20px] flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n ({ data, buildData, className = '', key, event, recommendedData, target = '_self' }, ref) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const [viewRef, inView] = useOnceInView<HTMLDivElement>({ threshold: 0 })\n const isRecommend = useRef<boolean>(false)\n const isView = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType: componentType,\n componentName: componentName,\n componentTitle: data?.title,\n navigation: tabId,\n })\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map?.(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n const isArray = Array.isArray(currentData)\n if (isArray) {\n const newCurrentData = currentData\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n setCurrentItems([])\n }\n }\n }\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [], productsTab?.[0]?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n return (\n <div\n ref={innerRef}\n className={cn('shelf-display-wrap w-full', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <div className=\"md-tablet:w-full md-tablet:overflow-hidden\">\n <TabSwitch\n value={tabId}\n tabs={productsTab}\n tabShape={tabShape}\n onTabClick={v => {\n setTabId(v?.tab)\n handleCurrentTab(v?.data || [], v?.isShowRecommendedTab)\n if (!v?.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: v?.tab,\n },\n })\n return\n }\n gackViewEvent()\n }}\n />\n </div>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n className={`${isShowTab ? 'mt-6' : ''} !overflow-visible`}\n id={`ShelfDisplay${key}${tabId}`}\n data={{\n list: currentItems,\n configuration: { ...other, event: event, isShowTag, isShowOriginalPrice, target: target },\n }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withLayout(ShelfDisplay)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAiMY,IAAAI,EAAA,6BAhMZC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAsB,6BACtBC,EAAmB,yCACnBC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAmC,6BACnCC,EAA4B,sCAC5BC,EAAwB,iCACxBC,EAA+B,oCAC/BC,EAAkB,wCAClBC,EAAwB,uCACxBC,EAAqB,oCAErBC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,GAAiB,aAqEvB,SAASC,GAAiCC,EAAc,CACtD,MAAMC,KAAM,UAAU,IAAI,EACpB,CAACC,EAAQC,CAAS,KAAI,YAAS,EAA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EACL,UAAU,2FAEV,mBAAC,EAAAoB,QAAA,CACC,UAAW,GAAGb,EAAY,OAAS,EAAE,qBACrC,GAAI,eAAef,CAAG,GAAGI,CAAK,GAC9B,KAAM,CACJ,KAAME,EACN,cAAe,CAAE,GAAGY,GAAO,MAAOjB,EAAO,UAAAlB,EAAW,oBAAAC,EAAqB,OAAQmB,CAAO,CAC1F,EACA,MAAOhC,GACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEA,IAAO9B,MAAQ,cAAWuD,EAAY",
6
6
  "names": ["ShelfDisplay_exports", "__export", "ShelfDisplay_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_tabSwitch", "import_button", "import_Title", "import_SwiperBox", "import_Styles", "import_shelfDisplay", "import_useExposure", "import_track", "import_AiuiProvider", "import_badge", "import_heading", "import_text", "import_trackUrlRef", "componentType", "componentName", "SOLD_OUT_PRICE", "useOnceInView", "options", "ref", "inView", "setInView", "el", "observer", "entry", "ShelfDisplayItem", "data", "configuration", "locale", "copyWriting", "onPrimaryButton", "params", "index", "onSecondaryButton", "variant", "item", "isSoldOut", "isShowTag", "isShowOriginalPrice", "coupon", "price", "basePrice", "handleUrl", "sku", "skuArray", "displayTitle", "displayDescription", "Picture", "Badge", "Button", "ShelfDisplay", "React", "buildData", "className", "key", "event", "recommendedData", "target", "tabId", "setTabId", "currentItems", "setCurrentItems", "viewRef", "isRecommend", "isView", "innerRef", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "isShowRecommendedCard", "other", "gackViewEvent", "v", "handleCurrentTab", "currentData", "flag", "newCurrentData", "findData", "Title", "TabSwitch", "SwiperBox"]
7
7
  }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface TabsProps {
3
+ tabs: any[];
4
+ onTabClick?: (value: any) => void;
5
+ }
6
+ declare const Tab: React.FC<TabsProps>;
7
+ export default Tab;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var _=Object.create;var a=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var J=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},k=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of A(e))!G.call(t,o)&&o!==n&&a(t,o,{get:()=>e[o],enumerable:!(s=q(e,o))||s.enumerable});return t};var K=(t,e,n)=>(n=t!=null?_(B(t)):{},k(e||!t||!t.__esModule?a(n,"default",{value:t,enumerable:!0}):n,t)),O=t=>k(a({},"__esModule",{value:!0}),t);var W={};J(W,{default:()=>Q});module.exports=O(W);var i=require("react/jsx-runtime"),r=K(require("react")),m=require("gsap"),T=require("gsap/dist/SplitText"),h=require("gsap/dist/ScrollTrigger"),w=require("../../helpers/utils.js"),E=require("../../components/index.js"),L=require("../../shared/Styles.js"),M=require("../../hooks/useExposure.js"),D=require("../../shared/trackUrlRef.js"),N=require("react-intersection-observer");const b="link",R="title",H=r.default.forwardRef(({data:t,className:e},n)=>{const{title:s,theme:o,extension:u}=t,p=(0,r.useRef)(null),l=(0,r.useRef)(null),c=(0,r.useRef)(null),f=(0,r.useRef)(null),{ref:S,inView:x}=(0,N.useInView)();return(0,r.useImperativeHandle)(n,()=>p.current),(0,M.useExposure)(p,{componentType:b,componentName:R,componentTitle:t?.title}),(0,r.useEffect)(()=>{m.gsap.registerPlugin(T.SplitText,h.ScrollTrigger);function I(){if(!l.current)return;const P=l.current?.clientHeight||80;c.current=new T.SplitText(l.current,{type:"words",wordsClass:"word"});const d=c.current.words;m.gsap.set(d,{opacity:0}),f.current=h.ScrollTrigger.create({trigger:l.current,start:"bottom bottom-=4%",end:`bottom+=${P*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:V=>{const $=V.progress,v=d.length,z=1/v,y=.5;d.forEach((U,j)=>{const C=j/v*(1-y),F=z*(1+y);let g=($-C)/F;g=Math.max(0,Math.min(g,1)),m.gsap.set(U,{opacity:g})})}})}return x&&I(),()=>{c.current&&c.current.revert(),f.current&&f.current.kill()}},[x]),s&&(0,i.jsxs)("div",{className:"mb-6 flex items-end justify-between",ref:p,children:[(0,i.jsx)("div",{ref:S,className:(0,w.cn)("space-y-4",e,{"aiui-dark":o==="dark"}),children:(0,i.jsx)(E.Heading,{ref:l,as:"h2",size:4,html:s})}),u?.textLink&&(0,i.jsx)("a",{className:(0,w.cn)({"aiui-dark":o==="dark"},"text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:(0,D.trackUrlRef)(u?.link,`${b}_${R}`),children:u?.textLink})]})});H.displayName="Title";var Q=(0,L.withLayout)(H);
1
+ "use strict";"use client";var q=Object.create;var a=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},b=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of B(e))!J.call(t,o)&&o!==n&&a(t,o,{get:()=>e[o],enumerable:!(s=A(e,o))||s.enumerable});return t};var O=(t,e,n)=>(n=t!=null?q(G(t)):{},b(e||!t||!t.__esModule?a(n,"default",{value:t,enumerable:!0}):n,t)),Q=t=>b(a({},"__esModule",{value:!0}),t);var X={};K(X,{default:()=>W});module.exports=Q(X);var i=require("react/jsx-runtime"),r=O(require("react")),m=require("gsap"),T=require("gsap/dist/SplitText"),h=require("gsap/dist/ScrollTrigger"),w=require("../../helpers/utils.js"),L=require("../../components/index.js"),M=require("../../shared/Styles.js"),D=require("../../hooks/useExposure.js"),N=require("../../shared/trackUrlRef.js"),S=require("react-intersection-observer");const R="link",H="title",E=r.default.forwardRef(({data:t,className:e},n)=>{const{title:s,caption:o,theme:v,extensions:p}=t,u=(0,r.useRef)(null),l=(0,r.useRef)(null),c=(0,r.useRef)(null),f=(0,r.useRef)(null),{ref:I,inView:x}=(0,S.useInView)();return(0,r.useImperativeHandle)(n,()=>u.current),(0,D.useExposure)(u,{componentType:R,componentName:H,componentTitle:t?.title}),(0,r.useEffect)(()=>{m.gsap.registerPlugin(T.SplitText,h.ScrollTrigger);function P(){if(!l.current)return;const V=l.current?.clientHeight||80;c.current=new T.SplitText(l.current,{type:"words",wordsClass:"word"});const d=c.current.words;m.gsap.set(d,{opacity:0}),f.current=h.ScrollTrigger.create({trigger:l.current,start:"bottom bottom-=4%",end:`bottom+=${V*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:$=>{const z=$.progress,y=d.length,U=1/y,k=.5;d.forEach((j,C)=>{const F=C/y*(1-k),_=U*(1+k);let g=(z-F)/_;g=Math.max(0,Math.min(g,1)),m.gsap.set(j,{opacity:g})})}})}return x&&P(),()=>{c.current&&c.current.revert(),f.current&&f.current.kill()}},[x]),(s||o)&&(0,i.jsxs)("div",{className:"mb-6 flex items-end justify-between overflow-hidden",ref:u,children:[(0,i.jsx)("div",{ref:I,className:(0,w.cn)("space-y-4",e,{"aiui-dark":v==="dark"}),children:(0,i.jsx)(L.Heading,{ref:l,as:"h2",size:4,html:o||s})}),p?.textLink&&(0,i.jsx)("a",{className:(0,w.cn)({"aiui-dark":v==="dark"},"text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:(0,N.trackUrlRef)(p?.link,`${R}_${H}`),children:p?.textLink})]})});E.displayName="Title";var W=(0,M.withLayout)(E);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }, ref) => {\n const { title, theme, extension } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n title && (\n <div className=\"mb-6 flex items-end justify-between\" ref={innerRef}>\n <div ref={inViewRef} className={cn('space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n {extension?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extension?.link, `${componentType}_${componentName}`)}\n >\n {extension?.textLink}\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8EM,IAAAI,EAAA,6BA7ENC,EAA8D,oBAC9DC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAE3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAA0B,uCAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAEhBC,EAAQ,EAAAC,QAAM,WAAuC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACvF,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,UAAAC,CAAU,EAAIL,EAC9BM,KAAW,UAAuB,IAAI,EACtCC,KAAW,UAA2B,IAAI,EAC1CC,KAAoB,UAAyB,IAAI,EACjDC,KAAmB,UAA6B,IAAI,EAEpD,CAAE,IAAKC,EAAW,OAAAC,CAAO,KAAI,aAAU,EAE7C,gCAAoBT,EAAK,IAAMI,EAAS,OAAyB,KAEj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MJ,EAAO,EACxD,EACCE,GAAW,aACV,OAAC,KACC,aAAW,MACT,CAAE,YAAaD,IAAU,MAAO,EAChC,oGACF,EACA,QAAM,eAAYC,GAAW,KAAM,GAAGT,CAAa,IAAIC,CAAa,EAAE,EAErE,SAAAQ,GAAW,SACd,GAEJ,CAGN,CAAC,EAEDP,EAAM,YAAc,QAEpB,IAAOf,KAAQ,cAAWe,CAAK",
6
- "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_react_intersection_observer", "componentType", "componentName", "Title", "React", "data", "className", "ref", "title", "theme", "extension", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity"]
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }, ref) => {\n const { title, caption, theme, extensions } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n (title || caption) && (\n <div className=\"mb-6 flex items-end justify-between overflow-hidden\" ref={innerRef}>\n <div ref={inViewRef} className={cn('space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={caption || title} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n >\n {extensions?.textLink}\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8EM,IAAAI,EAA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AU,EAAIE,GAC3BI,EAAQL,GAAY,EAAIC,GAC9B,IAAIK,GAAWR,EAAWM,GAASC,EACnCC,EAAU,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1C,OAAK,IAAIJ,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIb,GACFC,EAAW,EAGN,IAAM,CACXJ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAE9DC,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,CAC5D,CACF,EAAG,CAACE,CAAM,CAAC,GAGRT,GAASC,OACR,QAAC,OAAI,UAAU,sDAAsD,IAAKG,EACxE,oBAAC,OAAI,IAAKI,EAAW,aAAW,MAAG,YAAaV,EAAW,CAAE,YAAaI,IAAU,MAAO,CAAC,EAC1F,mBAAC,WAAQ,IAAKG,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMJ,GAAWD,EAAO,EACnE,EACCG,GAAY,aACX,OAAC,KACC,aAAW,MACT,CAAE,YAAaD,IAAU,MAAO,EAChC,oGACF,EACA,QAAM,eAAYC,GAAY,KAAM,GAAGV,CAAa,IAAIC,CAAa,EAAE,EAEtE,SAAAS,GAAY,SACf,GAEJ,CAGN,CAAC,EAEDR,EAAM,YAAc,QAEpB,IAAOf,KAAQ,cAAWe,CAAK",
6
+ "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_react_intersection_observer", "componentType", "componentName", "Title", "React", "data", "className", "ref", "title", "caption", "theme", "extensions", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity"]
7
7
  }
@@ -10,7 +10,8 @@ export interface TitleProps {
10
10
  /**
11
11
  * 主标题
12
12
  */
13
- title: string;
13
+ title?: string;
14
+ caption?: string;
14
15
  /**
15
16
  * 特性列表,最多支持3个
16
17
  */
@@ -22,7 +23,7 @@ export interface TitleProps {
22
23
  /**
23
24
  * 扩展数据
24
25
  */
25
- extension?: any;
26
+ extensions?: any;
26
27
  };
27
28
  /**
28
29
  * 自定义类名
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var m=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!o.call(t,r)&&r!==i&&a(t,r,{get:()=>e[r],enumerable:!(s=n(e,r))||s.enumerable});return t};var f=t=>m(a({},"__esModule",{value:!0}),t);var l={};module.exports=f(l);
1
+ "use strict";var i=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var m=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!o.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=n(e,r))||s.enumerable});return t};var c=t=>m(i({},"__esModule",{value:!0}),t);var f={};module.exports=c(f);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/types.ts"],
4
- "sourcesContent": ["import type { Theme } from '../../types/props.js'\n\nexport interface Feature {\n /**\n * \u7279\u6027\u6807\u9898\n */\n title: string\n}\n\nexport interface TitleProps {\n data: {\n /**\n * \u4E3B\u6807\u9898\n */\n title: string\n /**\n * \u7279\u6027\u5217\u8868\uFF0C\u6700\u591A\u652F\u63013\u4E2A\n */\n features?: Feature[]\n /**\n * \u4E3B\u9898\u8272\n */\n theme?: Theme\n /**\n * \u6269\u5C55\u6570\u636E\n */\n extension?: any\n }\n /**\n * \u81EA\u5B9A\u4E49\u7C7B\u540D\n */\n className?: string\n}\n"],
4
+ "sourcesContent": ["import type { Theme } from '../../types/props.js'\n\nexport interface Feature {\n /**\n * \u7279\u6027\u6807\u9898\n */\n title: string\n}\n\nexport interface TitleProps {\n data: {\n /**\n * \u4E3B\u6807\u9898\n */\n title?: string\n caption?: string\n /**\n * \u7279\u6027\u5217\u8868\uFF0C\u6700\u591A\u652F\u63013\u4E2A\n */\n features?: Feature[]\n /**\n * \u4E3B\u9898\u8272\n */\n theme?: Theme\n /**\n * \u6269\u5C55\u6570\u636E\n */\n extensions?: any\n }\n /**\n * \u81EA\u5B9A\u4E49\u7C7B\u540D\n */\n className?: string\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -24,3 +24,4 @@ export { withLayout } from '../shared/Styles.js';
24
24
  export { default as AiuiProvider } from './AiuiProvider/index.js';
25
25
  export { default as Tabs } from './Tabs/index.js';
26
26
  export { default as CreativeModule } from './CreativeModule/index.js';
27
+ export { default as GraphicOverlay } from './GraphicOverlay/index.js';
@@ -1,2 +1,2 @@
1
- "use strict";var b=Object.create;var l=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var F=(a,r)=>{for(var t in r)l(a,t,{get:r[t],enumerable:!0})},u=(a,r,t,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of I(r))!D.call(a,f)&&f!==t&&l(a,f,{get:()=>r[f],enumerable:!(p=j(r,f))||p.enumerable});return a};var e=(a,r,t)=>(t=a!=null?b(w(a)):{},u(r||!a||!a.__esModule?l(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>u(l({},"__esModule",{value:!0}),a);var W={};F(W,{AccordionCards:()=>h.default,AiuiProvider:()=>v.default,BrandEquity:()=>d.default,Category:()=>n.default,CreativeModule:()=>T.default,Evaluate:()=>y.default,Faq:()=>A.default,Graphic:()=>B.default,GraphicAttractionBlock:()=>S.default,HeroBanner:()=>M.default,Marquee:()=>C.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeTextContent:()=>o.MarqueeTextContent,MediaPlayerBase:()=>k.default,MediaPlayerMulti:()=>G.default,MediaPlayerSticky:()=>q.default,MemberEquity:()=>s.default,MultiLayoutGraphicBlock:()=>L.default,ShelfDisplay:()=>c.default,Slogan:()=>i.default,Spacer:()=>x.default,Tabs:()=>E.default,Title:()=>m.default,WhyChoose:()=>P.default,withLayout:()=>g.withLayout});module.exports=H(W);var d=e(require("./BrandEquity/index.js")),s=e(require("./MemberEquity/index.js")),i=e(require("./Slogan/index.js")),m=e(require("./Title/index.js")),x=e(require("./Spacer/index.js")),c=e(require("./ShelfDisplay/index.js")),y=e(require("./Evaluate/index.js")),n=e(require("./Category/index.js")),M=e(require("./HeroBanner/index.js")),h=e(require("./AccordionCards/index.js")),B=e(require("./Graphic/index.js")),k=e(require("./MediaPlayerBase/index.js")),q=e(require("./MediaPlayerSticky/index.js")),G=e(require("./MediaPlayerMulti/index.js")),C=e(require("./Marquee/index.js")),P=e(require("./WhyChoose/index.js")),A=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),L=e(require("./MultiLayoutGraphicBlock/index.js")),S=e(require("./GraphicAttractionBlock/index.js")),g=require("../shared/Styles.js"),v=e(require("./AiuiProvider/index.js")),E=e(require("./Tabs/index.js")),T=e(require("./CreativeModule/index.js"));
1
+ "use strict";var j=Object.create;var l=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var H=(a,r)=>{for(var t in r)l(a,t,{get:r[t],enumerable:!0})},u=(a,r,t,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of w(r))!F.call(a,f)&&f!==t&&l(a,f,{get:()=>r[f],enumerable:!(p=I(r,f))||p.enumerable});return a};var e=(a,r,t)=>(t=a!=null?j(D(a)):{},u(r||!a||!a.__esModule?l(t,"default",{value:a,enumerable:!0}):t,a)),O=a=>u(l({},"__esModule",{value:!0}),a);var W={};H(W,{AccordionCards:()=>h.default,AiuiProvider:()=>g.default,BrandEquity:()=>d.default,Category:()=>n.default,CreativeModule:()=>T.default,Evaluate:()=>y.default,Faq:()=>A.default,Graphic:()=>B.default,GraphicAttractionBlock:()=>L.default,GraphicOverlay:()=>b.default,HeroBanner:()=>M.default,Marquee:()=>C.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeTextContent:()=>o.MarqueeTextContent,MediaPlayerBase:()=>G.default,MediaPlayerMulti:()=>q.default,MediaPlayerSticky:()=>k.default,MemberEquity:()=>s.default,MultiLayoutGraphicBlock:()=>v.default,ShelfDisplay:()=>c.default,Slogan:()=>i.default,Spacer:()=>x.default,Tabs:()=>E.default,Title:()=>m.default,WhyChoose:()=>P.default,withLayout:()=>S.withLayout});module.exports=O(W);var d=e(require("./BrandEquity/index.js")),s=e(require("./MemberEquity/index.js")),i=e(require("./Slogan/index.js")),m=e(require("./Title/index.js")),x=e(require("./Spacer/index.js")),c=e(require("./ShelfDisplay/index.js")),y=e(require("./Evaluate/index.js")),n=e(require("./Category/index.js")),M=e(require("./HeroBanner/index.js")),h=e(require("./AccordionCards/index.js")),B=e(require("./Graphic/index.js")),G=e(require("./MediaPlayerBase/index.js")),k=e(require("./MediaPlayerSticky/index.js")),q=e(require("./MediaPlayerMulti/index.js")),C=e(require("./Marquee/index.js")),P=e(require("./WhyChoose/index.js")),A=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),v=e(require("./MultiLayoutGraphicBlock/index.js")),L=e(require("./GraphicAttractionBlock/index.js")),S=require("../shared/Styles.js"),g=e(require("./AiuiProvider/index.js")),E=e(require("./Tabs/index.js")),T=e(require("./CreativeModule/index.js")),b=e(require("./GraphicOverlay/index.js"));
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/biz-components/index.ts"],
4
- "sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iuBAAAE,EAAAF,GAAA,IAAAG,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAqC,mCACrCC,EAA+B,6BAC/BF,EAAqE,8BACrEG,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EAAgC,8BAChCC,EAA0C",
6
- "names": ["biz_components_exports", "__export", "__toCommonJS", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule"]
4
+ "sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8vBAAAE,EAAAF,GAAA,IAAAG,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAqC,mCACrCC,EAA+B,6BAC/BF,EAAqE,8BACrEG,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EAAgC,8BAChCC,EAA0C,wCAC1CC,EAA0C",
6
+ "names": ["biz_components_exports", "__export", "__toCommonJS", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay"]
7
7
  }
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { ReactNode } from 'react';
3
+ interface mediaProps {
4
+ span?: number;
5
+ pull?: number;
6
+ push?: number;
7
+ offset?: number;
8
+ order?: number;
9
+ }
10
+ interface ColProps {
11
+ children?: ReactNode;
12
+ span?: number;
13
+ className?: string;
14
+ asChild?: boolean;
15
+ offset?: number;
16
+ order?: number;
17
+ push?: number;
18
+ pull?: number;
19
+ flex?: number;
20
+ allFlex?: number;
21
+ md?: number | mediaProps;
22
+ lxl?: number | mediaProps;
23
+ mdl?: number | mediaProps;
24
+ xlxxl?: number | mediaProps;
25
+ minxxl?: number | mediaProps;
26
+ }
27
+ declare const Col: React.ForwardRefExoticComponent<ColProps & React.RefAttributes<HTMLDivElement>>;
28
+ export { Col };
29
+ export type { ColProps };
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
+ declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
+ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
+ declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
+ inset?: boolean;
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ inset?: boolean;
16
+ } & React.RefAttributes<HTMLDivElement>>;
17
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
+ inset?: boolean;
21
+ } & React.RefAttributes<HTMLDivElement>>;
22
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
+ declare const DropdownMenuShortcut: {
24
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ };
27
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { ReactNode } from 'react';
3
+ interface RowProps {
4
+ children?: ReactNode;
5
+ className?: string;
6
+ align?: 'start' | 'center' | 'end' | 'stretch' | {
7
+ [key in 'md' | 'mdl' | 'xlxxl' | 'minxxl']: 'start' | 'center' | 'end' | 'stretch';
8
+ };
9
+ asChild?: boolean;
10
+ gutter?: number | object | Array<object | number>;
11
+ wrap?: boolean;
12
+ justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | {
13
+ [key in 'md' | 'mdl' | 'xlxxl' | 'minxxl']: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly';
14
+ };
15
+ }
16
+ declare const Row: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLDivElement>>;
17
+ export { Row };
18
+ export type { RowProps };
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * This is a helper function that is used when a component supports `asChild`
4
+ * using the `Slot` component but its implementation contains nested DOM elements.
5
+ *
6
+ * Using it ensures if a consumer uses the `asChild` prop, the elements are in
7
+ * correct order in the DOM, adopting the intended consumer `children`.
8
+ */
9
+ export declare function getSubtree(options: {
10
+ asChild: boolean | undefined;
11
+ children: React.ReactNode;
12
+ }, content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)): React.ReactNode;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
3
+ import { type VariantProps } from 'class-variance-authority';
4
+ declare const Avatar: React.ForwardRefExoticComponent<{
5
+ /** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
6
+ asChild?: boolean;
7
+ /** 类名*/
8
+ className?: string;
9
+ /** 样式*/
10
+ style?: React.CSSProperties;
11
+ /** 点击事件*/
12
+ onClick?: Function;
13
+ /** 文本自适应*/
14
+ isAdaptation?: boolean;
15
+ /** 文本自适应最小字体, 开启时生效*/
16
+ minSize?: number;
17
+ /** 文本自适应最大字体, 开启时生效*/
18
+ maxSize?: number;
19
+ /** 文本自适应类*/
20
+ textClassName?: string;
21
+ } & VariantProps<(props?: ({
22
+ size?: "small" | "medium" | "large" | null | undefined;
23
+ } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string> & Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
24
+ declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
25
+ declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
26
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1,20 @@
1
+ export { default as Button } from './button.js';
2
+ export { default as Badge } from './badge.js';
3
+ export * from './input.js';
4
+ export { default as Checkbox } from './checkbox.js';
5
+ export { default as Skeleton } from './skeleton.js';
6
+ export * from './dialog.js';
7
+ export * from './popover.js';
8
+ export * from './radio.js';
9
+ export * from './dialog.js';
10
+ export * from './text.js';
11
+ export * from './gird.js';
12
+ export * from './col.js';
13
+ export * from './row.js';
14
+ export * from './heading.js';
15
+ export * from './container.js';
16
+ export * from './color.js';
17
+ export * from './link.js';
18
+ export * from './avatar.js';
19
+ export { default as Picture } from './picture.js';
20
+ export { default as Theme } from './theme.js';
@@ -0,0 +1 @@
1
+ export * from './components/index.js';
@@ -0,0 +1,40 @@
1
+ declare const meta: {
2
+ title: string;
3
+ component: import("react").ForwardRefExoticComponent<{
4
+ asChild?: boolean;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ onClick?: Function;
8
+ isAdaptation?: boolean;
9
+ minSize?: number;
10
+ maxSize?: number;
11
+ textClassName?: string;
12
+ } & import("class-variance-authority").VariantProps<(props?: ({
13
+ size?: "small" | "medium" | "large" | null | undefined;
14
+ } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string> & Omit<import("@radix-ui/react-avatar").AvatarProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
15
+ tags: string[];
16
+ subcomponents: any;
17
+ parameters: {
18
+ layout: string;
19
+ docs: {
20
+ description: {
21
+ component: string;
22
+ };
23
+ };
24
+ };
25
+ argTypes: {
26
+ size: {
27
+ description: string;
28
+ table: {
29
+ defaultValue: {
30
+ summary: string;
31
+ };
32
+ };
33
+ };
34
+ };
35
+ };
36
+ export default meta;
37
+ export declare const Default: () => import("react/jsx-runtime").JSX.Element;
38
+ export declare const AvatarType: () => import("react/jsx-runtime").JSX.Element;
39
+ export declare const AvatarTextAdaptation: () => import("react/jsx-runtime").JSX.Element;
40
+ export declare const AvatarSize: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { Badge } from '../components/index.js';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Badge;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {
11
+ variant: {
12
+ control: {
13
+ type: "select";
14
+ };
15
+ options: string[];
16
+ };
17
+ };
18
+ args: {
19
+ variant: "default";
20
+ children: string;
21
+ };
22
+ };
23
+ export default meta;
24
+ type Story = StoryObj<typeof meta>;
25
+ export declare const Default: Story;
26
+ export declare const Examples: Story;