@anker-in/headless-ui 0.0.27-alpha.47 → 0.0.27-alpha.49

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.
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var T=Object.create;var m=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var I=(t,s)=>{for(var n in s)m(t,n,{get:s[n],enumerable:!0})},h=(t,s,n,c)=>{if(s&&typeof s=="object"||typeof s=="function")for(let d of E(s))!C.call(t,d)&&d!==n&&m(t,d,{get:()=>s[d],enumerable:!(c=B(s,d))||c.enumerable});return t};var u=(t,s,n)=>(n=t!=null?T(M(t)):{},h(s||!t||!t.__esModule?m(n,"default",{value:t,enumerable:!0}):n,t)),A=t=>h(m({},"__esModule",{value:!0}),t);var V={};I(V,{default:()=>S});module.exports=A(V);var e=require("react/jsx-runtime"),y=u(require("../Title/index.js")),l=require("../../helpers/utils.js"),f=u(require("../../components/picture.js")),p=u(require("../../components/button.js")),g=u(require("../SwiperBox/index.js")),i=require("react");const L=({data:t,className:s=""})=>{const[n,c]=(0,i.useState)(0),[d,w]=(0,i.useState)({0:!0}),F=(0,i.useRef)([]),b=(0,i.useRef)({0:!0}),N=(o,r)=>{r&&(F.current[o]=r)},v=o=>{b.current?.[o]&&w({[o]:!0})};(0,i.useEffect)(()=>{const o=F.current;return o?.forEach((r,a)=>{a?r.style="flex: 1 1 0%; transition: all 0.15s":r.style="flex: 5 1 0%; transition: all 0.15s",r.addEventListener("transitionend",()=>v(a))}),()=>{o?.forEach((r,a)=>{r.removeEventListener("transitionend",()=>v(a))})}},[]);const k=({data:o,configuration:r})=>(0,e.jsxs)("div",{className:"relative shrink-0 grow-0 basis-[296px] border border-solid border-[#dddddd] bg-[#FFFFFF]",children:[(0,e.jsx)(f.default,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:o?.img?.url}),(0,e.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6"),children:[(0,e.jsxs)("div",{className:"mb-6 flex-1 overflow-hidden",children:[(0,e.jsx)("p",{className:"mb-1 text-2xl font-bold text-[#FFFFFF]",children:o?.title}),(0,e.jsx)("h3",{className:"text-sm font-medium text-[#FFFFFF]",children:o?.subTitle})]}),(0,e.jsx)(p.default,{size:"sm",hoverEffect:"slide",variant:"secondary",className:(0,l.cn)("mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",r?.shape==="round"?"rounded-2xl":""),children:(0,e.jsx)("a",{href:o.link,children:r?.primaryButton})})]})]});return(0,e.jsxs)(e.Fragment,{children:[t?.title&&(0,e.jsx)(y.default,{data:{title:t?.title}}),(0,e.jsx)("div",{className:"tablet:block hidden",children:(0,e.jsx)("div",{className:(0,l.cn)("laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden",s),children:t?.products?.map((o,r)=>{const a=n===r;return(0,e.jsxs)("div",{style:{flex:a?5:1},ref:x=>{x&&N(r,x)},className:(0,l.cn)("relative cursor-pointer overflow-hidden",t?.itemShape==="round"?"rounded-2xl":""),onClick:()=>{n!==r&&(b.current={[r]:!0},c(r))},children:[(0,e.jsx)(f.default,{source:o?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover"}),d?.[r]&&a?(0,e.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6"),children:[(0,e.jsxs)("div",{className:"mr-1 flex-1 overflow-hidden",children:[(0,e.jsx)("p",{className:"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]",children:o?.title}),(0,e.jsx)("h3",{className:"desktop:text-lg text-sm font-medium text-[#FFFFFF]",children:o?.subTitle})]}),(0,e.jsx)(p.default,{size:"sm",hoverEffect:"slide",variant:"secondary",className:(0,l.cn)("desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",t?.shape==="round"?"rounded-2xl":""),children:(0,e.jsx)("a",{href:o?.link,children:t?.primaryButton})})]}):null]},r)})})}),(0,e.jsx)("div",{className:"tablet:hidden block",children:(0,e.jsx)(g.default,{className:(0,l.cn)("h-[400px] !overflow-visible",s),id:"AccordionCards"+t?.key,data:{list:t?.products,configuration:{shape:t?.shape,primaryButton:t?.primaryButton}},Slide:k,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})})]})};var S=L;
1
+ "use strict";"use client";var T=Object.create;var m=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var I=(t,s)=>{for(var n in s)m(t,n,{get:s[n],enumerable:!0})},h=(t,s,n,c)=>{if(s&&typeof s=="object"||typeof s=="function")for(let d of E(s))!C.call(t,d)&&d!==n&&m(t,d,{get:()=>s[d],enumerable:!(c=B(s,d))||c.enumerable});return t};var u=(t,s,n)=>(n=t!=null?T(M(t)):{},h(s||!t||!t.__esModule?m(n,"default",{value:t,enumerable:!0}):n,t)),A=t=>h(m({},"__esModule",{value:!0}),t);var V={};I(V,{default:()=>S});module.exports=A(V);var e=require("react/jsx-runtime"),y=u(require("../Title/index.js")),l=require("../../helpers/utils.js"),f=u(require("../../components/picture.js")),p=u(require("../../components/button.js")),g=u(require("../SwiperBox/index.js")),i=require("react");const L=({data:t,className:s=""})=>{const[n,c]=(0,i.useState)(0),[d,w]=(0,i.useState)({0:!0}),F=(0,i.useRef)([]),b=(0,i.useRef)({0:!0}),N=(o,r)=>{r&&(F.current[o]=r)},v=o=>{b.current?.[o]&&w({[o]:!0})};(0,i.useEffect)(()=>{const o=F.current;return o?.forEach((r,a)=>{a?r.style="flex: 1 1 0%; transition: all 0.15s":r.style="flex: 5 1 0%; transition: all 0.15s",r.addEventListener("transitionend",()=>v(a))}),()=>{o?.forEach((r,a)=>{r.removeEventListener("transitionend",()=>v(a))})}},[]);const k=({data:o,configuration:r})=>(0,e.jsxs)("div",{className:"relative w-full shrink-0 grow-0 border border-solid border-[#dddddd] bg-[#FFFFFF]",children:[(0,e.jsx)(f.default,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:o?.img?.url}),(0,e.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6"),children:[(0,e.jsxs)("div",{className:"mb-6 flex-1 overflow-hidden",children:[(0,e.jsx)("p",{className:"mb-1 text-2xl font-bold text-[#FFFFFF]",children:o?.title}),(0,e.jsx)("h3",{className:"text-sm font-medium text-[#FFFFFF]",children:o?.subTitle})]}),(0,e.jsx)(p.default,{size:"sm",hoverEffect:"slide",variant:"secondary",className:(0,l.cn)("mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",r?.shape==="round"?"rounded-2xl":""),children:(0,e.jsx)("a",{href:o.link,children:r?.primaryButton})})]})]});return(0,e.jsxs)(e.Fragment,{children:[t?.title&&(0,e.jsx)(y.default,{data:{title:t?.title}}),(0,e.jsx)("div",{className:"tablet:block hidden",children:(0,e.jsx)("div",{className:(0,l.cn)("laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden",s),children:t?.products?.map((o,r)=>{const a=n===r;return(0,e.jsxs)("div",{style:{flex:a?5:1},ref:x=>{x&&N(r,x)},className:(0,l.cn)("relative cursor-pointer overflow-hidden",t?.itemShape==="round"?"rounded-2xl":""),onClick:()=>{n!==r&&(b.current={[r]:!0},c(r))},children:[(0,e.jsx)(f.default,{source:o?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover"}),d?.[r]&&a?(0,e.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6"),children:[(0,e.jsxs)("div",{className:"mr-1 flex-1 overflow-hidden",children:[(0,e.jsx)("p",{className:"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]",children:o?.title}),(0,e.jsx)("h3",{className:"desktop:text-lg text-sm font-medium text-[#FFFFFF]",children:o?.subTitle})]}),(0,e.jsx)(p.default,{size:"sm",hoverEffect:"slide",variant:"secondary",className:(0,l.cn)("desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",t?.shape==="round"?"rounded-2xl":""),children:(0,e.jsx)("a",{href:o?.link,children:t?.primaryButton})})]}):null]},r)})})}),(0,e.jsx)("div",{className:"tablet:hidden block",children:(0,e.jsx)(g.default,{className:(0,l.cn)("h-[400px] !overflow-visible",s),id:"AccordionCards"+t?.key,data:{list:t?.products,configuration:{shape:t?.shape,primaryButton:t?.primaryButton}},Slide:k,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})})]})};var S=L;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AccordionCards/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { useState, useEffect, useRef } from 'react'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: {\n url: string\n }\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n}\n\ntype AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n }\n}\n\nconst AccordionCards = ({ data, className = '' }: AccordionCardsType) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n const [currentWidth, setCurrentWidth] = useState<{ [key: number]: boolean }>({ 0: true })\n\n const accordionRef = useRef<HTMLDivElement[]>([])\n const enterRef = useRef<{ [key: number]: boolean }>({ 0: true })\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n const handleTransitionEnd = (index: number) => {\n if (enterRef.current?.[index]) {\n setCurrentWidth({ [index]: true })\n }\n }\n\n useEffect(() => {\n const element = accordionRef.current\n element?.forEach((item, index) => {\n if (!index) {\n item.style = 'flex: 5 1 0%; transition: all 0.15s'\n } else {\n item.style = 'flex: 1 1 0%; transition: all 0.15s'\n }\n item.addEventListener('transitionend', () => handleTransitionEnd(index))\n })\n return () => {\n element?.forEach((item, index) => {\n item.removeEventListener('transitionend', () => handleTransitionEnd(index))\n })\n }\n }, [])\n\n const MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n return (\n <div className=\"relative shrink-0 grow-0 basis-[296px] border border-solid border-[#dddddd] bg-[#FFFFFF]\">\n <Picture className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\" source={data?.img?.url} />\n <div className={cn('absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6')}>\n <div className=\"mb-6 flex-1 overflow-hidden\">\n <p className=\"mb-1 text-2xl font-bold text-[#FFFFFF]\">{data?.title}</p>\n <h3 className=\"text-sm font-medium text-[#FFFFFF]\">{data?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={data.link}>{configuration?.primaryButton}</a>\n </Button>\n </div>\n </div>\n )\n }\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div className=\"tablet:block hidden\">\n <div\n className={cn('laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden', className)}\n >\n {data?.products?.map((item, idx) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 5 : 1\n return (\n <div\n key={idx}\n style={{\n flex: flexValue,\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn(\n 'relative cursor-pointer overflow-hidden',\n data?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n onClick={() => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0 ref \u72B6\u6001\n enterRef.current = { [idx]: true }\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n }}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n {currentWidth?.[idx] && isExpanded ? (\n <div\n className={cn(\n 'absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6'\n )}\n >\n <div className=\"mr-1 flex-1 overflow-hidden\">\n <p className=\"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]\">\n {item?.title}\n </p>\n <h3 className=\"desktop:text-lg text-sm font-medium text-[#FFFFFF]\">{item?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n data?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={item?.link}>{data?.primaryButton}</a>\n </Button>\n </div>\n ) : null}\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n primaryButton: data?.primaryButton,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </>\n )\n}\n\nexport default AccordionCards\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2EQ,IAAAI,EAAA,6BA1ERC,EAAkB,gCAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAsB,oCACtBC,EAA4C,iBA8B5C,MAAMC,EAAiB,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,EAAG,IAA0B,CACvE,KAAM,CAACC,EAAYC,CAAa,KAAI,YAAwB,CAAC,EACvD,CAACC,EAAcC,CAAe,KAAI,YAAqC,CAAE,EAAG,EAAK,CAAC,EAElFC,KAAe,UAAyB,CAAC,CAAC,EAC1CC,KAAW,UAAmC,CAAE,EAAG,EAAK,CAAC,EAEzDC,EAAS,CAACC,EAAeC,IAAuB,CAChDA,IACFJ,EAAa,QAAQG,CAAK,EAAIC,EAElC,EAEMC,EAAuBF,GAAkB,CACzCF,EAAS,UAAUE,CAAK,GAC1BJ,EAAgB,CAAE,CAACI,CAAK,EAAG,EAAK,CAAC,CAErC,KAEA,aAAU,IAAM,CACd,MAAMG,EAAUN,EAAa,QAC7B,OAAAM,GAAS,QAAQ,CAACC,EAAMJ,IAAU,CAC3BA,EAGHI,EAAK,MAAQ,sCAFbA,EA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AAE,CAACY,CAAG,EAAG,EAAK,EAEjChB,EAAcgB,CAAG,EACnB,EAEA,oBAAC,EAAAH,QAAA,CACC,OAAQH,GAAM,KAAK,IACnB,UAAU,6DACZ,EACCT,IAAee,CAAG,GAAKC,KACtB,QAAC,OACC,aAAW,MACT,sFACF,EAEA,qBAAC,OAAI,UAAU,8BACb,oBAAC,KAAE,UAAU,4EACV,SAAAP,GAAM,MACT,KACA,OAAC,MAAG,UAAU,qDAAsD,SAAAA,GAAM,SAAS,GACrF,KACA,OAAC,EAAAI,QAAA,CACC,KAAK,KACL,YAAY,QACZ,QAAQ,YACR,aAAW,MACT,4GACAjB,GAAM,QAAU,QAAU,cAAgB,EAC5C,EAEA,mBAAC,KAAE,KAAMa,GAAM,KAAO,SAAAb,GAAM,cAAc,EAC5C,GACF,EACE,OA/CCmB,CAgDP,CAEJ,CAAC,EACH,EACF,KACA,OAAC,OAAI,UAAU,sBACb,mBAAC,EAAAE,QAAA,CACC,aAAW,MAAG,8BAA+BpB,CAAS,EACtD,GAAI,iBAAmBD,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,cAAeA,GAAM,aACvB,CACF,EACA,MAAOc,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,EAEA,IAAOxB,EAAQS",
4
+ "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { useState, useEffect, useRef } from 'react'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: {\n url: string\n }\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n}\n\ntype AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n }\n}\n\nconst AccordionCards = ({ data, className = '' }: AccordionCardsType) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n const [currentWidth, setCurrentWidth] = useState<{ [key: number]: boolean }>({ 0: true })\n\n const accordionRef = useRef<HTMLDivElement[]>([])\n const enterRef = useRef<{ [key: number]: boolean }>({ 0: true })\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n const handleTransitionEnd = (index: number) => {\n if (enterRef.current?.[index]) {\n setCurrentWidth({ [index]: true })\n }\n }\n\n useEffect(() => {\n const element = accordionRef.current\n element?.forEach((item, index) => {\n if (!index) {\n item.style = 'flex: 5 1 0%; transition: all 0.15s'\n } else {\n item.style = 'flex: 1 1 0%; transition: all 0.15s'\n }\n item.addEventListener('transitionend', () => handleTransitionEnd(index))\n })\n return () => {\n element?.forEach((item, index) => {\n item.removeEventListener('transitionend', () => handleTransitionEnd(index))\n })\n }\n }, [])\n\n const MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n return (\n <div className=\"relative w-full shrink-0 grow-0 border border-solid border-[#dddddd] bg-[#FFFFFF]\">\n <Picture className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\" source={data?.img?.url} />\n <div className={cn('absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6')}>\n <div className=\"mb-6 flex-1 overflow-hidden\">\n <p className=\"mb-1 text-2xl font-bold text-[#FFFFFF]\">{data?.title}</p>\n <h3 className=\"text-sm font-medium text-[#FFFFFF]\">{data?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={data.link}>{configuration?.primaryButton}</a>\n </Button>\n </div>\n </div>\n )\n }\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div className=\"tablet:block hidden\">\n <div\n className={cn('laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden', className)}\n >\n {data?.products?.map((item, idx) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 5 : 1\n return (\n <div\n key={idx}\n style={{\n flex: flexValue,\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn(\n 'relative cursor-pointer overflow-hidden',\n data?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n onClick={() => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0 ref \u72B6\u6001\n enterRef.current = { [idx]: true }\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n }}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n {currentWidth?.[idx] && isExpanded ? (\n <div\n className={cn(\n 'absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6'\n )}\n >\n <div className=\"mr-1 flex-1 overflow-hidden\">\n <p className=\"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]\">\n {item?.title}\n </p>\n <h3 className=\"desktop:text-lg text-sm font-medium text-[#FFFFFF]\">{item?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n data?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={item?.link}>{data?.primaryButton}</a>\n </Button>\n </div>\n ) : null}\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n primaryButton: data?.primaryButton,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </>\n )\n}\n\nexport default AccordionCards\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2EQ,IAAAI,EAAA,6BA1ERC,EAAkB,gCAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAsB,oCACtBC,EAA4C,iBA8B5C,MAAMC,EAAiB,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,EAAG,IAA0B,CACvE,KAAM,CAACC,EAAYC,CAAa,KAAI,YAAwB,CAAC,EACvD,CAACC,EAAcC,CAAe,KAAI,YAAqC,CAAE,EAAG,EAAK,CAAC,EAElFC,KAAe,UAAyB,CAAC,CAAC,EAC1CC,KAAW,UAAmC,CAAE,EAAG,EAAK,CAAC,EAEzDC,EAAS,CAACC,EAAeC,IAAuB,CAChDA,IACFJ,EAAa,QAAQG,CAAK,EAAIC,EAElC,EAEMC,EAAuBF,GAAkB,CACzCF,EAAS,UAAUE,CAAK,GAC1BJ,EAAgB,CAAE,CAACI,CAAK,EAAG,EAAK,CAAC,CAErC,KAEA,aAAU,IAAM,CACd,MAAMG,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AW,MACT,0CACAV,GAAM,YAAc,QAAU,cAAgB,EAChD,EACA,QAAS,IAAM,CACTE,IAAeiB,IAEnBZ,EAAS,QAAU,CAAE,CAACY,CAAG,EAAG,EAAK,EAEjChB,EAAcgB,CAAG,EACnB,EAEA,oBAAC,EAAAH,QAAA,CACC,OAAQH,GAAM,KAAK,IACnB,UAAU,6DACZ,EACCT,IAAee,CAAG,GAAKC,KACtB,QAAC,OACC,aAAW,MACT,sFACF,EAEA,qBAAC,OAAI,UAAU,8BACb,oBAAC,KAAE,UAAU,4EACV,SAAAP,GAAM,MACT,KACA,OAAC,MAAG,UAAU,qDAAsD,SAAAA,GAAM,SAAS,GACrF,KACA,OAAC,EAAAI,QAAA,CACC,KAAK,KACL,YAAY,QACZ,QAAQ,YACR,aAAW,MACT,4GACAjB,GAAM,QAAU,QAAU,cAAgB,EAC5C,EAEA,mBAAC,KAAE,KAAMa,GAAM,KAAO,SAAAb,GAAM,cAAc,EAC5C,GACF,EACE,OA/CCmB,CAgDP,CAEJ,CAAC,EACH,EACF,KACA,OAAC,OAAI,UAAU,sBACb,mBAAC,EAAAE,QAAA,CACC,aAAW,MAAG,8BAA+BpB,CAAS,EACtD,GAAI,iBAAmBD,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,cAAeA,GAAM,aACvB,CACF,EACA,MAAOc,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,EAEA,IAAOxB,EAAQS",
6
6
  "names": ["AccordionCards_exports", "__export", "AccordionCards_default", "__toCommonJS", "import_jsx_runtime", "import_Title", "import_utils", "import_picture", "import_button", "import_SwiperBox", "import_react", "AccordionCards", "data", "className", "hoverIndex", "setHoverIndex", "currentWidth", "setCurrentWidth", "accordionRef", "enterRef", "getRef", "index", "el", "handleTransitionEnd", "element", "item", "MobileItem", "configuration", "Picture", "Button", "Title", "idx", "isExpanded", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var g=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},n=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of x(t))!w.call(e,a)&&a!==r&&i(e,a,{get:()=>t[a],enumerable:!(s=u(t,a))||s.enumerable});return e};var l=(e,t,r)=>(r=e!=null?g(b(e)):{},n(t||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),h=e=>n(i({},"__esModule",{value:!0}),e);var N={};y(N,{default:()=>F});module.exports=h(N);var o=require("react/jsx-runtime"),k=require("react"),p=require("../../helpers/utils.js"),c=l(require("../../components/picture.js")),d=require("../../shared/Styles.js"),m=l(require("../Title/index.js")),f=l(require("../SwiperBox/index.js"));const C=({data:e,configuration:t})=>(0,o.jsxs)("div",{className:(0,p.cn)("box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]","laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]",t?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[(0,o.jsx)(c.default,{className:"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover",source:e?.image}),(0,o.jsx)("p",{className:"tablet:text-lg flex-1 text-center text-sm font-semibold",children:e?.name})]}),v=({data:e,buildData:t,className:r="",key:s})=>(0,o.jsxs)("div",{className:(0,p.cn)("w-full",r),children:[e?.title&&(0,o.jsx)(m.default,{data:{title:e?.title}}),(0,o.jsx)(f.default,{className:"!overflow-visible",id:"Category"+s,data:{list:e?.products,configuration:{shape:e?.shape}},Slide:C,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:2.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:6}}})]});var F=(0,d.withStyles)(v);
1
+ "use strict";"use client";var g=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},n=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of x(t))!w.call(e,a)&&a!==r&&i(e,a,{get:()=>t[a],enumerable:!(s=u(t,a))||s.enumerable});return e};var l=(e,t,r)=>(r=e!=null?g(b(e)):{},n(t||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),h=e=>n(i({},"__esModule",{value:!0}),e);var N={};y(N,{default:()=>F});module.exports=h(N);var o=require("react/jsx-runtime"),k=require("react"),p=require("../../helpers/utils.js"),c=l(require("../../components/picture.js")),d=require("../../shared/Styles.js"),m=l(require("../Title/index.js")),f=l(require("../SwiperBox/index.js"));const C=({data:e,configuration:t})=>(0,o.jsxs)("div",{className:(0,p.cn)("box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]","laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]",t?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[(0,o.jsx)(c.default,{className:"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover",source:e?.image}),(0,o.jsx)("p",{className:"tablet:text-lg flex-1 text-center text-sm font-semibold",children:e?.name})]}),v=({data:e,buildData:t,className:r="",key:s})=>(0,o.jsxs)("div",{className:(0,p.cn)("w-full",r),children:[e?.title&&(0,o.jsx)(m.default,{data:{title:e?.title}}),(0,o.jsx)(f.default,{className:"!overflow-visible",id:"Category"+s,data:{list:e?.products,configuration:{shape:e?.shape}},Slide:C,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:3.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:6}}})]});var F=(0,d.withStyles)(v);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: string\n name: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n data: {\n products: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n key?: string\n}\n\nconst CategoryItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]',\n 'laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture className=\"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover\" source={data?.image} />\n <p className=\"tablet:text-lg flex-1 text-center text-sm font-semibold\">{data?.name}</p>\n </div>\n )\n}\n\nconst Category: React.FC<CategoryProps> = ({ data, buildData, className = '', key }) => {\n return (\n <div className={cn('w-full', className)}>\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Category' + key}\n data={{ list: data?.products, configuration: { shape: data?.shape } }}\n Slide={CategoryItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 2.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 6,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(Category)\n"],
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: string\n name: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n data: {\n products: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n key?: string\n}\n\nconst CategoryItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]',\n 'laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture className=\"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover\" source={data?.image} />\n <p className=\"tablet:text-lg flex-1 text-center text-sm font-semibold\">{data?.name}</p>\n </div>\n )\n}\n\nconst Category: React.FC<CategoryProps> = ({ data, buildData, className = '', key }) => {\n return (\n <div className={cn('w-full', className)}>\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Category' + key}\n data={{ list: data?.products, configuration: { shape: data?.shape } }}\n Slide={CategoryItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 3.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 6,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(Category)\n"],
5
5
  "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiCI,IAAAI,EAAA,6BAhCJC,EAAkB,iBAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA2B,kCAC3BC,EAAkB,gCAClBC,EAAsB,oCAyBtB,MAAMC,EAAe,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,OAExC,QAAC,OACC,aAAW,MACT,+DACA,+DACAA,GAAe,QAAU,QAAU,iBAAmB,cACxD,EAEA,oBAAC,EAAAC,QAAA,CAAQ,UAAU,uEAAuE,OAAQF,GAAM,MAAO,KAC/G,OAAC,KAAE,UAAU,0DAA2D,SAAAA,GAAM,KAAK,GACrF,EAIEG,EAAoC,CAAC,CAAE,KAAAH,EAAM,UAAAI,EAAW,UAAAC,EAAY,GAAI,IAAAC,CAAI,OAE9E,QAAC,OAAI,aAAW,MAAG,SAAUD,CAAS,EACnC,UAAAL,GAAM,UAAS,OAAC,EAAAO,QAAA,CAAM,KAAM,CAAE,MAAOP,GAAM,KAAM,EAAG,KACrD,OAAC,EAAAQ,QAAA,CACC,UAAU,oBACV,GAAI,WAAaF,EACjB,KAAM,CAAE,KAAMN,GAAM,SAAU,cAAe,CAAE,MAAOA,GAAM,KAAM,CAAE,EACpE,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EAIJ,IAAOT,KAAQ,cAAWa,CAAQ",
6
6
  "names": ["Category_exports", "__export", "Category_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_Title", "import_SwiperBox", "CategoryItem", "data", "configuration", "Picture", "Category", "buildData", "className", "key", "Title", "SwiperBox"]
7
7
  }
@@ -1,4 +1,4 @@
1
- "use strict";"use client";var q=Object.create;var x=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var a in t)x(e,a,{get:t[a],enumerable:!0})},T=(e,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of L(t))!U.call(e,s)&&s!==a&&x(e,s,{get:()=>t[s],enumerable:!(l=M(t,s))||l.enumerable});return e};var f=(e,t,a)=>(a=e!=null?q(R(e)):{},T(t||!e||!e.__esModule?x(a,"default",{value:e,enumerable:!0}):a,e)),j=e=>T(x({},"__esModule",{value:!0}),e);var H={};$(H,{default:()=>G});module.exports=j(H);var r=require("react/jsx-runtime"),u=require("react"),y=require("../../helpers/utils.js"),B=f(require("../../components/picture.js")),d=require("../../components/tabs.js"),D=f(require("../../components/button.js")),N=f(require("../Title/index.js")),C=f(require("../SwiperBox/index.js")),I=require("../../shared/Styles.js"),P=require("./shelfDisplay.js");const z=({data:e,configuration:t})=>{const a=o=>t?.event?.primaryButton?.(o),l=o=>t?.event?.secondaryButton?.(o),{price:s,basePrice:h}=(0,P.formatVariantPrice)({locale:"us",amount:e?.price.amount||0,baseAmount:e?.compareAtPrice?.amount||e?.price.amount||0,currencyCode:e?.price.currencyCode||"USD"}),b=()=>{const o=e?.sku,i=e?.variants;return i?.find(v=>v?.sku===o)?.image?.url||i?.[0]?.image?.url||""};return(0,r.jsxs)("div",{className:(0,y.cn)("laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4",t?.itemShape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("div",{className:(0,y.cn)("relative mb-2 inline-block h-[137px] overflow-hidden","tablet:mb-3 tablet:h-[195px]"),children:(0,r.jsx)(B.default,{source:b(),className:"flex h-full justify-center object-cover [&_img]:w-auto"})}),(0,r.jsx)("div",{className:"tablet:mb-2 mb-1 flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.slice(0,1)?.map?.((o,i)=>(0,r.jsx)("div",{className:"tablet:text-base rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]",children:o},i))}),(0,r.jsx)("p",{title:e?.title||"",className:"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]",children:e?.title||""}),(0,r.jsx)("h3",{title:e?.description||"",className:"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]",children:e?.description||""}),(0,r.jsxs)("div",{className:"mb-2 flex items-center",children:[(0,r.jsx)("div",{className:"tablet:text-2xl text-xl font-bold text-[#1D1D1F]",children:s||""}),(0,r.jsx)("div",{className:"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]",children:h||""})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(D.default,{variant:"primary",onClick:()=>a(e),className:`
1
+ "use strict";"use client";var q=Object.create;var x=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var a in t)x(e,a,{get:t[a],enumerable:!0})},T=(e,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of L(t))!U.call(e,s)&&s!==a&&x(e,s,{get:()=>t[s],enumerable:!(l=M(t,s))||l.enumerable});return e};var f=(e,t,a)=>(a=e!=null?q(R(e)):{},T(t||!e||!e.__esModule?x(a,"default",{value:e,enumerable:!0}):a,e)),j=e=>T(x({},"__esModule",{value:!0}),e);var H={};$(H,{default:()=>G});module.exports=j(H);var r=require("react/jsx-runtime"),u=require("react"),y=require("../../helpers/utils.js"),B=f(require("../../components/picture.js")),d=require("../../components/tabs.js"),D=f(require("../../components/button.js")),N=f(require("../Title/index.js")),C=f(require("../SwiperBox/index.js")),I=require("../../shared/Styles.js"),P=require("./shelfDisplay.js");const z=({data:e,configuration:t})=>{const a=o=>t?.event?.primaryButton?.(o),l=o=>t?.event?.secondaryButton?.(o),{price:s,basePrice:h}=(0,P.formatVariantPrice)({locale:"us",amount:e?.price.amount||0,baseAmount:e?.compareAtPrice?.amount||e?.price.amount||0,currencyCode:e?.price.currencyCode||"USD"}),b=()=>{const o=e?.sku,i=e?.variants;return i?.find(v=>v?.sku===o)?.image?.url||i?.[0]?.image?.url||""};return(0,r.jsxs)("div",{className:(0,y.cn)("laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4",t?.itemShape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("div",{className:(0,y.cn)("relative mb-2 inline-block h-[137px] overflow-hidden","tablet:mb-3 tablet:h-[195px]"),children:(0,r.jsx)(B.default,{source:b(),className:"flex h-full justify-center object-cover [&_img]:w-auto"})}),(0,r.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.slice(0,1)?.map?.((o,i)=>(0,r.jsx)("div",{className:"tablet:text-base box-border h-full rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]",children:o},i))}),(0,r.jsx)("p",{title:e?.title||"",className:"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]",children:e?.title||""}),(0,r.jsx)("h3",{title:e?.description||"",className:"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]",children:e?.description||""}),(0,r.jsxs)("div",{className:"mb-2 flex items-center",children:[(0,r.jsx)("div",{className:"tablet:text-2xl text-xl font-bold text-[#1D1D1F]",children:s||""}),(0,r.jsx)("div",{className:"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]",children:h||""})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(D.default,{variant:"primary",onClick:()=>a(e),className:`
2
2
  laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border
3
3
  border-[#1D1D1F] bg-transparent px-4 py-2 text-xs text-[#1D1D1F] hover:bg-transparent hover:text-black
4
4
  ${t?.shape==="round"?"desktop:rounded-3xl rounded-[20px]":""}
@@ -6,5 +6,5 @@
6
6
  laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border
7
7
  border-[#1D1D1F] bg-[#1D1D1F] px-4 py-2 text-xs tracking-[-0.04em] text-white
8
8
  ${t?.shape==="round"?"desktop:rounded-3xl rounded-[20px]":""}
9
- `,children:t?.secondaryButton||""})]})]},e?.id||e?.handle)},_=({data:e,buildData:t,className:a="",key:l,event:s})=>{const[h,b]=(0,u.useState)(""),[o,i]=(0,u.useState)([]),{productsTab:m=[],productsCard:v=[],title:k,align:F="left",isShowTab:S=!0,tabShape:E="square",...A}=e,g=n=>{const c=n?.map(p=>{const w=t?.products?.find(V=>V?.handle===p?.handle);if(w)return{sku:p.sku,...w}})?.filter(p=>p);i(c)};return(0,u.useEffect)(()=>{if(S){b(m?.[0]?.tab||""),g(m?.[0]?.data||[]);return}g(v)},[]),(0,r.jsxs)("div",{className:(0,y.cn)("w-full",a),children:[k&&(0,r.jsx)(N.default,{data:{title:k}}),S&&(0,r.jsx)(d.Tabs,{shape:E,align:F,value:h,onValueChange:n=>{b(n);const c=m?.find(p=>p?.tab===n);g(c?.data||[])},className:"mb-8",children:(0,r.jsx)(d.TabsList,{children:m?.map((n,c)=>(0,r.jsx)(d.TabsTrigger,{value:n?.tab||"",children:n?.tab},c))})}),(0,r.jsx)(C.default,{className:"!overflow-visible",id:"ShelfDisplay"+l,data:{list:o,configuration:{...A,event:s}},Slide:z,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.1},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})]})};var G=(0,I.withStyles)(_);
9
+ `,children:t?.secondaryButton||""})]})]},e?.id||e?.handle)},_=({data:e,buildData:t,className:a="",key:l,event:s})=>{const[h,b]=(0,u.useState)(""),[o,i]=(0,u.useState)([]),{productsTab:c=[],productsCard:v=[],title:k,align:F="left",isShowTab:S=!0,tabShape:E="square",...A}=e,g=n=>{const m=n?.map(p=>{const w=t?.products?.find(V=>V?.handle===p?.handle);if(w)return{sku:p.sku,...w}})?.filter(p=>p);i(m)};return(0,u.useEffect)(()=>{if(S){b(c?.[0]?.tab||""),g(c?.[0]?.data||[]);return}g(v)},[]),(0,r.jsxs)("div",{className:(0,y.cn)("w-full",a),children:[k&&(0,r.jsx)(N.default,{data:{title:k}}),S&&(0,r.jsx)(d.Tabs,{shape:E,align:F,value:h,onValueChange:n=>{b(n);const m=c?.find(p=>p?.tab===n);g(m?.data||[])},className:"mb-8",children:(0,r.jsx)(d.TabsList,{children:c?.map((n,m)=>(0,r.jsx)(d.TabsTrigger,{value:n?.tab||"",children:n?.tab},m))})}),(0,r.jsx)(C.default,{className:"!overflow-visible",id:"ShelfDisplay"+l,data:{list:o,configuration:{...A,event:s}},Slide:z,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.1},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})]})};var G=(0,I.withStyles)(_);
10
10
  //# 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 } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\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}\n\ntype EventType = {\n primaryButton?: (v: any) => void\n secondaryButton?: (v: any) => void\n}\n\nexport interface ShelfDisplayProps {\n data: {\n title?: string\n isShowTab?: boolean\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 /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n className?: string\n key?: string\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const onPrimaryButton = (params: ShelfDisplayItem) => configuration?.event?.primaryButton?.(params)\n\n const onSecondaryButton = (params: ShelfDisplayItem) => configuration?.event?.secondaryButton?.(params)\n\n const { price, basePrice } = formatVariantPrice({\n locale: 'us',\n amount: data?.price.amount || 0,\n baseAmount: data?.compareAtPrice?.amount || data?.price.amount || 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 return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className={cn('relative mb-2 inline-block h-[137px] overflow-hidden', 'tablet:mb-3 tablet:h-[195px]')}>\n <Picture source={handleUrl()} className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </div>\n <div className=\"tablet:mb-2 mb-1 flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags?.slice(0, 1)?.map?.((item: any, index: number) => {\n return (\n <div\n key={index}\n className=\"tablet:text-base rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]\"\n >\n {item}\n </div>\n )\n })}\n </div>\n <p\n title={data?.title || ''}\n className=\"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]\"\n >\n {data?.title || ''}\n </p>\n <h3\n title={data?.description || ''}\n className=\"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]\"\n >\n {data?.description || ''}\n </h3>\n <div className=\"mb-2 flex items-center\">\n <div className=\"tablet:text-2xl text-xl font-bold text-[#1D1D1F]\">{price || ''}</div>\n <div className=\"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]\">{basePrice || ''}</div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"flex items-center gap-3\">\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-transparent px-4 py-2 text-xs text-[#1D1D1F] hover:bg-transparent hover:text-black\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-[#1D1D1F] px-4 py-2 text-xs tracking-[-0.04em] text-white\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay: React.FC<ShelfDisplayProps> = ({ data, buildData, className = '', key, event }) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n align = 'left',\n isShowTab = true,\n tabShape = 'square',\n ...other\n } = data\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[]) => {\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 ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData)\n }\n\n useEffect(() => {\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [])\n return\n }\n handleCurrentTab(productsCard)\n }, [])\n\n return (\n <div className={cn('w-full', className)}>\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <Tabs\n shape={tabShape}\n align={align}\n value={tabId}\n onValueChange={v => {\n setTabId(v)\n const findData = productsTab?.find((item: any) => item?.tab === v)\n handleCurrentTab(findData?.data || [])\n }}\n className=\"mb-8\"\n >\n <TabsList>\n {productsTab?.map((item: any, index: number) => {\n return (\n <TabsTrigger key={index} value={item?.tab || ''}>\n {item?.tab}\n </TabsTrigger>\n )\n })}\n </TabsList>\n </Tabs>\n )}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'ShelfDisplay' + key}\n data={{ list: currentItems, configuration: { ...other, event: event } }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.1,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(ShelfDisplay)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6FQ,IAAAI,EAAA,6BA5FRC,EAA2C,iBAC3CC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA4C,oCAC5CC,EAAmB,yCACnBC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAmC,6BAwDnC,MAAMC,EAAmB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAA0C,CACxF,MAAMC,EAAmBC,GAA6BF,GAAe,OAAO,gBAAgBE,CAAM,EAE5FC,EAAqBD,GAA6BF,GAAe,OAAO,kBAAkBE,CAAM,EAEhG,CAAE,MAAAE,EAAO,UAAAC,CAAU,KAAI,sBAAmB,CAC9C,OAAQ,KACR,OAAQN,GAAM,MAAM,QAAU,EAC9B,WAAYA,GAAM,gBAAgB,QAAUA,GAAM,MAAM,QAAU,EAClE,aAAcA,GAAM,MAAM,cAAgB,KAC5C,CAAC,EAEKO,EAAY,IAAM,CACtB,MAAMC,EAAMR,GAAM,IACZS,EAAWT,GAAM,SAEvB,OADgBS,GAAU,KAAMC,GAAcA,GAAM,MAAQF,CAAG,GAC/C,OAAO,KAAOC,IAAW,CAAC,GAAG,OAAO,KAAO,EAC7D,EAEA,SACE,QAAC,OAEC,aAAW,MACT,8GACAR,GAAe,Y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AOnB,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,CAEJ,EAEA,IAAOZ,KAAQ,cAAW2B,CAAY",
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\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}\n\ntype EventType = {\n primaryButton?: (v: any) => void\n secondaryButton?: (v: any) => void\n}\n\nexport interface ShelfDisplayProps {\n data: {\n title?: string\n isShowTab?: boolean\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 /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n className?: string\n key?: string\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const onPrimaryButton = (params: ShelfDisplayItem) => configuration?.event?.primaryButton?.(params)\n\n const onSecondaryButton = (params: ShelfDisplayItem) => configuration?.event?.secondaryButton?.(params)\n\n const { price, basePrice } = formatVariantPrice({\n locale: 'us',\n amount: data?.price.amount || 0,\n baseAmount: data?.compareAtPrice?.amount || data?.price.amount || 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 return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className={cn('relative mb-2 inline-block h-[137px] overflow-hidden', 'tablet:mb-3 tablet:h-[195px]')}>\n <Picture source={handleUrl()} className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </div>\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags?.slice(0, 1)?.map?.((item: any, index: number) => {\n return (\n <div\n key={index}\n className=\"tablet:text-base box-border h-full rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]\"\n >\n {item}\n </div>\n )\n })}\n </div>\n <p\n title={data?.title || ''}\n className=\"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]\"\n >\n {data?.title || ''}\n </p>\n <h3\n title={data?.description || ''}\n className=\"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]\"\n >\n {data?.description || ''}\n </h3>\n <div className=\"mb-2 flex items-center\">\n <div className=\"tablet:text-2xl text-xl font-bold text-[#1D1D1F]\">{price || ''}</div>\n <div className=\"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]\">{basePrice || ''}</div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"flex items-center gap-3\">\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-transparent px-4 py-2 text-xs text-[#1D1D1F] hover:bg-transparent hover:text-black\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-[#1D1D1F] px-4 py-2 text-xs tracking-[-0.04em] text-white\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay: React.FC<ShelfDisplayProps> = ({ data, buildData, className = '', key, event }) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n align = 'left',\n isShowTab = true,\n tabShape = 'square',\n ...other\n } = data\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[]) => {\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 ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData)\n }\n\n useEffect(() => {\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [])\n return\n }\n handleCurrentTab(productsCard)\n }, [])\n\n return (\n <div className={cn('w-full', className)}>\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <Tabs\n shape={tabShape}\n align={align}\n value={tabId}\n onValueChange={v => {\n setTabId(v)\n const findData = productsTab?.find((item: any) => item?.tab === v)\n handleCurrentTab(findData?.data || [])\n }}\n className=\"mb-8\"\n >\n <TabsList>\n {productsTab?.map((item: any, index: number) => {\n return (\n <TabsTrigger key={index} value={item?.tab || ''}>\n {item?.tab}\n </TabsTrigger>\n )\n })}\n </TabsList>\n </Tabs>\n )}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'ShelfDisplay' + key}\n data={{ list: currentItems, configuration: { ...other, event: event } }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.1,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(ShelfDisplay)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6FQ,IAAAI,EAAA,6BA5FRC,EAA2C,iBAC3CC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA4C,oCAC5CC,EAAmB,yCACnBC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAmC,6BAwDnC,MAAMC,EAAmB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAA0C,CACxF,MAAMC,EAAmBC,GAA6BF,GAAe,OAAO,gBAAgBE,CAAM,EAE5FC,EAAqBD,GAA6BF,GAAe,OAAO,kBAAkBE,CAAM,EAEhG,CAAE,MAAAE,EAAO,UAAAC,CAAU,KAAI,sBAAmB,CAC9C,OAAQ,KACR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QyB,CAAC,EACjEL,EAAiBG,GAAU,MAAQ,CAAC,CAAC,CACvC,EACA,UAAU,OAEV,mBAAC,YACE,SAAAV,GAAa,IAAI,CAACb,EAAWE,OAE1B,OAAC,eAAwB,MAAOF,GAAM,KAAO,GAC1C,SAAAA,GAAM,KADSE,CAElB,CAEH,EACH,EACF,KAEF,OAAC,EAAAwB,QAAA,CACC,UAAU,oBACV,GAAI,eAAiBnB,EACrB,KAAM,CAAE,KAAMI,EAAc,cAAe,CAAE,GAAGQ,EAAO,MAAOX,CAAM,CAAE,EACtE,MAAOnB,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,CAEJ,EAEA,IAAOZ,KAAQ,cAAW2B,CAAY",
6
6
  "names": ["ShelfDisplay_exports", "__export", "ShelfDisplay_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_tabs", "import_button", "import_Title", "import_SwiperBox", "import_Styles", "import_shelfDisplay", "ShelfDisplayItem", "data", "configuration", "onPrimaryButton", "params", "onSecondaryButton", "price", "basePrice", "handleUrl", "sku", "skuArray", "item", "Picture", "index", "Button", "ShelfDisplay", "buildData", "className", "key", "event", "tabId", "setTabId", "currentItems", "setCurrentItems", "productsTab", "productsCard", "title", "align", "isShowTab", "tabShape", "other", "handleCurrentTab", "currentData", "newCurrentData", "findData", "Title", "v", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var w=Object.create;var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var N=(n,a)=>{for(var o in a)m(n,o,{get:a[o],enumerable:!0})},x=(n,a,o,b)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of g(a))!h.call(n,i)&&i!==o&&m(n,i,{get:()=>a[i],enumerable:!(b=k(a,i))||b.enumerable});return n};var B=(n,a,o)=>(o=n!=null?w(y(n)):{},x(a||!n||!n.__esModule?m(o,"default",{value:n,enumerable:!0}):o,n)),C=n=>x(m({},"__esModule",{value:!0}),n);var P={};N(P,{default:()=>z});module.exports=C(P);var e=require("react/jsx-runtime"),s=require("../../helpers/utils.js"),c=require("../../components/index.js"),d=B(require("../CpnCountDown/index.js"));const j=n=>{const{id:a,image:o,imageMob:b,imageLink:i,content:f=[],cns:l}=n,u=t=>{if(t?.startsWith("http")&&(location.href=t),t?.startsWith("#")){const r=document.querySelector(t);r&&r.scrollIntoView({behavior:"smooth"})}};return(0,e.jsxs)("div",{id:a,className:(0,s.cn)("cpn-banner-container relative w-full",l?.container),children:[(0,e.jsx)(c.Picture,{loading:"eager",source:`${o}, ${b||o} 768`,className:(0,s.cn)("cpn-banner-picture",l?.picture),imgClassName:(0,s.cn)("cpn-banner-image h-full object-cover",l?.image),alt:""}),i&&(0,e.jsx)("a",{href:i,className:"absolute left-0 top-0 z-[1] size-full"}),(0,e.jsx)("div",{className:(0,s.cn)("cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center",l?.box),children:(0,e.jsx)("div",{className:"tablet:px-10 desktop:px-20 px-6",children:(0,e.jsx)("div",{className:(0,s.cn)("cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]",l?.content),children:f?.map((t,r)=>{switch(t.type){case"subheading":return(0,e.jsx)(c.Text,{as:"div",html:t.text,className:(0,s.cn)("cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",l?.subheading)},r);case"title":return(0,e.jsx)(c.Text,{as:"div",html:t.text,className:(0,s.cn)("cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]",l?.title)},r);case"subtitle":return(0,e.jsx)(c.Text,{as:"div",html:t.text,className:(0,s.cn)("cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",l?.subtitle)},r);case"button":return(0,e.jsx)("div",{className:(0,s.cn)("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",l?.buttonBox),children:(0,e.jsx)(c.Button,{className:(0,s.cn)("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",l?.button,t.cns),onClick:t.onClick?t.onClick:()=>u(t.target||""),children:t.text},r)});case"buttons":return(0,e.jsx)("div",{className:(0,s.cn)("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",l?.buttonBox),children:t.buttons.map((p,v)=>(0,e.jsx)(c.Button,{className:(0,s.cn)("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",l?.button,p.cns),onClick:p.onClick?p.onClick:()=>u(p.target||""),children:p.text},v))});case"countdown":return(0,e.jsx)("div",{className:"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center",children:(0,e.jsx)(d.default,{endTime:t.endTime,copy:t.copy,cns:l?.countdown})},r)}})})})})]})};var z=j;
1
+ "use strict";var w=Object.create;var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var N=(n,o)=>{for(var s in o)m(n,s,{get:o[s],enumerable:!0})},x=(n,o,s,b)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of g(o))!h.call(n,i)&&i!==s&&m(n,i,{get:()=>o[i],enumerable:!(b=k(o,i))||b.enumerable});return n};var B=(n,o,s)=>(s=n!=null?w(y(n)):{},x(o||!n||!n.__esModule?m(s,"default",{value:n,enumerable:!0}):s,n)),C=n=>x(m({},"__esModule",{value:!0}),n);var P={};N(P,{default:()=>z});module.exports=C(P);var e=require("react/jsx-runtime"),l=require("../../helpers/utils.js"),c=require("../../components/index.js"),d=B(require("../CpnCountDown/index.js"));const j=n=>{const{id:o,image:s,imageMob:b,imageLink:i,content:f=[],cns:a}=n,u=t=>{if(t?.startsWith("http")&&(location.href=t),t?.startsWith("#")){const r=document.querySelector(t);r&&r.scrollIntoView({behavior:"smooth"})}};return(0,e.jsxs)("div",{id:o,className:(0,l.cn)("cpn-banner-container relative w-full",a?.container),children:[(0,e.jsx)(c.Picture,{loading:"eager",source:`${s}, ${b||s} 768`,className:(0,l.cn)("cpn-banner-picture",a?.picture),imgClassName:(0,l.cn)("cpn-banner-image h-full object-cover",a?.image),alt:""}),i&&(0,e.jsx)("a",{href:i,className:"absolute left-0 top-0 z-[1] size-full"}),(0,e.jsx)("div",{className:(0,l.cn)("cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center",a?.box),children:(0,e.jsx)("div",{className:(0,l.cn)("cpn-banner-content-box tablet:px-10 desktop:px-20 px-6",a?.contentBox),children:(0,e.jsx)("div",{className:(0,l.cn)("cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]",a?.content),children:f?.map((t,r)=>{switch(t.type){case"subheading":return(0,e.jsx)(c.Text,{as:"div",html:t.text,className:(0,l.cn)("cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",a?.subheading)},r);case"title":return(0,e.jsx)(c.Text,{as:"div",html:t.text,className:(0,l.cn)("cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]",a?.title)},r);case"subtitle":return(0,e.jsx)(c.Text,{as:"div",html:t.text,className:(0,l.cn)("cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",a?.subtitle)},r);case"button":return(0,e.jsx)("div",{className:(0,l.cn)("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",a?.buttonBox),children:(0,e.jsx)(c.Button,{className:(0,l.cn)("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",a?.button,t.cns),onClick:t.onClick?t.onClick:()=>u(t.target||""),children:t.text},r)});case"buttons":return(0,e.jsx)("div",{className:(0,l.cn)("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",a?.buttonBox),children:t.buttons.map((p,v)=>(0,e.jsx)(c.Button,{className:(0,l.cn)("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",a?.button,p.cns),onClick:p.onClick?p.onClick:()=>u(p.target||""),children:p.text},v))});case"countdown":return(0,e.jsx)("div",{className:"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center",children:(0,e.jsx)(d.default,{endTime:t.endTime,copy:t.copy,cns:a?.countdown})},r)}})})})})]})};var z=j;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cpn-components/CpnBanner/index.tsx"],
4
- "sourcesContent": ["import type { BannerProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Picture, Text, Button } from '../../components/index.js'\nimport CountDown from '../CpnCountDown/index.js'\n\nconst CpnBanner = (props: BannerProps) => {\n const { id, image, imageMob, imageLink, content = [], cns } = props\n\n const btnClick = (target: string) => {\n if (target?.startsWith('http')) {\n location.href = target\n }\n if (target?.startsWith('#')) {\n const element = document.querySelector(target)\n if (element) {\n element.scrollIntoView({ behavior: 'smooth' })\n }\n }\n }\n\n return (\n <div id={id} className={cn('cpn-banner-container relative w-full', cns?.container)}>\n <Picture\n loading=\"eager\"\n source={`${image}, ${imageMob || image} 768`}\n className={cn('cpn-banner-picture', cns?.picture)}\n imgClassName={cn('cpn-banner-image h-full object-cover', cns?.image)}\n alt=\"\"\n />\n {imageLink && <a href={imageLink} className=\"absolute left-0 top-0 z-[1] size-full\"></a>}\n <div\n className={cn(\n 'cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center',\n cns?.box\n )}\n >\n <div className=\"tablet:px-10 desktop:px-20 px-6\">\n <div className={cn('cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]', cns?.content)}>\n {content?.map((item, index) => {\n switch (item.type) {\n case 'subheading':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subheading\n )}\n />\n )\n case 'title':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]',\n cns?.title\n )}\n />\n )\n case 'subtitle':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subtitle\n )}\n />\n )\n case 'button':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n item.cns\n )}\n onClick={item.onClick ? item.onClick : () => btnClick(item.target || '')}\n >\n {item.text}\n </Button>\n </div>\n )\n case 'buttons':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n {item.buttons.map((button, index) => (\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n button.cns\n )}\n onClick={button.onClick ? button.onClick : () => btnClick(button.target || '')}\n >\n {button.text}\n </Button>\n ))}\n </div>\n )\n case 'countdown':\n return (\n <div\n key={index}\n className=\"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center\"\n >\n <CountDown endTime={item.endTime} copy={item.copy} cns={cns?.countdown} />\n </div>\n )\n }\n })}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CpnBanner\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqBI,IAAAI,EAAA,6BApBJC,EAAmB,kCACnBC,EAAsC,qCACtCC,EAAsB,uCAEtB,MAAMC,EAAaC,GAAuB,CACxC,KAAM,CAAE,GAAAC,EAAI,MAAAC,EAAO,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,CAAC,EAAG,IAAAC,CAAI,EAAIN,EAExDO,EAAYC,GAAmB,CAInC,GAHIA,GAAQ,WAAW,MAAM,IAC3B,SAAS,KAAOA,GAEdA,GAAQ,WAAW,GAAG,EAAG,CAC3B,MAAMC,EAAU,SAAS,cAAcD,CAAM,EACzCC,GACFA,EAAQ,eAAe,CAAE,SAAU,QAAS,CAAC,CAEjD,CACF,EAEA,SACE,QAAC,OAAI,GAAIR,EAAI,aAAW,MAAG,uCAAwCK,GAAK,SAAS,EAC/E,oBAAC,WACC,QAAQ,QACR,OAAQ,GAAGJ,CAAK,KAAKC,GAAYD,CAAK,OACtC,aAAW,MAAG,qBAAsBI,GAAK,OAAO,EAChD,gBAAc,MAAG,uCAAwCA,GAAK,KAAK,EACnE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,CAAC,EACH,EACF,EACF,GACF,CAEJ,EAEA,IAAOlB,EAAQM",
4
+ "sourcesContent": ["import type { BannerProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Picture, Text, Button } from '../../components/index.js'\nimport CountDown from '../CpnCountDown/index.js'\n\nconst CpnBanner = (props: BannerProps) => {\n const { id, image, imageMob, imageLink, content = [], cns } = props\n\n const btnClick = (target: string) => {\n if (target?.startsWith('http')) {\n location.href = target\n }\n if (target?.startsWith('#')) {\n const element = document.querySelector(target)\n if (element) {\n element.scrollIntoView({ behavior: 'smooth' })\n }\n }\n }\n\n return (\n <div id={id} className={cn('cpn-banner-container relative w-full', cns?.container)}>\n <Picture\n loading=\"eager\"\n source={`${image}, ${imageMob || image} 768`}\n className={cn('cpn-banner-picture', cns?.picture)}\n imgClassName={cn('cpn-banner-image h-full object-cover', cns?.image)}\n alt=\"\"\n />\n {imageLink && <a href={imageLink} className=\"absolute left-0 top-0 z-[1] size-full\"></a>}\n <div\n className={cn(\n 'cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center',\n cns?.box\n )}\n >\n <div className={cn('cpn-banner-content-box tablet:px-10 desktop:px-20 px-6', cns?.contentBox)}>\n <div className={cn('cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]', cns?.content)}>\n {content?.map((item, index) => {\n switch (item.type) {\n case 'subheading':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subheading\n )}\n />\n )\n case 'title':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]',\n cns?.title\n )}\n />\n )\n case 'subtitle':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subtitle\n )}\n />\n )\n case 'button':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n item.cns\n )}\n onClick={item.onClick ? item.onClick : () => btnClick(item.target || '')}\n >\n {item.text}\n </Button>\n </div>\n )\n case 'buttons':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n {item.buttons.map((button, index) => (\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n button.cns\n )}\n onClick={button.onClick ? button.onClick : () => btnClick(button.target || '')}\n >\n {button.text}\n </Button>\n ))}\n </div>\n )\n case 'countdown':\n return (\n <div\n key={index}\n className=\"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center\"\n >\n <CountDown endTime={item.endTime} copy={item.copy} cns={cns?.countdown} />\n </div>\n )\n }\n })}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CpnBanner\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqBI,IAAAI,EAAA,6BApBJC,EAAmB,kCACnBC,EAAsC,qCACtCC,EAAsB,uCAEtB,MAAMC,EAAaC,GAAuB,CACxC,KAAM,CAAE,GAAAC,EAAI,MAAAC,EAAO,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU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U,IAAMH,EAASG,EAAK,QAAU,EAAE,EAEtE,SAAAA,EAAK,MARDC,CASP,EACF,EAEJ,IAAK,UACH,SACE,OAAC,OACC,aAAW,MACT,iFACAL,GAAK,SACP,EAEC,SAAAI,EAAK,QAAQ,IAAI,CAACE,EAAQD,OACzB,OAAC,UAEC,aAAW,MACT,qIACAL,GAAK,OACLM,EAAO,GACT,EACA,QAASA,EAAO,QAAUA,EAAO,QAAU,IAAML,EAASK,EAAO,QAAU,EAAE,EAE5E,SAAAA,EAAO,MARHD,CASP,CACD,EACH,EAEJ,IAAK,YACH,SACE,OAAC,OAEC,UAAU,iFAEV,mBAAC,EAAAE,QAAA,CAAU,QAASH,EAAK,QAAS,KAAMA,EAAK,KAAM,IAAKJ,GAAK,UAAW,GAHnEK,CAIP,CAEN,CACF,CAAC,EACH,EACF,EACF,GACF,CAEJ,EAEA,IAAOlB,EAAQM",
6
6
  "names": ["CpnBanner_exports", "__export", "CpnBanner_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_components", "import_CpnCountDown", "CpnBanner", "props", "id", "image", "imageMob", "imageLink", "content", "cns", "btnClick", "target", "element", "item", "index", "button", "CountDown"]
7
7
  }
@@ -30,6 +30,7 @@ export type BannerProps = {
30
30
  picture?: string;
31
31
  image?: string;
32
32
  box?: string;
33
+ contentBox?: string;
33
34
  content?: string;
34
35
  subheading?: string;
35
36
  title?: string;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cpn-components/CpnBanner/types.ts"],
4
- "sourcesContent": ["import type { CountDownProps } from '../CpnCountDown/types'\n\ntype TextType = 'title' | 'subtitle' | 'subheading'\n\ntype TextContent = {\n type: TextType\n text: string\n}\n\ninterface BaseType {\n text?: string\n target?: string\n end?: string\n copy?: CountDownProps['copy']\n}\n\ntype ButtonContent = {\n type: 'button'\n text: string\n target?: string\n cns?: string\n onClick?: () => void\n}\n\ntype ButtonsContent = {\n type: 'buttons'\n buttons: Omit<ButtonContent, 'type'>[]\n}\n\ntype CountDownContent = {\n type: 'countdown'\n} & CountDownProps\n\ntype BannerContent = TextContent | ButtonContent | ButtonsContent | CountDownContent\n\nexport type BannerProps = {\n id?: string\n image: string\n imageMob?: string\n imageLink?: string\n content?: BannerContent[]\n cns?: {\n container?: string\n picture?: string\n image?: string\n box?: string\n content?: string\n subheading?: string\n title?: string\n subtitle?: string\n buttonBox?: string\n button?: string\n countdown?: CountDownProps['cns']\n }\n}\n"],
4
+ "sourcesContent": ["import type { CountDownProps } from '../CpnCountDown/types'\n\ntype TextType = 'title' | 'subtitle' | 'subheading'\n\ntype TextContent = {\n type: TextType\n text: string\n}\n\ninterface BaseType {\n text?: string\n target?: string\n end?: string\n copy?: CountDownProps['copy']\n}\n\ntype ButtonContent = {\n type: 'button'\n text: string\n target?: string\n cns?: string\n onClick?: () => void\n}\n\ntype ButtonsContent = {\n type: 'buttons'\n buttons: Omit<ButtonContent, 'type'>[]\n}\n\ntype CountDownContent = {\n type: 'countdown'\n} & CountDownProps\n\ntype BannerContent = TextContent | ButtonContent | ButtonsContent | CountDownContent\n\nexport type BannerProps = {\n id?: string\n image: string\n imageMob?: string\n imageLink?: string\n content?: BannerContent[]\n cns?: {\n container?: string\n picture?: string\n image?: string\n box?: string\n contentBox?: string\n content?: string\n subheading?: string\n title?: string\n subtitle?: string\n buttonBox?: string\n button?: string\n countdown?: CountDownProps['cns']\n }\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var y=Object.create;var v=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)v(e,o,{get:t[o],enumerable:!0})},h=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of N(t))!R.call(e,n)&&n!==o&&v(e,n,{get:()=>t[n],enumerable:!(a=E(t,n))||a.enumerable});return e};var k=(e,t,o)=>(o=e!=null?y(I(e)):{},h(t||!e||!e.__esModule?v(o,"default",{value:e,enumerable:!0}):o,e)),H=e=>h(v({},"__esModule",{value:!0}),e);var $={};S($,{default:()=>T});module.exports=H($);var p=require("react/jsx-runtime"),l=require("react"),f=require("../../helpers/utils.js"),g=k(require("lodash.debounce"));const L=e=>{const{lists:t,styles:o,cns:a,offset:n=0}=e,[x,d]=(0,l.useState)(0),u=(0,l.useRef)(null),C=r=>{r.scrollIntoView({behavior:"smooth",inline:"center"})},w=(r,c,i)=>{d(c);const s=i.target;C(s),r.anchor&&document.querySelector(`#${r.anchor}`)?.scrollIntoView({behavior:"smooth"}),i.preventDefault()};return(0,l.useEffect)(()=>{const r=(0,g.default)(()=>{const i=[];t?.forEach(m=>{const b=document.querySelector(`#${m.anchor}`);b&&i.push(b.getBoundingClientRect().top)});const s=i.findIndex(m=>m>c+n)-1;d(s<0?0:s)},100),c=u.current?.getBoundingClientRect().height||0;return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r)}},[t,n]),(0,p.jsx)("div",{id:"nav",className:(0,f.cn)("cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]",a?.container),style:{"--bgColor":o?.bgColor||"#C6F1FF","--color":o?.color||"#333","--activeColor":o?.activeColor||"#000"},children:(0,p.jsx)("div",{className:(0,f.cn)("cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden","tablet:gap-[80px] tablet:justify-center",a?.box),ref:u,children:t?.map((r,c)=>(0,p.jsx)("a",{href:`#${r.anchor}`,className:(0,f.cn)("cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200",a?.item,{[`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[""] ${a?.activeItem}`]:x===c}),onClick:i=>w(r,c,i),children:r.label},r.label))})})};var T=L;
1
+ "use strict";var y=Object.create;var v=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)v(e,o,{get:t[o],enumerable:!0})},h=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of N(t))!R.call(e,n)&&n!==o&&v(e,n,{get:()=>t[n],enumerable:!(i=E(t,n))||i.enumerable});return e};var k=(e,t,o)=>(o=e!=null?y(I(e)):{},h(t||!e||!e.__esModule?v(o,"default",{value:e,enumerable:!0}):o,e)),H=e=>h(v({},"__esModule",{value:!0}),e);var $={};S($,{default:()=>T});module.exports=H($);var p=require("react/jsx-runtime"),c=require("react"),f=require("../../helpers/utils.js"),g=k(require("lodash.debounce"));const L=e=>{const{lists:t,styles:o,cns:i,offset:n=0}=e,[x,d]=(0,c.useState)(0),u=(0,c.useRef)(null),C=r=>{r.scrollIntoView({behavior:"smooth",inline:"center"})},w=(r,l,a)=>{d(l);const s=a.target;C(s),r.anchor&&document.querySelector(`#${r.anchor}`)?.scrollIntoView({behavior:"smooth"}),a.preventDefault()};return(0,c.useEffect)(()=>{const r=(0,g.default)(()=>{const a=[];t?.forEach(m=>{const b=document.querySelector(`#${m.anchor}`);b&&a.push(b.getBoundingClientRect().top)});const s=a.findIndex(m=>m>l+n);d(s===-1?a.length-1:s===0?0:s-1)},100),l=u.current?.getBoundingClientRect().height||0;return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r)}},[t,n]),(0,p.jsx)("div",{id:"nav",className:(0,f.cn)("cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]",i?.container),style:{"--bgColor":o?.bgColor||"#C6F1FF","--color":o?.color||"#333","--activeColor":o?.activeColor||"#000"},children:(0,p.jsx)("div",{className:(0,f.cn)("cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden","tablet:gap-[80px] tablet:justify-center",i?.box),ref:u,children:t?.map((r,l)=>(0,p.jsx)("a",{href:`#${r.anchor}`,className:(0,f.cn)("cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200",i?.item,{[`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[""] ${i?.activeItem}`]:x===l}),onClick:a=>w(r,l,a),children:r.label},r.label))})})};var T=L;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cpn-components/CpnNavigation/index.tsx"],
4
- "sourcesContent": ["import React, { useEffect, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport type { Nav, NavigationProps } from './types.js'\nimport debounce from 'lodash.debounce'\n\nconst CpnNavigation = (props: NavigationProps) => {\n const { lists, styles, cns, offset = 0 } = props\n const [activeIndex, setActiveIndex] = useState(0)\n const navBox = useRef<HTMLDivElement>(null)\n\n const scrollIntoView = (ele: HTMLElement) => {\n ele.scrollIntoView({ behavior: 'smooth', inline: 'center' })\n }\n\n const handleNavItemClick = (nav: Nav, index: number, e: React.SyntheticEvent<EventTarget>) => {\n setActiveIndex(index)\n const ele = e.target as HTMLAnchorElement\n scrollIntoView(ele)\n if (nav.anchor) {\n document.querySelector(`#${nav.anchor}`)?.scrollIntoView({ behavior: 'smooth' })\n }\n e.preventDefault()\n }\n\n useEffect(() => {\n const scrollHandler = debounce(() => {\n const sectionTops: number[] = []\n lists?.forEach(nav => {\n const section = document.querySelector(`#${nav.anchor}`)\n if (section) {\n sectionTops.push(section.getBoundingClientRect().top)\n }\n })\n const index = sectionTops.findIndex(sectionTop => sectionTop > navHeight + offset) - 1\n setActiveIndex(index < 0 ? 0 : index)\n }, 100)\n const navHeight = navBox.current?.getBoundingClientRect().height || 0\n window.addEventListener('scroll', scrollHandler)\n return () => {\n window.removeEventListener('scroll', scrollHandler)\n }\n }, [lists, offset])\n\n return (\n <div\n id=\"nav\"\n className={cn('cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]', cns?.container)}\n style={\n {\n '--bgColor': styles?.bgColor || '#C6F1FF',\n '--color': styles?.color || '#333',\n '--activeColor': styles?.activeColor || '#000',\n } as React.CSSProperties\n }\n >\n <div\n className={cn(\n 'cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden',\n 'tablet:gap-[80px] tablet:justify-center',\n cns?.box\n )}\n ref={navBox}\n >\n {lists?.map((nav, index) => {\n return (\n <a\n key={nav.label}\n href={`#${nav.anchor}`}\n className={cn(\n 'cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200',\n cns?.item,\n {\n [`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[\"\"] ${cns?.activeItem}`]:\n activeIndex === index,\n }\n )}\n onClick={e => handleNavItemClick(nav, index, e)}\n >\n {nav.label}\n </a>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default CpnNavigation\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiEY,IAAAI,EAAA,6BAjEZC,EAAmD,iBACnDC,EAAmB,kCAEnBC,EAAqB,8BAErB,MAAMC,EAAiBC,GAA2B,CAChD,KAAM,CAAE,MAAAC,EAAO,OAAAC,EAAQ,IAAAC,EAAK,OAAAC,EAAS,CAAE,EAAIJ,EACrC,CAACK,EAAaC,CAAc,KAAI,YAAS,CAAC,EAC1CC,KAAS,UA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AE,EACxOE,IAAgBO,CACpB,CACF,EACA,QAASC,GAAKH,EAAmBC,EAAKC,EAAOC,CAAC,EAE7C,SAAAF,EAAI,OAZAA,EAAI,KAaX,CAEH,EACH,EACF,CAEJ,EAEA,IAAOlB,EAAQM",
4
+ "sourcesContent": ["import React, { useEffect, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport type { Nav, NavigationProps } from './types.js'\nimport debounce from 'lodash.debounce'\n\nconst CpnNavigation = (props: NavigationProps) => {\n const { lists, styles, cns, offset = 0 } = props\n const [activeIndex, setActiveIndex] = useState(0)\n const navBox = useRef<HTMLDivElement>(null)\n\n const scrollIntoView = (ele: HTMLElement) => {\n ele.scrollIntoView({ behavior: 'smooth', inline: 'center' })\n }\n\n const handleNavItemClick = (nav: Nav, index: number, e: React.SyntheticEvent<EventTarget>) => {\n setActiveIndex(index)\n const ele = e.target as HTMLAnchorElement\n scrollIntoView(ele)\n if (nav.anchor) {\n document.querySelector(`#${nav.anchor}`)?.scrollIntoView({ behavior: 'smooth' })\n }\n e.preventDefault()\n }\n\n useEffect(() => {\n const scrollHandler = debounce(() => {\n const sectionTops: number[] = []\n lists?.forEach(nav => {\n const section = document.querySelector(`#${nav.anchor}`)\n if (section) {\n sectionTops.push(section.getBoundingClientRect().top)\n }\n })\n const index = sectionTops.findIndex(sectionTop => sectionTop > navHeight + offset)\n setActiveIndex(index === -1 ? sectionTops.length - 1 : index === 0 ? 0 : index - 1)\n }, 100)\n const navHeight = navBox.current?.getBoundingClientRect().height || 0\n window.addEventListener('scroll', scrollHandler)\n return () => {\n window.removeEventListener('scroll', scrollHandler)\n }\n }, [lists, offset])\n\n return (\n <div\n id=\"nav\"\n className={cn('cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]', cns?.container)}\n style={\n {\n '--bgColor': styles?.bgColor || '#C6F1FF',\n '--color': styles?.color || '#333',\n '--activeColor': styles?.activeColor || '#000',\n } as React.CSSProperties\n }\n >\n <div\n className={cn(\n 'cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden',\n 'tablet:gap-[80px] tablet:justify-center',\n cns?.box\n )}\n ref={navBox}\n >\n {lists?.map((nav, index) => {\n return (\n <a\n key={nav.label}\n href={`#${nav.anchor}`}\n className={cn(\n 'cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200',\n cns?.item,\n {\n [`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[\"\"] ${cns?.activeItem}`]:\n activeIndex === index,\n }\n )}\n onClick={e => handleNavItemClick(nav, index, e)}\n >\n {nav.label}\n </a>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default CpnNavigation\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiEY,IAAAI,EAAA,6BAjEZC,EAAmD,iBACnDC,EAAmB,kCAEnBC,EAAqB,8BAErB,MAAMC,EAAiBC,GAA2B,CAChD,KAAM,CAAE,MAAAC,EAAO,OAAAC,EAAQ,IAAAC,EAAK,OAAAC,EAAS,CAAE,EAAIJ,EACrC,CAACK,EAAaC,CAAc,KAAI,YAAS,CAAC,EAC1CC,KAAS,UAAuB,IAAI,EAEpCC,EAAkBC,GAAqB,CAC3CA,EAAI,eAAe,CAAE,SAAU,SAAU,OAAQ,QAAS,CAAC,CAC7D,EAEMC,EAAqB,CAACC,EAAUC,EAAeC,IAAyC,CAC5FP,EAAeM,CAAK,EACpB,MAAMH,EAAMI,EAAE,OACdL,EAAeC,CAAG,EACdE,EAAI,QACN,SAAS,cAAc,IAAIA,EAAI,MAAM,EAAE,GAAG,eAAe,CAAE,SAAU,QAAS,CAAC,EAEjFE,EAAE,eAAe,CACnB,EAEA,sBAAU,IAAM,CACd,MAAMC,KAAgB,EAAAC,SAAS,IAAM,CACnC,MAAMC,EAAwB,CAAC,EAC/Bf,GAAO,QAAQU,GAAO,CACpB,MAAMM,EAAU,SAAS,cAAc,IAAIN,EAAI,MAAM,EAAE,EACnDM,GACFD,EAAY,KAAKC,EAAQ,sBAAsB,EAAE,GAAG,CAExD,CAAC,EACD,MAAML,EAAQI,EAAY,UAAUE,GAAcA,EAAaC,EAAYf,CAAM,EACjFE,EAAeM,IAAU,GAAKI,EAAY,OAAS,EAAIJ,IAAU,EAAI,EAAIA,EAAQ,CAAC,CACpF,EAAG,GAAG,EACAO,EAAYZ,EAAO,SAAS,sBAAsB,EAAE,QAAU,EACpE,cAAO,iBAAiB,SAAUO,CAAa,EACxC,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAa,CACpD,CACF,EAAG,CAACb,EAAOG,CAAM,CAAC,KAGhB,OAAC,OACC,GAAG,MACH,aAAW,MAAG,iEAAkED,GAAK,SAAS,EAC9F,MACE,CACE,YAAaD,GAAQ,SAAW,UAChC,UAAWA,GAAQ,OAAS,OAC5B,gBAAiBA,GAAQ,aAAe,MAC1C,EAGF,mBAAC,OACC,aAAW,MACT,iIACA,0CACAC,GAAK,GACP,EACA,IAAKI,EAEJ,SAAAN,GAAO,IAAI,CAACU,EAAKC,OAEd,OAAC,KAEC,KAAM,IAAID,EAAI,MAAM,GACpB,aAAW,MACT,yJACAR,GAAK,KACL,CACE,CAAC,wNAAwNA,GAAK,UAAU,EAAE,EACxOE,IAAgBO,CACpB,CACF,EACA,QAASC,GAAKH,EAAmBC,EAAKC,EAAOC,CAAC,EAE7C,SAAAF,EAAI,OAZAA,EAAI,KAaX,CAEH,EACH,EACF,CAEJ,EAEA,IAAOlB,EAAQM",
6
6
  "names": ["CpnNavigation_exports", "__export", "CpnNavigation_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_lodash", "CpnNavigation", "props", "lists", "styles", "cns", "offset", "activeIndex", "setActiveIndex", "navBox", "scrollIntoView", "ele", "handleNavItemClick", "nav", "index", "e", "scrollHandler", "debounce", "sectionTops", "section", "sectionTop", "navHeight"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as B,jsx as r,jsxs as l}from"react/jsx-runtime";import w from"../Title/index.js";import{cn as n}from"../../helpers/utils.js";import f from"../../components/picture.js";import p from"../../components/button.js";import N from"../SwiperBox/index.js";import{useState as F,useEffect as k,useRef as b}from"react";const T=({data:o,className:i=""})=>{const[d,v]=F(0),[x,h]=F({0:!0}),a=b([]),c=b({0:!0}),y=(t,e)=>{e&&(a.current[t]=e)},m=t=>{c.current?.[t]&&h({[t]:!0})};k(()=>{const t=a.current;return t?.forEach((e,s)=>{s?e.style="flex: 1 1 0%; transition: all 0.15s":e.style="flex: 5 1 0%; transition: all 0.15s",e.addEventListener("transitionend",()=>m(s))}),()=>{t?.forEach((e,s)=>{e.removeEventListener("transitionend",()=>m(s))})}},[]);const g=({data:t,configuration:e})=>l("div",{className:"relative shrink-0 grow-0 basis-[296px] border border-solid border-[#dddddd] bg-[#FFFFFF]",children:[r(f,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:t?.img?.url}),l("div",{className:n("absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6"),children:[l("div",{className:"mb-6 flex-1 overflow-hidden",children:[r("p",{className:"mb-1 text-2xl font-bold text-[#FFFFFF]",children:t?.title}),r("h3",{className:"text-sm font-medium text-[#FFFFFF]",children:t?.subTitle})]}),r(p,{size:"sm",hoverEffect:"slide",variant:"secondary",className:n("mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",e?.shape==="round"?"rounded-2xl":""),children:r("a",{href:t.link,children:e?.primaryButton})})]})]});return l(B,{children:[o?.title&&r(w,{data:{title:o?.title}}),r("div",{className:"tablet:block hidden",children:r("div",{className:n("laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden",i),children:o?.products?.map((t,e)=>{const s=d===e;return l("div",{style:{flex:s?5:1},ref:u=>{u&&y(e,u)},className:n("relative cursor-pointer overflow-hidden",o?.itemShape==="round"?"rounded-2xl":""),onClick:()=>{d!==e&&(c.current={[e]:!0},v(e))},children:[r(f,{source:t?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover"}),x?.[e]&&s?l("div",{className:n("absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6"),children:[l("div",{className:"mr-1 flex-1 overflow-hidden",children:[r("p",{className:"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]",children:t?.title}),r("h3",{className:"desktop:text-lg text-sm font-medium text-[#FFFFFF]",children:t?.subTitle})]}),r(p,{size:"sm",hoverEffect:"slide",variant:"secondary",className:n("desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",o?.shape==="round"?"rounded-2xl":""),children:r("a",{href:t?.link,children:o?.primaryButton})})]}):null]},e)})})}),r("div",{className:"tablet:hidden block",children:r(N,{className:n("h-[400px] !overflow-visible",i),id:"AccordionCards"+o?.key,data:{list:o?.products,configuration:{shape:o?.shape,primaryButton:o?.primaryButton}},Slide:g,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})})]})};var V=T;export{V as default};
1
+ "use client";import{Fragment as B,jsx as r,jsxs as l}from"react/jsx-runtime";import w from"../Title/index.js";import{cn as n}from"../../helpers/utils.js";import f from"../../components/picture.js";import p from"../../components/button.js";import N from"../SwiperBox/index.js";import{useState as F,useEffect as k,useRef as b}from"react";const T=({data:o,className:i=""})=>{const[d,v]=F(0),[x,h]=F({0:!0}),a=b([]),c=b({0:!0}),y=(t,e)=>{e&&(a.current[t]=e)},m=t=>{c.current?.[t]&&h({[t]:!0})};k(()=>{const t=a.current;return t?.forEach((e,s)=>{s?e.style="flex: 1 1 0%; transition: all 0.15s":e.style="flex: 5 1 0%; transition: all 0.15s",e.addEventListener("transitionend",()=>m(s))}),()=>{t?.forEach((e,s)=>{e.removeEventListener("transitionend",()=>m(s))})}},[]);const g=({data:t,configuration:e})=>l("div",{className:"relative w-full shrink-0 grow-0 border border-solid border-[#dddddd] bg-[#FFFFFF]",children:[r(f,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:t?.img?.url}),l("div",{className:n("absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6"),children:[l("div",{className:"mb-6 flex-1 overflow-hidden",children:[r("p",{className:"mb-1 text-2xl font-bold text-[#FFFFFF]",children:t?.title}),r("h3",{className:"text-sm font-medium text-[#FFFFFF]",children:t?.subTitle})]}),r(p,{size:"sm",hoverEffect:"slide",variant:"secondary",className:n("mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",e?.shape==="round"?"rounded-2xl":""),children:r("a",{href:t.link,children:e?.primaryButton})})]})]});return l(B,{children:[o?.title&&r(w,{data:{title:o?.title}}),r("div",{className:"tablet:block hidden",children:r("div",{className:n("laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden",i),children:o?.products?.map((t,e)=>{const s=d===e;return l("div",{style:{flex:s?5:1},ref:u=>{u&&y(e,u)},className:n("relative cursor-pointer overflow-hidden",o?.itemShape==="round"?"rounded-2xl":""),onClick:()=>{d!==e&&(c.current={[e]:!0},v(e))},children:[r(f,{source:t?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover"}),x?.[e]&&s?l("div",{className:n("absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6"),children:[l("div",{className:"mr-1 flex-1 overflow-hidden",children:[r("p",{className:"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]",children:t?.title}),r("h3",{className:"desktop:text-lg text-sm font-medium text-[#FFFFFF]",children:t?.subTitle})]}),r(p,{size:"sm",hoverEffect:"slide",variant:"secondary",className:n("desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]",o?.shape==="round"?"rounded-2xl":""),children:r("a",{href:t?.link,children:o?.primaryButton})})]}):null]},e)})})}),r("div",{className:"tablet:hidden block",children:r(N,{className:n("h-[400px] !overflow-visible",i),id:"AccordionCards"+o?.key,data:{list:o?.products,configuration:{shape:o?.shape,primaryButton:o?.primaryButton}},Slide:g,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})})]})};var V=T;export{V as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AccordionCards/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { useState, useEffect, useRef } from 'react'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: {\n url: string\n }\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n}\n\ntype AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n }\n}\n\nconst AccordionCards = ({ data, className = '' }: AccordionCardsType) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n const [currentWidth, setCurrentWidth] = useState<{ [key: number]: boolean }>({ 0: true })\n\n const accordionRef = useRef<HTMLDivElement[]>([])\n const enterRef = useRef<{ [key: number]: boolean }>({ 0: true })\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n const handleTransitionEnd = (index: number) => {\n if (enterRef.current?.[index]) {\n setCurrentWidth({ [index]: true })\n }\n }\n\n useEffect(() => {\n const element = accordionRef.current\n element?.forEach((item, index) => {\n if (!index) {\n item.style = 'flex: 5 1 0%; transition: all 0.15s'\n } else {\n item.style = 'flex: 1 1 0%; transition: all 0.15s'\n }\n item.addEventListener('transitionend', () => handleTransitionEnd(index))\n })\n return () => {\n element?.forEach((item, index) => {\n item.removeEventListener('transitionend', () => handleTransitionEnd(index))\n })\n }\n }, [])\n\n const MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n return (\n <div className=\"relative shrink-0 grow-0 basis-[296px] border border-solid border-[#dddddd] bg-[#FFFFFF]\">\n <Picture className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\" source={data?.img?.url} />\n <div className={cn('absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6')}>\n <div className=\"mb-6 flex-1 overflow-hidden\">\n <p className=\"mb-1 text-2xl font-bold text-[#FFFFFF]\">{data?.title}</p>\n <h3 className=\"text-sm font-medium text-[#FFFFFF]\">{data?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={data.link}>{configuration?.primaryButton}</a>\n </Button>\n </div>\n </div>\n )\n }\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div className=\"tablet:block hidden\">\n <div\n className={cn('laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden', className)}\n >\n {data?.products?.map((item, idx) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 5 : 1\n return (\n <div\n key={idx}\n style={{\n flex: flexValue,\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn(\n 'relative cursor-pointer overflow-hidden',\n data?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n onClick={() => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0 ref \u72B6\u6001\n enterRef.current = { [idx]: true }\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n }}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n {currentWidth?.[idx] && isExpanded ? (\n <div\n className={cn(\n 'absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6'\n )}\n >\n <div className=\"mr-1 flex-1 overflow-hidden\">\n <p className=\"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]\">\n {item?.title}\n </p>\n <h3 className=\"desktop:text-lg text-sm font-medium text-[#FFFFFF]\">{item?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n data?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={item?.link}>{data?.primaryButton}</a>\n </Button>\n </div>\n ) : null}\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n primaryButton: data?.primaryButton,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </>\n )\n}\n\nexport default AccordionCards\n"],
5
- "mappings": "aA2EQ,OAuBJ,YAAAA,EAvBI,OAAAC,EAEE,QAAAC,MAFF,oBA1ER,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAY,6BACnB,OAAOC,MAAe,wBACtB,OAAS,YAAAC,EAAU,aAAAC,EAAW,UAAAC,MAAc,QA8B5C,MAAMC,EAAiB,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,EAAG,IAA0B,CACvE,KAAM,CAACC,EAAYC,CAAa,EAAIP,EAAwB,CAAC,EACvD,CAACQ,EAAcC,CAAe,EAAIT,EAAqC,CAAE,EAAG,EAAK,CAAC,EAElFU,EAAeR,EAAyB,CAAC,CAAC,EAC1CS,EAAWT,EAAmC,CAAE,EAAG,EAAK,CAAC,EAEzDU,EAAS,CAACC,EAAeC,IAAuB,CAChDA,IACFJ,EAAa,QAAQG,CAAK,EAAIC,EAElC,EAEMC,EAAuBF,GAAkB,CACzCF,EAAS,UAAUE,CAAK,GAC1BJ,EAAgB,CAAE,CAACI,CAAK,EAAG,EAAK,CAAC,CAErC,EAEAZ,EAAU,IAAM,CACd,MAAMe,EAAUN,EAAa,QAC7B,OAAAM,GAAS,QAAQ,CAACC,EAAMJ,IAAU,CAC3BA,EAGHI,EAAK,MAAQ,sCAFbA,EAAK,MAAQ,sCAIfA,EAAK,iBAAiB,gBAAiB,IAAMF,EAAoBF,CAAK,CAAC,CACzE,CAAC,EACM,IAAM,CACXG,GAAS,QAAQ,CAACC,EAAMJ,IAAU,CAChCI,EAAK,oBAAoB,gBAAiB,IAAMF,EAAoBF,CAAK,CAAC,CAC5E,CAAC,CACH,CACF,EAAG,CAAC,CAAC,EAEL,MAAMK,E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AI,UAAU,8BACb,UAAAD,EAAC,KAAE,UAAU,4EACV,SAAAwB,GAAM,MACT,EACAxB,EAAC,MAAG,UAAU,qDAAsD,SAAAwB,GAAM,SAAS,GACrF,EACAxB,EAACK,EAAA,CACC,KAAK,KACL,YAAY,QACZ,QAAQ,YACR,UAAWF,EACT,4GACAQ,GAAM,QAAU,QAAU,cAAgB,EAC5C,EAEA,SAAAX,EAAC,KAAE,KAAMwB,GAAM,KAAO,SAAAb,GAAM,cAAc,EAC5C,GACF,EACE,OA/CCgB,CAgDP,CAEJ,CAAC,EACH,EACF,EACA3B,EAAC,OAAI,UAAU,sBACb,SAAAA,EAACM,EAAA,CACC,UAAWH,EAAG,8BAA+BS,CAAS,EACtD,GAAI,iBAAmBD,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,cAAeA,GAAM,aACvB,CACF,EACA,MAAOc,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,EAEA,IAAOI,EAAQnB",
4
+ "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { useState, useEffect, useRef } from 'react'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: {\n url: string\n }\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n}\n\ntype AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n }\n}\n\nconst AccordionCards = ({ data, className = '' }: AccordionCardsType) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n const [currentWidth, setCurrentWidth] = useState<{ [key: number]: boolean }>({ 0: true })\n\n const accordionRef = useRef<HTMLDivElement[]>([])\n const enterRef = useRef<{ [key: number]: boolean }>({ 0: true })\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n const handleTransitionEnd = (index: number) => {\n if (enterRef.current?.[index]) {\n setCurrentWidth({ [index]: true })\n }\n }\n\n useEffect(() => {\n const element = accordionRef.current\n element?.forEach((item, index) => {\n if (!index) {\n item.style = 'flex: 5 1 0%; transition: all 0.15s'\n } else {\n item.style = 'flex: 1 1 0%; transition: all 0.15s'\n }\n item.addEventListener('transitionend', () => handleTransitionEnd(index))\n })\n return () => {\n element?.forEach((item, index) => {\n item.removeEventListener('transitionend', () => handleTransitionEnd(index))\n })\n }\n }, [])\n\n const MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n return (\n <div className=\"relative w-full shrink-0 grow-0 border border-solid border-[#dddddd] bg-[#FFFFFF]\">\n <Picture className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\" source={data?.img?.url} />\n <div className={cn('absolute inset-x-0 bottom-0 flex flex-col overflow-hidden px-6 pb-6')}>\n <div className=\"mb-6 flex-1 overflow-hidden\">\n <p className=\"mb-1 text-2xl font-bold text-[#FFFFFF]\">{data?.title}</p>\n <h3 className=\"text-sm font-medium text-[#FFFFFF]\">{data?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'mb-1.5 w-[116px] overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={data.link}>{configuration?.primaryButton}</a>\n </Button>\n </div>\n </div>\n )\n }\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div className=\"tablet:block hidden\">\n <div\n className={cn('laptop:h-[448px] desktop:h-[560px] flex h-[336px] w-full gap-4 overflow-hidden', className)}\n >\n {data?.products?.map((item, idx) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 5 : 1\n return (\n <div\n key={idx}\n style={{\n flex: flexValue,\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn(\n 'relative cursor-pointer overflow-hidden',\n data?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n onClick={() => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0 ref \u72B6\u6001\n enterRef.current = { [idx]: true }\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n }}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n />\n {currentWidth?.[idx] && isExpanded ? (\n <div\n className={cn(\n 'absolute inset-x-0 bottom-0 flex items-end justify-between overflow-hidden px-6 pb-6'\n )}\n >\n <div className=\"mr-1 flex-1 overflow-hidden\">\n <p className=\"laptop:text-2xl desktop:text-[32px] mb-1 text-xl font-bold text-[#FFFFFF]\">\n {item?.title}\n </p>\n <h3 className=\"desktop:text-lg text-sm font-medium text-[#FFFFFF]\">{item?.subTitle}</h3>\n </div>\n <Button\n size=\"sm\"\n hoverEffect=\"slide\"\n variant=\"secondary\"\n className={cn(\n 'desktop:text-base mb-1.5 overflow-hidden border-[#FFFFFF] bg-transparent text-sm font-bold text-[#FFFFFF]',\n data?.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a href={item?.link}>{data?.primaryButton}</a>\n </Button>\n </div>\n ) : null}\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n primaryButton: data?.primaryButton,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </>\n )\n}\n\nexport default AccordionCards\n"],
5
+ "mappings": "aA2EQ,OAuBJ,YAAAA,EAvBI,OAAAC,EAEE,QAAAC,MAFF,oBA1ER,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAY,6BACnB,OAAOC,MAAe,wBACtB,OAAS,YAAAC,EAAU,aAAAC,EAAW,UAAAC,MAAc,QA8B5C,MAAMC,EAAiB,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,EAAG,IAA0B,CACvE,KAAM,CAACC,EAAYC,CAAa,EAAIP,EAAwB,CAAC,EACvD,CAACQ,EAAcC,CAAe,EAAIT,EAAqC,CAAE,EAAG,EAAK,CAAC,EAElFU,EAAeR,EAAyB,CAAC,CAAC,EAC1CS,EAAWT,EAAmC,CAAE,EAAG,EAAK,CAAC,EAEzDU,EAAS,CAACC,EAAeC,IAAuB,CAChDA,IACFJ,EAAa,QAAQG,CAAK,EAAIC,EAElC,EAEMC,EAAuBF,GAAkB,CACzCF,EAAS,UAAUE,CAAK,GAC1BJ,EAAgB,CAAE,CAACI,CAAK,EAAG,EAAK,CAAC,CAErC,EAEAZ,EAAU,IAAM,CACd,MAAMe,EAAUN,EAAa,QAC7B,OAAAM,GAAS,QAAQ,CAACC,EAAMJ,IAAU,CAC3BA,EAGHI,EAAK,MAAQ,sCAFbA,EAAK,MAAQ,sCAIfA,EAAK,iBAAiB,gBAAiB,IA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CAAG,EAAG,EAAK,EAEjCb,EAAca,CAAG,EACnB,EAEA,UAAA3B,EAACI,EAAA,CACC,OAAQoB,GAAM,KAAK,IACnB,UAAU,6DACZ,EACCT,IAAeY,CAAG,GAAKC,EACtB3B,EAAC,OACC,UAAWE,EACT,sFACF,EAEA,UAAAF,EAAC,OAAI,UAAU,8BACb,UAAAD,EAAC,KAAE,UAAU,4EACV,SAAAwB,GAAM,MACT,EACAxB,EAAC,MAAG,UAAU,qDAAsD,SAAAwB,GAAM,SAAS,GACrF,EACAxB,EAACK,EAAA,CACC,KAAK,KACL,YAAY,QACZ,QAAQ,YACR,UAAWF,EACT,4GACAQ,GAAM,QAAU,QAAU,cAAgB,EAC5C,EAEA,SAAAX,EAAC,KAAE,KAAMwB,GAAM,KAAO,SAAAb,GAAM,cAAc,EAC5C,GACF,EACE,OA/CCgB,CAgDP,CAEJ,CAAC,EACH,EACF,EACA3B,EAAC,OAAI,UAAU,sBACb,SAAAA,EAACM,EAAA,CACC,UAAWH,EAAG,8BAA+BS,CAAS,EACtD,GAAI,iBAAmBD,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,cAAeA,GAAM,aACvB,CACF,EACA,MAAOc,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,EAEA,IAAOI,EAAQnB",
6
6
  "names": ["Fragment", "jsx", "jsxs", "Title", "cn", "Picture", "Button", "SwiperBox", "useState", "useEffect", "useRef", "AccordionCards", "data", "className", "hoverIndex", "setHoverIndex", "currentWidth", "setCurrentWidth", "accordionRef", "enterRef", "getRef", "index", "el", "handleTransitionEnd", "element", "item", "MobileItem", "configuration", "idx", "isExpanded", "AccordionCards_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import"react";import{cn as o}from"../../helpers/utils.js";import l from"../../components/picture.js";import{withStyles as p}from"../../shared/Styles.js";import n from"../Title/index.js";import c from"../SwiperBox/index.js";const d=({data:e,configuration:r})=>a("div",{className:o("box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]","laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]",r?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[t(l,{className:"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover",source:e?.image}),t("p",{className:"tablet:text-lg flex-1 text-center text-sm font-semibold",children:e?.name})]}),m=({data:e,buildData:r,className:s="",key:i})=>a("div",{className:o("w-full",s),children:[e?.title&&t(n,{data:{title:e?.title}}),t(c,{className:"!overflow-visible",id:"Category"+i,data:{list:e?.products,configuration:{shape:e?.shape}},Slide:d,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:2.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:6}}})]});var h=p(m);export{h as default};
1
+ "use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import"react";import{cn as o}from"../../helpers/utils.js";import l from"../../components/picture.js";import{withStyles as p}from"../../shared/Styles.js";import n from"../Title/index.js";import c from"../SwiperBox/index.js";const d=({data:e,configuration:r})=>a("div",{className:o("box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]","laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]",r?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[t(l,{className:"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover",source:e?.image}),t("p",{className:"tablet:text-lg flex-1 text-center text-sm font-semibold",children:e?.name})]}),m=({data:e,buildData:r,className:s="",key:i})=>a("div",{className:o("w-full",s),children:[e?.title&&t(n,{data:{title:e?.title}}),t(c,{className:"!overflow-visible",id:"Category"+i,data:{list:e?.products,configuration:{shape:e?.shape}},Slide:d,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:3.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:6}}})]});var h=p(m);export{h as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: string\n name: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n data: {\n products: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n key?: string\n}\n\nconst CategoryItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]',\n 'laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture className=\"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover\" source={data?.image} />\n <p className=\"tablet:text-lg flex-1 text-center text-sm font-semibold\">{data?.name}</p>\n </div>\n )\n}\n\nconst Category: React.FC<CategoryProps> = ({ data, buildData, className = '', key }) => {\n return (\n <div className={cn('w-full', className)}>\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Category' + key}\n data={{ list: data?.products, configuration: { shape: data?.shape } }}\n Slide={CategoryItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 2.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 6,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(Category)\n"],
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: string\n name: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n data: {\n products: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n key?: string\n}\n\nconst CategoryItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]',\n 'laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture className=\"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover\" source={data?.image} />\n <p className=\"tablet:text-lg flex-1 text-center text-sm font-semibold\">{data?.name}</p>\n </div>\n )\n}\n\nconst Category: React.FC<CategoryProps> = ({ data, buildData, className = '', key }) => {\n return (\n <div className={cn('w-full', className)}>\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Category' + key}\n data={{ list: data?.products, configuration: { shape: data?.shape } }}\n Slide={CategoryItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 3.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 6,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(Category)\n"],
5
5
  "mappings": "aAiCI,OAOE,OAAAA,EAPF,QAAAC,MAAA,oBAhCJ,MAAkB,QAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAW,oBAClB,OAAOC,MAAe,wBAyBtB,MAAMC,EAAe,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAExCR,EAAC,OACC,UAAWC,EACT,+DACA,+DACAO,GAAe,QAAU,QAAU,iBAAmB,cACxD,EAEA,UAAAT,EAACG,EAAA,CAAQ,UAAU,uEAAuE,OAAQK,GAAM,MAAO,EAC/GR,EAAC,KAAE,UAAU,0DAA2D,SAAAQ,GAAM,KAAK,GACrF,EAIEE,EAAoC,CAAC,CAAE,KAAAF,EAAM,UAAAG,EAAW,UAAAC,EAAY,GAAI,IAAAC,CAAI,IAE9EZ,EAAC,OAAI,UAAWC,EAAG,SAAUU,CAAS,EACnC,UAAAJ,GAAM,OAASR,EAACK,EAAA,CAAM,KAAM,CAAE,MAAOG,GAAM,KAAM,EAAG,EACrDR,EAACM,EAAA,CACC,UAAU,oBACV,GAAI,WAAaO,EACjB,KAAM,CAAE,KAAML,GAAM,SAAU,cAAe,CAAE,MAAOA,GAAM,KAAM,CAAE,EACpE,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EAIJ,IAAOO,EAAQV,EAAWM,CAAQ",
6
6
  "names": ["jsx", "jsxs", "cn", "Picture", "withStyles", "Title", "SwiperBox", "CategoryItem", "data", "configuration", "Category", "buildData", "className", "key", "Category_default"]
7
7
  }
@@ -1,10 +1,10 @@
1
- "use client";import{jsx as t,jsxs as d}from"react/jsx-runtime";import{useState as D,useEffect as N}from"react";import{cn as y}from"../../helpers/utils.js";import C from"../../components/picture.js";import{Tabs as I,TabsList as P,TabsTrigger as F}from"../../components/tabs.js";import k from"../../components/button.js";import E from"../Title/index.js";import A from"../SwiperBox/index.js";import{withStyles as V}from"../../shared/Styles.js";import{formatVariantPrice as q}from"./shelfDisplay.js";const M=({data:e,configuration:r})=>{const m=a=>r?.event?.primaryButton?.(a),c=a=>r?.event?.secondaryButton?.(a),{price:u,basePrice:b}=q({locale:"us",amount:e?.price.amount||0,baseAmount:e?.compareAtPrice?.amount||e?.price.amount||0,currencyCode:e?.price.currencyCode||"USD"}),p=()=>{const a=e?.sku,o=e?.variants;return o?.find(x=>x?.sku===a)?.image?.url||o?.[0]?.image?.url||""};return d("div",{className:y("laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4",r?.itemShape==="round"?"rounded-2xl":"rounded-none"),children:[t("div",{className:y("relative mb-2 inline-block h-[137px] overflow-hidden","tablet:mb-3 tablet:h-[195px]"),children:t(C,{source:p(),className:"flex h-full justify-center object-cover [&_img]:w-auto"})}),t("div",{className:"tablet:mb-2 mb-1 flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.slice(0,1)?.map?.((a,o)=>t("div",{className:"tablet:text-base rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]",children:a},o))}),t("p",{title:e?.title||"",className:"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]",children:e?.title||""}),t("h3",{title:e?.description||"",className:"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]",children:e?.description||""}),d("div",{className:"mb-2 flex items-center",children:[t("div",{className:"tablet:text-2xl text-xl font-bold text-[#1D1D1F]",children:u||""}),t("div",{className:"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]",children:b||""})]}),d("div",{className:"flex items-center gap-3",children:[t(k,{variant:"primary",onClick:()=>m(e),className:`
1
+ "use client";import{jsx as t,jsxs as d}from"react/jsx-runtime";import{useState as D,useEffect as N}from"react";import{cn as y}from"../../helpers/utils.js";import C from"../../components/picture.js";import{Tabs as I,TabsList as P,TabsTrigger as F}from"../../components/tabs.js";import k from"../../components/button.js";import E from"../Title/index.js";import A from"../SwiperBox/index.js";import{withStyles as V}from"../../shared/Styles.js";import{formatVariantPrice as q}from"./shelfDisplay.js";const M=({data:e,configuration:r})=>{const c=a=>r?.event?.primaryButton?.(a),m=a=>r?.event?.secondaryButton?.(a),{price:u,basePrice:b}=q({locale:"us",amount:e?.price.amount||0,baseAmount:e?.compareAtPrice?.amount||e?.price.amount||0,currencyCode:e?.price.currencyCode||"USD"}),p=()=>{const a=e?.sku,o=e?.variants;return o?.find(x=>x?.sku===a)?.image?.url||o?.[0]?.image?.url||""};return d("div",{className:y("laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4",r?.itemShape==="round"?"rounded-2xl":"rounded-none"),children:[t("div",{className:y("relative mb-2 inline-block h-[137px] overflow-hidden","tablet:mb-3 tablet:h-[195px]"),children:t(C,{source:p(),className:"flex h-full justify-center object-cover [&_img]:w-auto"})}),t("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.slice(0,1)?.map?.((a,o)=>t("div",{className:"tablet:text-base box-border h-full rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]",children:a},o))}),t("p",{title:e?.title||"",className:"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]",children:e?.title||""}),t("h3",{title:e?.description||"",className:"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]",children:e?.description||""}),d("div",{className:"mb-2 flex items-center",children:[t("div",{className:"tablet:text-2xl text-xl font-bold text-[#1D1D1F]",children:u||""}),t("div",{className:"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]",children:b||""})]}),d("div",{className:"flex items-center gap-3",children:[t(k,{variant:"primary",onClick:()=>c(e),className:`
2
2
  laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border
3
3
  border-[#1D1D1F] bg-transparent px-4 py-2 text-xs text-[#1D1D1F] hover:bg-transparent hover:text-black
4
4
  ${r?.shape==="round"?"desktop:rounded-3xl rounded-[20px]":""}
5
- `,children:r?.primaryButton||""}),t(k,{variant:"secondary",onClick:()=>c(e),className:`
5
+ `,children:r?.primaryButton||""}),t(k,{variant:"secondary",onClick:()=>m(e),className:`
6
6
  laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border
7
7
  border-[#1D1D1F] bg-[#1D1D1F] px-4 py-2 text-xs tracking-[-0.04em] text-white
8
8
  ${r?.shape==="round"?"desktop:rounded-3xl rounded-[20px]":""}
9
- `,children:r?.secondaryButton||""})]})]},e?.id||e?.handle)},L=({data:e,buildData:r,className:m="",key:c,event:u})=>{const[b,p]=D(""),[a,o]=D([]),{productsTab:l=[],productsCard:x=[],title:h,align:S="left",isShowTab:v=!0,tabShape:w="square",...T}=e,f=s=>{const i=s?.map(n=>{const g=r?.products?.find(B=>B?.handle===n?.handle);if(g)return{sku:n.sku,...g}})?.filter(n=>n);o(i)};return N(()=>{if(v){p(l?.[0]?.tab||""),f(l?.[0]?.data||[]);return}f(x)},[]),d("div",{className:y("w-full",m),children:[h&&t(E,{data:{title:h}}),v&&t(I,{shape:w,align:S,value:b,onValueChange:s=>{p(s);const i=l?.find(n=>n?.tab===s);f(i?.data||[])},className:"mb-8",children:t(P,{children:l?.map((s,i)=>t(F,{value:s?.tab||"",children:s?.tab},i))})}),t(A,{className:"!overflow-visible",id:"ShelfDisplay"+c,data:{list:a,configuration:{...T,event:u}},Slide:M,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.1},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})]})};var O=V(L);export{O as default};
9
+ `,children:r?.secondaryButton||""})]})]},e?.id||e?.handle)},L=({data:e,buildData:r,className:c="",key:m,event:u})=>{const[b,p]=D(""),[a,o]=D([]),{productsTab:l=[],productsCard:x=[],title:h,align:S="left",isShowTab:v=!0,tabShape:w="square",...T}=e,f=s=>{const i=s?.map(n=>{const g=r?.products?.find(B=>B?.handle===n?.handle);if(g)return{sku:n.sku,...g}})?.filter(n=>n);o(i)};return N(()=>{if(v){p(l?.[0]?.tab||""),f(l?.[0]?.data||[]);return}f(x)},[]),d("div",{className:y("w-full",c),children:[h&&t(E,{data:{title:h}}),v&&t(I,{shape:w,align:S,value:b,onValueChange:s=>{p(s);const i=l?.find(n=>n?.tab===s);f(i?.data||[])},className:"mb-8",children:t(P,{children:l?.map((s,i)=>t(F,{value:s?.tab||"",children:s?.tab},i))})}),t(A,{className:"!overflow-visible",id:"ShelfDisplay"+m,data:{list:a,configuration:{...T,event:u}},Slide:M,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:1.1},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:4}}})]})};var O=V(L);export{O as default};
10
10
  //# 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 } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\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}\n\ntype EventType = {\n primaryButton?: (v: any) => void\n secondaryButton?: (v: any) => void\n}\n\nexport interface ShelfDisplayProps {\n data: {\n title?: string\n isShowTab?: boolean\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 /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n className?: string\n key?: string\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const onPrimaryButton = (params: ShelfDisplayItem) => configuration?.event?.primaryButton?.(params)\n\n const onSecondaryButton = (params: ShelfDisplayItem) => configuration?.event?.secondaryButton?.(params)\n\n const { price, basePrice } = formatVariantPrice({\n locale: 'us',\n amount: data?.price.amount || 0,\n baseAmount: data?.compareAtPrice?.amount || data?.price.amount || 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 return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className={cn('relative mb-2 inline-block h-[137px] overflow-hidden', 'tablet:mb-3 tablet:h-[195px]')}>\n <Picture source={handleUrl()} className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </div>\n <div className=\"tablet:mb-2 mb-1 flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags?.slice(0, 1)?.map?.((item: any, index: number) => {\n return (\n <div\n key={index}\n className=\"tablet:text-base rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]\"\n >\n {item}\n </div>\n )\n })}\n </div>\n <p\n title={data?.title || ''}\n className=\"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]\"\n >\n {data?.title || ''}\n </p>\n <h3\n title={data?.description || ''}\n className=\"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]\"\n >\n {data?.description || ''}\n </h3>\n <div className=\"mb-2 flex items-center\">\n <div className=\"tablet:text-2xl text-xl font-bold text-[#1D1D1F]\">{price || ''}</div>\n <div className=\"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]\">{basePrice || ''}</div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"flex items-center gap-3\">\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-transparent px-4 py-2 text-xs text-[#1D1D1F] hover:bg-transparent hover:text-black\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-[#1D1D1F] px-4 py-2 text-xs tracking-[-0.04em] text-white\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay: React.FC<ShelfDisplayProps> = ({ data, buildData, className = '', key, event }) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n align = 'left',\n isShowTab = true,\n tabShape = 'square',\n ...other\n } = data\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[]) => {\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 ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData)\n }\n\n useEffect(() => {\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [])\n return\n }\n handleCurrentTab(productsCard)\n }, [])\n\n return (\n <div className={cn('w-full', className)}>\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <Tabs\n shape={tabShape}\n align={align}\n value={tabId}\n onValueChange={v => {\n setTabId(v)\n const findData = productsTab?.find((item: any) => item?.tab === v)\n handleCurrentTab(findData?.data || [])\n }}\n className=\"mb-8\"\n >\n <TabsList>\n {productsTab?.map((item: any, index: number) => {\n return (\n <TabsTrigger key={index} value={item?.tab || ''}>\n {item?.tab}\n </TabsTrigger>\n )\n })}\n </TabsList>\n </Tabs>\n )}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'ShelfDisplay' + key}\n data={{ list: currentItems, configuration: { ...other, event: event } }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.1,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(ShelfDisplay)\n"],
5
- "mappings": "aA6FQ,cAAAA,EA0BF,QAAAC,MA1BE,oBA5FR,OAAgB,YAAAC,EAAU,aAAAC,MAAiB,QAC3C,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,MAAmB,2BAC5C,OAAOC,MAAY,6BACnB,OAAOC,MAAW,oBAClB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,sBAAAC,MAA0B,oBAwDnC,MAAMC,EAAmB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAA0C,CACxF,MAAMC,EAAmBC,GAA6BF,GAAe,OAAO,gBAAgBE,CAAM,EAE5FC,EAAqBD,GAA6BF,GAAe,OAAO,kBAAkBE,CAAM,EAEhG,CAAE,MAAAE,EAAO,UAAAC,CAAU,EAAIR,EAAmB,CAC9C,OAAQ,KACR,OAAQE,GAAM,MAAM,QAAU,EAC9B,WAAYA,GAAM,gBAAgB,QAAUA,GAAM,MAAM,QAAU,EAClE,aAAcA,GAAM,MAAM,cAAgB,KAC5C,CAAC,EAEKO,EAAY,IAAM,CACtB,MAAMC,EAAMR,GAAM,IACZS,EAAWT,GAAM,SAEvB,OADgBS,GAAU,KAAMC,GAAcA,GAAM,MAAQF,CAAG,GAC/C,OA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M,KADSC,CAElB,CAEH,EACH,EACF,EAEF1B,EAACW,EAAA,CACC,UAAU,oBACV,GAAI,eAAiBmB,EACrB,KAAM,CAAE,KAAMI,EAAc,cAAe,CAAE,GAAGQ,EAAO,MAAOX,CAAM,CAAE,EACtE,MAAOjB,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,CAEJ,EAEA,IAAOkC,EAAQpC,EAAWe,CAAY",
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\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}\n\ntype EventType = {\n primaryButton?: (v: any) => void\n secondaryButton?: (v: any) => void\n}\n\nexport interface ShelfDisplayProps {\n data: {\n title?: string\n isShowTab?: boolean\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 /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n className?: string\n key?: string\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const onPrimaryButton = (params: ShelfDisplayItem) => configuration?.event?.primaryButton?.(params)\n\n const onSecondaryButton = (params: ShelfDisplayItem) => configuration?.event?.secondaryButton?.(params)\n\n const { price, basePrice } = formatVariantPrice({\n locale: 'us',\n amount: data?.price.amount || 0,\n baseAmount: data?.compareAtPrice?.amount || data?.price.amount || 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 return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'laptop:pt-4 laptop:px-6 laptop:pb-6 flex size-full cursor-pointer flex-col overflow-hidden bg-[#EAEAEC] p-4',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className={cn('relative mb-2 inline-block h-[137px] overflow-hidden', 'tablet:mb-3 tablet:h-[195px]')}>\n <Picture source={handleUrl()} className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </div>\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags?.slice(0, 1)?.map?.((item: any, index: number) => {\n return (\n <div\n key={index}\n className=\"tablet:text-base box-border h-full rounded-2xl border-2 border-[#86868C] px-2 pt-1 text-sm font-bold text-[#1D1D1F]\"\n >\n {item}\n </div>\n )\n })}\n </div>\n <p\n title={data?.title || ''}\n className=\"desktop:text-2xl desktop:leading-7 line-clamp-2 max-h-[48px] flex-1 text-xl font-bold text-[#1D1D1F]\"\n >\n {data?.title || ''}\n </p>\n <h3\n title={data?.description || ''}\n className=\"tablet:mt-2 tablet:mb-3 desktop:text-lg mb-2 mt-1 h-6 truncate text-sm font-semibold text-[#1D1D1F]\"\n >\n {data?.description || ''}\n </h3>\n <div className=\"mb-2 flex items-center\">\n <div className=\"tablet:text-2xl text-xl font-bold text-[#1D1D1F]\">{price || ''}</div>\n <div className=\"tablet:text-2xl ml-1 text-xl font-bold text-[#86868C]\">{basePrice || ''}</div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"flex items-center gap-3\">\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-transparent px-4 py-2 text-xs text-[#1D1D1F] hover:bg-transparent hover:text-black\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data)}\n className={`\n laptop:text-sm desktop:text-base laptop:px-6 desktop:px-7 laptop:py-2.5 desktop:py-3 box-border flex-1 border\n border-[#1D1D1F] bg-[#1D1D1F] px-4 py-2 text-xs tracking-[-0.04em] text-white\n ${configuration?.shape === 'round' ? 'desktop:rounded-3xl rounded-[20px]' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay: React.FC<ShelfDisplayProps> = ({ data, buildData, className = '', key, event }) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n align = 'left',\n isShowTab = true,\n tabShape = 'square',\n ...other\n } = data\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[]) => {\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 ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData)\n }\n\n useEffect(() => {\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [])\n return\n }\n handleCurrentTab(productsCard)\n }, [])\n\n return (\n <div className={cn('w-full', className)}>\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <Tabs\n shape={tabShape}\n align={align}\n value={tabId}\n onValueChange={v => {\n setTabId(v)\n const findData = productsTab?.find((item: any) => item?.tab === v)\n handleCurrentTab(findData?.data || [])\n }}\n className=\"mb-8\"\n >\n <TabsList>\n {productsTab?.map((item: any, index: number) => {\n return (\n <TabsTrigger key={index} value={item?.tab || ''}>\n {item?.tab}\n </TabsTrigger>\n )\n })}\n </TabsList>\n </Tabs>\n )}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'ShelfDisplay' + key}\n data={{ list: currentItems, configuration: { ...other, event: event } }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1.1,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(ShelfDisplay)\n"],
5
+ "mappings": "aA6FQ,cAAAA,EA0BF,QAAAC,MA1BE,oBA5FR,OAAgB,YAAAC,EAAU,aAAAC,MAAiB,QAC3C,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,MAAmB,2BAC5C,OAAOC,MAAY,6BACnB,OAAOC,MAAW,oBAClB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,sBAAAC,MAA0B,oBAwDnC,MAAMC,EA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AAG,CAAC,CAAC,EAGHpC,EAAC,OAAI,UAAWG,EAAG,SAAUyB,CAAS,EACnC,UAAAS,GAAStC,EAACU,EAAA,CAAM,KAAM,CAAE,MAAO4B,CAAM,EAAG,EACxCE,GACCxC,EAACM,EAAA,CACC,MAAOmC,EACP,MAAOF,EACP,MAAOP,EACP,cAAee,GAAK,CAClBd,EAASc,CAAC,EACV,MAAMD,EAAWV,GAAa,KAAMX,GAAcA,GAAM,MAAQsB,CAAC,EACjEJ,EAAiBG,GAAU,MAAQ,CAAC,CAAC,CACvC,EACA,UAAU,OAEV,SAAA9C,EAACO,EAAA,CACE,SAAA6B,GAAa,IAAI,CAACX,EAAWC,IAE1B1B,EAACQ,EAAA,CAAwB,MAAOiB,GAAM,KAAO,GAC1C,SAAAA,GAAM,KADSC,CAElB,CAEH,EACH,EACF,EAEF1B,EAACW,EAAA,CACC,UAAU,oBACV,GAAI,eAAiBmB,EACrB,KAAM,CAAE,KAAMI,EAAc,cAAe,CAAE,GAAGQ,EAAO,MAAOX,CAAM,CAAE,EACtE,MAAOjB,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,CAEJ,EAEA,IAAOkC,EAAQpC,EAAWe,CAAY",
6
6
  "names": ["jsx", "jsxs", "useState", "useEffect", "cn", "Picture", "Tabs", "TabsList", "TabsTrigger", "Button", "Title", "SwiperBox", "withStyles", "formatVariantPrice", "ShelfDisplayItem", "data", "configuration", "onPrimaryButton", "params", "onSecondaryButton", "price", "basePrice", "handleUrl", "sku", "skuArray", "item", "index", "ShelfDisplay", "buildData", "className", "key", "event", "tabId", "setTabId", "currentItems", "setCurrentItems", "productsTab", "productsCard", "title", "align", "isShowTab", "tabShape", "other", "handleCurrentTab", "currentData", "newCurrentData", "findData", "v", "ShelfDisplay_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as k}from"react/jsx-runtime";import{cn as a}from"../../helpers/utils.js";import{Picture as f,Text as o,Button as p}from"../../components/index.js";import v from"../CpnCountDown/index.js";const w=b=>{const{id:m,image:c,imageMob:u,imageLink:i,content:x=[],cns:n}=b,r=t=>{if(t?.startsWith("http")&&(location.href=t),t?.startsWith("#")){const l=document.querySelector(t);l&&l.scrollIntoView({behavior:"smooth"})}};return k("div",{id:m,className:a("cpn-banner-container relative w-full",n?.container),children:[e(f,{loading:"eager",source:`${c}, ${u||c} 768`,className:a("cpn-banner-picture",n?.picture),imgClassName:a("cpn-banner-image h-full object-cover",n?.image),alt:""}),i&&e("a",{href:i,className:"absolute left-0 top-0 z-[1] size-full"}),e("div",{className:a("cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center",n?.box),children:e("div",{className:"tablet:px-10 desktop:px-20 px-6",children:e("div",{className:a("cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]",n?.content),children:x?.map((t,l)=>{switch(t.type){case"subheading":return e(o,{as:"div",html:t.text,className:a("cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",n?.subheading)},l);case"title":return e(o,{as:"div",html:t.text,className:a("cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]",n?.title)},l);case"subtitle":return e(o,{as:"div",html:t.text,className:a("cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",n?.subtitle)},l);case"button":return e("div",{className:a("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",n?.buttonBox),children:e(p,{className:a("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",n?.button,t.cns),onClick:t.onClick?t.onClick:()=>r(t.target||""),children:t.text},l)});case"buttons":return e("div",{className:a("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",n?.buttonBox),children:t.buttons.map((s,d)=>e(p,{className:a("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",n?.button,s.cns),onClick:s.onClick?s.onClick:()=>r(s.target||""),children:s.text},d))});case"countdown":return e("div",{className:"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center",children:e(v,{endTime:t.endTime,copy:t.copy,cns:n?.countdown})},l)}})})})})]})};var N=w;export{N as default};
1
+ import{jsx as n,jsxs as k}from"react/jsx-runtime";import{cn as a}from"../../helpers/utils.js";import{Picture as f,Text as s,Button as p}from"../../components/index.js";import v from"../CpnCountDown/index.js";const w=b=>{const{id:m,image:c,imageMob:u,imageLink:i,content:x=[],cns:e}=b,r=t=>{if(t?.startsWith("http")&&(location.href=t),t?.startsWith("#")){const l=document.querySelector(t);l&&l.scrollIntoView({behavior:"smooth"})}};return k("div",{id:m,className:a("cpn-banner-container relative w-full",e?.container),children:[n(f,{loading:"eager",source:`${c}, ${u||c} 768`,className:a("cpn-banner-picture",e?.picture),imgClassName:a("cpn-banner-image h-full object-cover",e?.image),alt:""}),i&&n("a",{href:i,className:"absolute left-0 top-0 z-[1] size-full"}),n("div",{className:a("cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center",e?.box),children:n("div",{className:a("cpn-banner-content-box tablet:px-10 desktop:px-20 px-6",e?.contentBox),children:n("div",{className:a("cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]",e?.content),children:x?.map((t,l)=>{switch(t.type){case"subheading":return n(s,{as:"div",html:t.text,className:a("cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",e?.subheading)},l);case"title":return n(s,{as:"div",html:t.text,className:a("cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]",e?.title)},l);case"subtitle":return n(s,{as:"div",html:t.text,className:a("cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium",e?.subtitle)},l);case"button":return n("div",{className:a("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",e?.buttonBox),children:n(p,{className:a("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",e?.button,t.cns),onClick:t.onClick?t.onClick:()=>r(t.target||""),children:t.text},l)});case"buttons":return n("div",{className:a("cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center",e?.buttonBox),children:t.buttons.map((o,d)=>n(p,{className:a("cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5",e?.button,o.cns),onClick:o.onClick?o.onClick:()=>r(o.target||""),children:o.text},d))});case"countdown":return n("div",{className:"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center",children:n(v,{endTime:t.endTime,copy:t.copy,cns:e?.countdown})},l)}})})})})]})};var N=w;export{N as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cpn-components/CpnBanner/index.tsx"],
4
- "sourcesContent": ["import type { BannerProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Picture, Text, Button } from '../../components/index.js'\nimport CountDown from '../CpnCountDown/index.js'\n\nconst CpnBanner = (props: BannerProps) => {\n const { id, image, imageMob, imageLink, content = [], cns } = props\n\n const btnClick = (target: string) => {\n if (target?.startsWith('http')) {\n location.href = target\n }\n if (target?.startsWith('#')) {\n const element = document.querySelector(target)\n if (element) {\n element.scrollIntoView({ behavior: 'smooth' })\n }\n }\n }\n\n return (\n <div id={id} className={cn('cpn-banner-container relative w-full', cns?.container)}>\n <Picture\n loading=\"eager\"\n source={`${image}, ${imageMob || image} 768`}\n className={cn('cpn-banner-picture', cns?.picture)}\n imgClassName={cn('cpn-banner-image h-full object-cover', cns?.image)}\n alt=\"\"\n />\n {imageLink && <a href={imageLink} className=\"absolute left-0 top-0 z-[1] size-full\"></a>}\n <div\n className={cn(\n 'cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center',\n cns?.box\n )}\n >\n <div className=\"tablet:px-10 desktop:px-20 px-6\">\n <div className={cn('cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]', cns?.content)}>\n {content?.map((item, index) => {\n switch (item.type) {\n case 'subheading':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subheading\n )}\n />\n )\n case 'title':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]',\n cns?.title\n )}\n />\n )\n case 'subtitle':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subtitle\n )}\n />\n )\n case 'button':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n item.cns\n )}\n onClick={item.onClick ? item.onClick : () => btnClick(item.target || '')}\n >\n {item.text}\n </Button>\n </div>\n )\n case 'buttons':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n {item.buttons.map((button, index) => (\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n button.cns\n )}\n onClick={button.onClick ? button.onClick : () => btnClick(button.target || '')}\n >\n {button.text}\n </Button>\n ))}\n </div>\n )\n case 'countdown':\n return (\n <div\n key={index}\n className=\"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center\"\n >\n <CountDown endTime={item.endTime} copy={item.copy} cns={cns?.countdown} />\n </div>\n )\n }\n })}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CpnBanner\n"],
5
- "mappings": "AAqBI,OACE,OAAAA,EADF,QAAAC,MAAA,oBApBJ,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,EAAS,QAAAC,EAAM,UAAAC,MAAc,4BACtC,OAAOC,MAAe,2BAEtB,MAAMC,EAAaC,GAAuB,CACxC,KAAM,CAAE,GAAAC,EAAI,MAAAC,EAAO,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,CAAC,EAAG,IAAAC,CAAI,EAAIN,EAExDO,EAAYC,GAAmB,CAInC,GAHIA,GAAQ,WAAW,MAAM,IAC3B,SAAS,KAAOA,GAEdA,GAAQ,WAAW,GAAG,EAAG,CAC3B,MAAMC,EAAU,SAAS,cAAcD,CAAM,EACzCC,GACFA,EAAQ,eAAe,CAAE,SAAU,QAAS,CAAC,CAEjD,CACF,EAEA,OACEhB,EAAC,OAAI,GAAIQ,EAAI,UAAWP,EAAG,uCAAwCY,GAAK,SAA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AAO,QAAUA,EAAO,QAAU,IAAML,EAASK,EAAO,QAAU,EAAE,EAE5E,SAAAA,EAAO,MARHD,CASP,CACD,EACH,EAEJ,IAAK,YACH,OACEnB,EAAC,OAEC,UAAU,iFAEV,SAAAA,EAACM,EAAA,CAAU,QAASY,EAAK,QAAS,KAAMA,EAAK,KAAM,IAAKJ,GAAK,UAAW,GAHnEK,CAIP,CAEN,CACF,CAAC,EACH,EACF,EACF,GACF,CAEJ,EAEA,IAAOE,EAAQd",
4
+ "sourcesContent": ["import type { BannerProps } from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Picture, Text, Button } from '../../components/index.js'\nimport CountDown from '../CpnCountDown/index.js'\n\nconst CpnBanner = (props: BannerProps) => {\n const { id, image, imageMob, imageLink, content = [], cns } = props\n\n const btnClick = (target: string) => {\n if (target?.startsWith('http')) {\n location.href = target\n }\n if (target?.startsWith('#')) {\n const element = document.querySelector(target)\n if (element) {\n element.scrollIntoView({ behavior: 'smooth' })\n }\n }\n }\n\n return (\n <div id={id} className={cn('cpn-banner-container relative w-full', cns?.container)}>\n <Picture\n loading=\"eager\"\n source={`${image}, ${imageMob || image} 768`}\n className={cn('cpn-banner-picture', cns?.picture)}\n imgClassName={cn('cpn-banner-image h-full object-cover', cns?.image)}\n alt=\"\"\n />\n {imageLink && <a href={imageLink} className=\"absolute left-0 top-0 z-[1] size-full\"></a>}\n <div\n className={cn(\n 'cpn-banner-box tablet:flex tablet:flex-col tablet:justify-center tablet:pt-0 tablet:text-left absolute left-0 top-0 size-full pt-10 text-center',\n cns?.box\n )}\n >\n <div className={cn('cpn-banner-content-box tablet:px-10 desktop:px-20 px-6', cns?.contentBox)}>\n <div className={cn('cpn-banner-content tablet:mx-0 tablet:max-w-[40vw] mx-auto max-w-[70vw]', cns?.content)}>\n {content?.map((item, index) => {\n switch (item.type) {\n case 'subheading':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subheading tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subheading\n )}\n />\n )\n case 'title':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-title tablet:mt-5 tablet:text-[2.7vw] lg-desktop:text-[56px] mt-4 text-[32px] font-bold leading-[1.12]',\n cns?.title\n )}\n />\n )\n case 'subtitle':\n return (\n <Text\n key={index}\n as=\"div\"\n html={item.text}\n className={cn(\n 'cpn-banner-subtitle tablet:mt-5 tablet:text-[1.25vw] lg-desktop:text-[24px] mt-4 font-medium',\n cns?.subtitle\n )}\n />\n )\n case 'button':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n item.cns\n )}\n onClick={item.onClick ? item.onClick : () => btnClick(item.target || '')}\n >\n {item.text}\n </Button>\n </div>\n )\n case 'buttons':\n return (\n <div\n className={cn(\n 'cpn-banner-buttonBox tablet:mt-6 tablet:justify-start mt-4 flex justify-center',\n cns?.buttonBox\n )}\n >\n {item.buttons.map((button, index) => (\n <Button\n key={index}\n className={cn(\n 'cpn-banner-button tablet:min-w-[138px] tablet:px-7 lg-desktop:min-w-[156px] lg-desktop:px-8 !w-auto min-w-[120px] !max-w-full px-5',\n cns?.button,\n button.cns\n )}\n onClick={button.onClick ? button.onClick : () => btnClick(button.target || '')}\n >\n {button.text}\n </Button>\n ))}\n </div>\n )\n case 'countdown':\n return (\n <div\n key={index}\n className=\"cpn-banner-countdown tablet:mt-6 tablet:justify-start mt-4 flex justify-center\"\n >\n <CountDown endTime={item.endTime} copy={item.copy} cns={cns?.countdown} />\n </div>\n )\n }\n })}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CpnBanner\n"],
5
+ "mappings":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ACX,UAAWhB,EACT,oHACAY,GAAK,KACP,GANKK,CAOP,EAEJ,IAAK,WACH,OACEnB,EAACI,EAAA,CAEC,GAAG,MACH,KAAMc,EAAK,KACX,UAAWhB,EACT,+FACAY,GAAK,QACP,GANKK,CAOP,EAEJ,IAAK,SACH,OACEnB,EAAC,OACC,UAAWE,EACT,iFACAY,GAAK,SACP,EAEA,SAAAd,EAACK,EAAA,CAEC,UAAWH,EACT,qIACAY,GAAK,OACLI,EAAK,GACP,EACA,QAASA,EAAK,QAAUA,EAAK,QAAU,IAAMH,EAASG,EAAK,QAAU,EAAE,EAEtE,SAAAA,EAAK,MARDC,CASP,EACF,EAEJ,IAAK,UACH,OACEnB,EAAC,OACC,UAAWE,EACT,iFACAY,GAAK,SACP,EAEC,SAAAI,EAAK,QAAQ,IAAI,CAACE,EAAQD,IACzBnB,EAACK,EAAA,CAEC,UAAWH,EACT,qIACAY,GAAK,OACLM,EAAO,GACT,EACA,QAASA,EAAO,QAAUA,EAAO,QAAU,IAAML,EAASK,EAAO,QAAU,EAAE,EAE5E,SAAAA,EAAO,MARHD,CASP,CACD,EACH,EAEJ,IAAK,YACH,OACEnB,EAAC,OAEC,UAAU,iFAEV,SAAAA,EAACM,EAAA,CAAU,QAASY,EAAK,QAAS,KAAMA,EAAK,KAAM,IAAKJ,GAAK,UAAW,GAHnEK,CAIP,CAEN,CACF,CAAC,EACH,EACF,EACF,GACF,CAEJ,EAEA,IAAOE,EAAQd",
6
6
  "names": ["jsx", "jsxs", "cn", "Picture", "Text", "Button", "CountDown", "CpnBanner", "props", "id", "image", "imageMob", "imageLink", "content", "cns", "btnClick", "target", "element", "item", "index", "button", "CpnBanner_default"]
7
7
  }
@@ -30,6 +30,7 @@ export type BannerProps = {
30
30
  picture?: string;
31
31
  image?: string;
32
32
  box?: string;
33
+ contentBox?: string;
33
34
  content?: string;
34
35
  subheading?: string;
35
36
  title?: string;
@@ -1,2 +1,2 @@
1
- import{jsx as s}from"react/jsx-runtime";import{useEffect as g,useRef as x,useState as C}from"react";import{cn as l}from"../../helpers/utils.js";import w from"lodash.debounce";const y=d=>{const{lists:a,styles:i,cns:r,offset:v=0}=d,[u,f]=C(0),p=x(null),b=e=>{e.scrollIntoView({behavior:"smooth",inline:"center"})},h=(e,o,t)=>{f(o);const n=t.target;b(n),e.anchor&&document.querySelector(`#${e.anchor}`)?.scrollIntoView({behavior:"smooth"}),t.preventDefault()};return g(()=>{const e=w(()=>{const t=[];a?.forEach(c=>{const m=document.querySelector(`#${c.anchor}`);m&&t.push(m.getBoundingClientRect().top)});const n=t.findIndex(c=>c>o+v)-1;f(n<0?0:n)},100),o=p.current?.getBoundingClientRect().height||0;return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[a,v]),s("div",{id:"nav",className:l("cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]",r?.container),style:{"--bgColor":i?.bgColor||"#C6F1FF","--color":i?.color||"#333","--activeColor":i?.activeColor||"#000"},children:s("div",{className:l("cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden","tablet:gap-[80px] tablet:justify-center",r?.box),ref:p,children:a?.map((e,o)=>s("a",{href:`#${e.anchor}`,className:l("cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200",r?.item,{[`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[""] ${r?.activeItem}`]:u===o}),onClick:t=>h(e,o,t),children:e.label},e.label))})})};var S=y;export{S as default};
1
+ import{jsx as s}from"react/jsx-runtime";import{useEffect as g,useRef as x,useState as C}from"react";import{cn as c}from"../../helpers/utils.js";import w from"lodash.debounce";const y=d=>{const{lists:a,styles:i,cns:n,offset:v=0}=d,[u,f]=C(0),p=x(null),b=e=>{e.scrollIntoView({behavior:"smooth",inline:"center"})},h=(e,o,t)=>{f(o);const r=t.target;b(r),e.anchor&&document.querySelector(`#${e.anchor}`)?.scrollIntoView({behavior:"smooth"}),t.preventDefault()};return g(()=>{const e=w(()=>{const t=[];a?.forEach(l=>{const m=document.querySelector(`#${l.anchor}`);m&&t.push(m.getBoundingClientRect().top)});const r=t.findIndex(l=>l>o+v);f(r===-1?t.length-1:r===0?0:r-1)},100),o=p.current?.getBoundingClientRect().height||0;return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[a,v]),s("div",{id:"nav",className:c("cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]",n?.container),style:{"--bgColor":i?.bgColor||"#C6F1FF","--color":i?.color||"#333","--activeColor":i?.activeColor||"#000"},children:s("div",{className:c("cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden","tablet:gap-[80px] tablet:justify-center",n?.box),ref:p,children:a?.map((e,o)=>s("a",{href:`#${e.anchor}`,className:c("cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200",n?.item,{[`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[""] ${n?.activeItem}`]:u===o}),onClick:t=>h(e,o,t),children:e.label},e.label))})})};var S=y;export{S as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cpn-components/CpnNavigation/index.tsx"],
4
- "sourcesContent": ["import React, { useEffect, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport type { Nav, NavigationProps } from './types.js'\nimport debounce from 'lodash.debounce'\n\nconst CpnNavigation = (props: NavigationProps) => {\n const { lists, styles, cns, offset = 0 } = props\n const [activeIndex, setActiveIndex] = useState(0)\n const navBox = useRef<HTMLDivElement>(null)\n\n const scrollIntoView = (ele: HTMLElement) => {\n ele.scrollIntoView({ behavior: 'smooth', inline: 'center' })\n }\n\n const handleNavItemClick = (nav: Nav, index: number, e: React.SyntheticEvent<EventTarget>) => {\n setActiveIndex(index)\n const ele = e.target as HTMLAnchorElement\n scrollIntoView(ele)\n if (nav.anchor) {\n document.querySelector(`#${nav.anchor}`)?.scrollIntoView({ behavior: 'smooth' })\n }\n e.preventDefault()\n }\n\n useEffect(() => {\n const scrollHandler = debounce(() => {\n const sectionTops: number[] = []\n lists?.forEach(nav => {\n const section = document.querySelector(`#${nav.anchor}`)\n if (section) {\n sectionTops.push(section.getBoundingClientRect().top)\n }\n })\n const index = sectionTops.findIndex(sectionTop => sectionTop > navHeight + offset) - 1\n setActiveIndex(index < 0 ? 0 : index)\n }, 100)\n const navHeight = navBox.current?.getBoundingClientRect().height || 0\n window.addEventListener('scroll', scrollHandler)\n return () => {\n window.removeEventListener('scroll', scrollHandler)\n }\n }, [lists, offset])\n\n return (\n <div\n id=\"nav\"\n className={cn('cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]', cns?.container)}\n style={\n {\n '--bgColor': styles?.bgColor || '#C6F1FF',\n '--color': styles?.color || '#333',\n '--activeColor': styles?.activeColor || '#000',\n } as React.CSSProperties\n }\n >\n <div\n className={cn(\n 'cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden',\n 'tablet:gap-[80px] tablet:justify-center',\n cns?.box\n )}\n ref={navBox}\n >\n {lists?.map((nav, index) => {\n return (\n <a\n key={nav.label}\n href={`#${nav.anchor}`}\n className={cn(\n 'cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200',\n cns?.item,\n {\n [`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[\"\"] ${cns?.activeItem}`]:\n activeIndex === index,\n }\n )}\n onClick={e => handleNavItemClick(nav, index, e)}\n >\n {nav.label}\n </a>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default CpnNavigation\n"],
5
- "mappings": "AAiEY,cAAAA,MAAA,oBAjEZ,OAAgB,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QACnD,OAAS,MAAAC,MAAU,yBAEnB,OAAOC,MAAc,kBAErB,MAAMC,EAAiBC,GAA2B,CAChD,KAAM,CAAE,MAAAC,EAAO,OAAAC,EAAQ,IAAAC,EAAK,OAAAC,EAAS,CAAE,EAAIJ,EACrC,CAACK,EAAaC,CAAc,EAAIV,EAAS,CAAC,EAC1CW,EAASZ,EAAuB,IAAI,EAEpCa,EAAkBC,GAAqB,CAC3CA,EAAI,eAAe,CAAE,SAAU,SAAU,OAAQ,QAAS,CAAC,CAC7D,EAEMC,EAAqB,CAACC,EAAUC,EAAeC,IAAyC,CAC5FP,EAAeM,CAAK,EACpB,MAAMH,EAAMI,EAAE,OACdL,EAAeC,CAAG,EACdE,EAAI,QACN,SAAS,cAAc,IAAIA,EAAI,MAAM,EAAE,GAAG,eAAe,CAAE,SAAU,QAAS,CAAC,EAEjFE,EAAE,eAAe,CACnB,EAEA,OAAAnB,EAAU,IAAM,CACd,MAAMoB,EAAgBhB,EAAS,IAAM,CACnC,MAAMiB,EAAwB,CAAC,EAC/Bd,GAAO,QAAQU,GAAO,CACpB,MAAMK,EAAU,SAAS,cAAc,IAAIL,EAAI,MAAM,EAAE,EACnDK,GACFD,EAAY,KAAKC,EAAQ,sBAAsB,EAAE,GAAG,CAExD,CAAC,EACD,MAAMJ,EAAQG,EAAY,UAAUE,GAAcA,EAAaC,EAAYd,CAAM,EAAI,EACrFE,EAAeM,EAAQ,EAAI,EAAIA,CAAK,CACtC,EAAG,GAAG,EACAM,EAAYX,EAAO,SAAS,sBAAsB,EAAE,QAAU,EACpE,cAAO,iBAAiB,SAAUO,CAAa,EACxC,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAa,CACpD,CACF,EAAG,CAACb,EAAOG,CAAM,CAAC,EAGhBX,EAAC,OACC,GAAG,MACH,UAAWI,EAAG,iEAAkEM,GAAK,SAAS,EAC9F,MACE,CACE,YAAaD,GAAQ,SAAW,UAChC,UAAWA,GAAQ,OAAS,OAC5B,gBAAiBA,GAAQ,aAAe,MAC1C,EAGF,SAAAT,EAAC,OACC,UAAWI,EACT,iIACA,0CACAM,GAAK,GACP,EACA,IAAKI,EAEJ,SAAAN,GAAO,IAAI,CAACU,EAAKC,IAEdnB,EAAC,KAEC,KAAM,IAAIkB,EAAI,MAAM,GACpB,UAAWd,EACT,yJACAM,GAAK,KACL,CACE,CAAC,wNAAwNA,GAAK,UAAU,EAAE,EACxOE,IAAgBO,CACpB,CACF,EACA,QAASC,GAAKH,EAAmBC,EAAKC,EAAOC,CAAC,EAE7C,SAAAF,EAAI,OAZAA,EAAI,KAaX,CAEH,EACH,EACF,CAEJ,EAEA,IAAOQ,EAAQpB",
4
+ "sourcesContent": ["import React, { useEffect, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport type { Nav, NavigationProps } from './types.js'\nimport debounce from 'lodash.debounce'\n\nconst CpnNavigation = (props: NavigationProps) => {\n const { lists, styles, cns, offset = 0 } = props\n const [activeIndex, setActiveIndex] = useState(0)\n const navBox = useRef<HTMLDivElement>(null)\n\n const scrollIntoView = (ele: HTMLElement) => {\n ele.scrollIntoView({ behavior: 'smooth', inline: 'center' })\n }\n\n const handleNavItemClick = (nav: Nav, index: number, e: React.SyntheticEvent<EventTarget>) => {\n setActiveIndex(index)\n const ele = e.target as HTMLAnchorElement\n scrollIntoView(ele)\n if (nav.anchor) {\n document.querySelector(`#${nav.anchor}`)?.scrollIntoView({ behavior: 'smooth' })\n }\n e.preventDefault()\n }\n\n useEffect(() => {\n const scrollHandler = debounce(() => {\n const sectionTops: number[] = []\n lists?.forEach(nav => {\n const section = document.querySelector(`#${nav.anchor}`)\n if (section) {\n sectionTops.push(section.getBoundingClientRect().top)\n }\n })\n const index = sectionTops.findIndex(sectionTop => sectionTop > navHeight + offset)\n setActiveIndex(index === -1 ? sectionTops.length - 1 : index === 0 ? 0 : index - 1)\n }, 100)\n const navHeight = navBox.current?.getBoundingClientRect().height || 0\n window.addEventListener('scroll', scrollHandler)\n return () => {\n window.removeEventListener('scroll', scrollHandler)\n }\n }, [lists, offset])\n\n return (\n <div\n id=\"nav\"\n className={cn('cpn-nav-container sticky top-0 z-10 w-full bg-[var(--bgColor)]', cns?.container)}\n style={\n {\n '--bgColor': styles?.bgColor || '#C6F1FF',\n '--color': styles?.color || '#333',\n '--activeColor': styles?.activeColor || '#000',\n } as React.CSSProperties\n }\n >\n <div\n className={cn(\n 'cpn-nav-box relative flex items-center justify-start gap-[18px] overflow-scroll px-6 text-center [&::-webkit-scrollbar]:hidden',\n 'tablet:gap-[80px] tablet:justify-center',\n cns?.box\n )}\n ref={navBox}\n >\n {lists?.map((nav, index) => {\n return (\n <a\n key={nav.label}\n href={`#${nav.anchor}`}\n className={cn(\n 'cpn-nav-item relative cursor-pointer whitespace-nowrap py-[14px] text-[16px] font-medium leading-[1.2] text-[var(--color)] transition-all duration-200',\n cns?.item,\n {\n [`border-[var(--activeColor)] text-[var(--activeColor)] after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-[var(--activeColor)] after:transition-all after:duration-200 after:content-[\"\"] ${cns?.activeItem}`]:\n activeIndex === index,\n }\n )}\n onClick={e => handleNavItemClick(nav, index, e)}\n >\n {nav.label}\n </a>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default CpnNavigation\n"],
5
+ "mappings": "AAiEY,cAAAA,MAAA,oBAjEZ,OAAgB,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QACnD,OAAS,MAAAC,MAAU,yBAEnB,OAAOC,MAAc,kBAErB,MAAMC,EAAiBC,GAA2B,CAChD,KAAM,CAAE,MAAAC,EAAO,O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P,EACA,IAAKI,EAEJ,SAAAN,GAAO,IAAI,CAACU,EAAKC,IAEdnB,EAAC,KAEC,KAAM,IAAIkB,EAAI,MAAM,GACpB,UAAWd,EACT,yJACAM,GAAK,KACL,CACE,CAAC,wNAAwNA,GAAK,UAAU,EAAE,EACxOE,IAAgBO,CACpB,CACF,EACA,QAASC,GAAKH,EAAmBC,EAAKC,EAAOC,CAAC,EAE7C,SAAAF,EAAI,OAZAA,EAAI,KAaX,CAEH,EACH,EACF,CAEJ,EAEA,IAAOQ,EAAQpB",
6
6
  "names": ["jsx", "useEffect", "useRef", "useState", "cn", "debounce", "CpnNavigation", "props", "lists", "styles", "cns", "offset", "activeIndex", "setActiveIndex", "navBox", "scrollIntoView", "ele", "handleNavItemClick", "nav", "index", "e", "scrollHandler", "sectionTops", "section", "sectionTop", "navHeight", "CpnNavigation_default"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "0.0.27-alpha.47",
3
+ "version": "0.0.27-alpha.49",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",