@anker-in/headless-ui 1.1.9-alpha.1765244858268 → 1.1.9-alpha.1765274523036

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  2. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +2 -2
  3. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  4. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  5. package/dist/cjs/biz-components/ImageWithText/types.d.ts +0 -2
  6. package/dist/cjs/biz-components/ImageWithText/types.js.map +1 -1
  7. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  8. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +2 -2
  9. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  10. package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
  11. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +2 -2
  12. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  13. package/dist/cjs/shared/Styles.d.ts +2 -2
  14. package/dist/cjs/shared/Styles.js +1 -1
  15. package/dist/cjs/shared/Styles.js.map +3 -3
  16. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  17. package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +2 -2
  18. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  19. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  20. package/dist/esm/biz-components/ImageWithText/types.d.ts +0 -2
  21. package/dist/esm/biz-components/ImageWithText/types.js.map +1 -1
  22. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  23. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +2 -2
  24. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  25. package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
  26. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +2 -2
  27. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  28. package/dist/esm/shared/Styles.d.ts +2 -2
  29. package/dist/esm/shared/Styles.js +1 -1
  30. package/dist/esm/shared/Styles.js.map +3 -3
  31. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var P=Object.create;var x=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var H=(t,a)=>{for(var n in a)x(t,n,{get:a[n],enumerable:!0})},f=(t,a,n,c)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of L(a))!D.call(t,r)&&r!==n&&x(t,r,{get:()=>a[r],enumerable:!(c=T(a,r))||c.enumerable});return t};var M=(t,a,n)=>(n=t!=null?P(C(t)):{},f(a||!t||!t.__esModule?x(n,"default",{value:t,enumerable:!0}):n,t)),R=t=>f(x({},"__esModule",{value:!0}),t);var V={};H(V,{default:()=>j});module.exports=R(V);var e=require("react/jsx-runtime"),p=require("react"),v=require("../../helpers/utils.js"),k=require("../../shared/Styles.js"),i=require("../../components/index.js"),g=require("../../hooks/useExposure.js"),u=M(require("@radix-ui/react-popover"));const S="navigation",z="product_nav",B=t=>(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,e.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),h=(0,p.forwardRef)(({className:t="",data:a,id:n},c)=>{const{tabLinks:r=[],anchorList:w=[],textLink:s,buyBtn:d,theme:b="light"}=a||{},[N,y]=(0,p.useState)(""),m=(0,p.useRef)(null);(0,p.useImperativeHandle)(c,()=>m.current),(0,g.useExposure)(m,{componentType:S,componentName:z}),(0,p.useEffect)(()=>{const o=()=>{y(window.location.hash)};return o(),window.addEventListener("hashchange",o),()=>{window.removeEventListener("hashchange",o)}},[]);const E=o=>{o.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})};return(0,e.jsxs)("div",{id:n,ref:m,className:(0,v.cn)("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":b==="dark"},t),children:[(0,e.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,e.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,e.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[r.map((o,l)=>(0,e.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,e.jsx)("a",{href:o.link,className:(0,v.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":l!==0,"hidden desktop:block":l===1}),children:(0,e.jsx)("span",{children:o.label})}),l!==r.length-1&&(0,e.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},o.link||l)),r.length>1&&(0,e.jsxs)(u.Root,{children:[(0,e.jsx)(u.Trigger,{asChild:!0,children:(0,e.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-[4px] inline-block","aria-label":"More products",children:(0,e.jsx)(B,{className:"text-[#1D1D1F]"})})}),(0,e.jsx)(u.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:r.slice(1).map(o=>(0,e.jsx)("a",{href:o.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,e.jsx)("span",{children:o.label})},o.link))})]})]}),(0,e.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[s?.link&&(0,e.jsx)("a",{href:s.link,target:s.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,e.jsx)(i.Text,{size:2,className:"text-nowrap",children:s.text})}),d?.link&&(0,e.jsx)(i.Button,{as:"a",href:d.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:d.text})]})]}),(0,e.jsx)("div",{className:"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]",children:w.map(o=>(0,e.jsxs)("a",{href:`#${o.id}`,className:"product-nav-anchor-link",onClick:l=>{E(l)},children:[(0,e.jsx)(i.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:o.label}),(0,e.jsx)("div",{className:(0,v.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"bg-brand-color":N===`#${o.id}`})})]},o.id))})]}),(0,e.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[s?.link&&(0,e.jsx)("a",{href:s.link,target:s.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:(0,e.jsx)(i.Text,{size:2,className:"text-nowrap",children:s.text})}),d?.link&&(0,e.jsx)(i.Button,{as:"a",href:d.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:d.text})]})]})});h.displayName="ProductNav";var j=(0,k.withLayout)(h);
1
+ "use strict";"use client";var P=Object.create;var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var D=(o,a)=>{for(var r in a)m(o,r,{get:a[r],enumerable:!0})},k=(o,a,r,x)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of S(a))!M.call(o,s)&&s!==r&&m(o,s,{get:()=>a[s],enumerable:!(x=C(a,s))||x.enumerable});return o};var R=(o,a,r)=>(r=o!=null?P(H(o)):{},k(a||!o||!o.__esModule?m(r,"default",{value:o,enumerable:!0}):r,o)),z=o=>k(m({},"__esModule",{value:!0}),o);var I={};D(I,{default:()=>G});module.exports=z(I);var e=require("react/jsx-runtime"),n=require("react"),u=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),d=require("../../components/index.js"),b=require("../../hooks/useExposure.js"),f=R(require("@radix-ui/react-popover"));const B="navigation",j="product_nav",V=o=>(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:(0,e.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),g=(0,n.forwardRef)(({className:o="",data:a,id:r},x)=>{const{tabLinks:s=[],anchorList:y=[],textLink:l,buyBtn:c,theme:N="light"}=a||{},[E,T]=(0,n.useState)(""),v=(0,n.useRef)(null);(0,n.useImperativeHandle)(x,()=>v.current),(0,b.useExposure)(v,{componentType:B,componentName:j}),(0,n.useEffect)(()=>{const t=()=>{T(window.location.hash)};return t(),window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t)}},[]),(0,n.useEffect)(()=>{const t=document.querySelectorAll(".header"),p=[];return t.forEach(h=>{const i=h;p.push({element:i,originalPosition:i.style.position||getComputedStyle(i).position}),i.style.position="relative"}),()=>{p.forEach(({element:h,originalPosition:i})=>{h.style.position=i==="static"?"":i})}},[]);const L=t=>{t.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})};return(0,e.jsxs)("div",{id:r,ref:v,className:(0,u.cn)("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":N==="dark"},o),children:[(0,e.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,e.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,e.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[s.map((t,p)=>(0,e.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,e.jsx)("a",{href:t.link,className:(0,u.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":p!==0,"hidden desktop:block":p===1}),children:(0,e.jsx)("span",{children:t.label})}),p!==s.length-1&&(0,e.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},t.link||p)),s.length>1&&(0,e.jsxs)(f.Root,{children:[(0,e.jsx)(f.Trigger,{asChild:!0,children:(0,e.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:(0,e.jsx)(V,{className:"text-[#1D1D1F]"})})}),(0,e.jsx)(f.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:s.slice(1).map(t=>(0,e.jsx)("a",{href:t.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,e.jsx)("span",{children:t.label})},t.link))})]})]}),(0,e.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[l?.link&&(0,e.jsx)("a",{href:l.link,target:l.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,e.jsx)(d.Text,{size:2,className:"text-nowrap",children:l.text})}),c?.link&&(0,e.jsx)(d.Button,{as:"a",href:c.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:c.text})]})]}),(0,e.jsx)("div",{className:"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]",children:y.map(t=>(0,e.jsxs)("a",{href:`#${t.id}`,className:"product-nav-anchor-link",onClick:p=>{L(p)},children:[(0,e.jsx)(d.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:t.label}),(0,e.jsx)("div",{className:(0,u.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"bg-brand-color":E===`#${t.id}`})})]},t.id))})]}),(0,e.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[l?.link&&(0,e.jsx)("a",{href:l.link,target:l.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:(0,e.jsx)(d.Text,{size:2,className:"text-nowrap",children:l.text})}),c?.link&&(0,e.jsx)(d.Button,{as:"a",href:c.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:c.text})]})]})});g.displayName="ProductNav";var G=(0,w.withLayout)(g);
2
2
  //# sourceMappingURL=ProductNav.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ProductNav/ProductNav.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, useEffect, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(({ className = '', data, id }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [hash, setHash] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u76D1\u542Chash\u53D8\u5316\n useEffect(() => {\n const handleHashChange = () => {\n setHash(window.location.hash)\n }\n handleHashChange()\n window.addEventListener('hashchange', handleHashChange)\n return () => {\n window.removeEventListener('hashchange', handleHashChange)\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent) => {\n const target = e.target as HTMLElement\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n })\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-[4px] inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]\">\n {anchorList.map(anchor => (\n <a\n key={anchor.id}\n href={`#${anchor.id}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n handleAnchorClick(e)\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n 'bg-brand-color': hash === `#${anchor.id}`,\n }\n )}\n />\n </a>\n ))}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n )\n})\n\nProductNav.displayName = 'ProductNav'\n\nexport default withLayout(ProductNav)\n"],
5
- "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IAAIA,EAAO,EAAE,GACnB,UAAU,0BACV,QAASH,GAAK,CACZD,EAAkBC,CAAC,CACrB,EAEA,oBAAC,QAAK,KAAM,EAAG,UAAU,sCACtB,SAAAG,EAAO,MACV,KACA,OAAC,OACC,aAAW,MACT,sHACA,CACE,iBAAkBR,IAAS,IAAIQ,EAAO,EAAE,EAC1C,CACF,EACF,IAjBKA,EAAO,EAkBd,CACD,EACH,GACF,KAGA,QAAC,OAAI,UAAU,8GAUZ,UAAAX,GAAU,SACT,OAAC,KACC,KAAMA,EAAS,KACf,OAAQA,EAAS,QAAU,QAC3B,UAAU,yEAEV,mBAAC,QAAK,KAAM,EAAG,UAAU,cACtB,SAAAA,EAAS,KACZ,EACF,EAEDC,GAAQ,SACP,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAO,KAAM,KAAK,KAAK,UAAU,qCACnD,SAAAA,EAAO,KACV,GAEJ,GACF,CAEJ,CAAC,EAEDR,EAAW,YAAc,aAEzB,IAAOb,KAAQ,cAAWa,CAAU",
6
- "names": ["ProductNav_exports", "__export", "ProductNav_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_useExposure", "Popover", "componentType", "componentName", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "hash", "setHash", "innerRef", "handleHashChange", "handleAnchorClick", "e", "tabLink", "index", "anchor"]
4
+ "sourcesContent": ["'use client'\nimport { useState, useEffect, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(({ className = '', data, id }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [hash, setHash] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u76D1\u542Chash\u53D8\u5316\n useEffect(() => {\n const handleHashChange = () => {\n setHash(window.location.hash)\n }\n handleHashChange()\n window.addEventListener('hashchange', handleHashChange)\n return () => {\n window.removeEventListener('hashchange', handleHashChange)\n }\n }, [])\n\n // \u8BBE\u7F6E\u9875\u9762\u4E2Dheader\u5143\u7D20\u7684position\u4E3Arelative\n useEffect(() => {\n const headerElements = document.querySelectorAll('.header')\n const originalStyles: { element: HTMLElement; originalPosition: string }[] = []\n\n headerElements.forEach(element => {\n const htmlElement = element as HTMLElement\n // \u4FDD\u5B58\u539F\u59CB\u6837\u5F0F\n originalStyles.push({\n element: htmlElement,\n originalPosition: htmlElement.style.position || getComputedStyle(htmlElement).position,\n })\n // \u8BBE\u7F6E\u4E3Arelative\n htmlElement.style.position = 'relative'\n })\n\n // \u6E05\u7406\u51FD\u6570\uFF1A\u6062\u590D\u539F\u59CB\u6837\u5F0F\n return () => {\n originalStyles.forEach(({ element, originalPosition }) => {\n element.style.position = originalPosition === 'static' ? '' : originalPosition\n })\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent) => {\n const target = e.target as HTMLElement\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n })\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]\">\n {anchorList.map(anchor => (\n <a\n key={anchor.id}\n href={`#${anchor.id}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n handleAnchorClick(e)\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n 'bg-brand-color': hash === `#${anchor.id}`,\n }\n )}\n />\n </a>\n ))}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n )\n})\n\nProductNav.displayName = 'ProductNav'\n\nexport default withLayout(ProductNav)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAeM,IAAAI,EAAA,6BAdNC,EAA6E,iBAC7EC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA6B,qCAC7BC,EAA4B,sCAE5BC,EAAyB,sCAEzB,MAAMC,EAAgB,aAChBC,EAAgB,cAEhBC,EAAmBC,MAErB,OAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,mBAAC,QACC,EAAE,wBACF,OAAO,eACP,YAAY,UACZ,cAAc,QACd,eAAe,QACjB,EACF,EAIEC,KAAa,cAA4C,CAAC,CAAE,UAAAC,EAAY,GAAI,KAAAC,EAAM,GAAAC,CAAG,EAAGC,IAAQ,CACpG,KAAM,CAAE,SAAAC,EAAW,CAAC,EAAG,WAAAC,EAAa,CAAC,EAAG,SAAAC,EAAU,OAAAC,EAAQ,MAAAC,EAAQ,OAAQ,EAAIP,GAAQ,CAAC,EACjF,CAACQ,EAAMC,CAAO,KAAI,YAAS,EAAE,EAC7BC,KAAW,UAAuB,IAAI,KAE5C,uBAAoBR,EAAK,IAAMQ,EAAS,OAAyB,KAEjE,eAAYA,EAAU,CACpB,cAAAhB,EACA,cAAAC,CACF,CAAC,KAGD,aAAU,IAAM,CACd,MAAMgB,EAAmB,IAAM,CAC7BF,EAAQ,OAAO,SAAS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AAQ,SACP,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAO,KAAM,KAAK,KAAK,UAAU,qCACnD,SAAAA,EAAO,KACV,GAEJ,GACF,CAEJ,CAAC,EAEDR,EAAW,YAAc,aAEzB,IAAOb,KAAQ,cAAWa,CAAU",
6
+ "names": ["ProductNav_exports", "__export", "ProductNav_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_useExposure", "Popover", "componentType", "componentName", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "hash", "setHash", "innerRef", "handleHashChange", "headerElements", "originalStyles", "element", "htmlElement", "originalPosition", "handleAnchorClick", "e", "tabLink", "index", "anchor"]
7
7
  }
@@ -1,8 +1,8 @@
1
- "use strict";var ae=Object.create;var H=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var ce=(e,t)=>{for(var a in t)H(e,a,{get:t[a],enumerable:!0})},oe=(e,t,a,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of ne(t))!pe.call(e,m)&&m!==a&&H(e,m,{get:()=>t[m],enumerable:!(d=ie(t,m))||d.enumerable});return e};var K=(e,t,a)=>(a=e!=null?ae(re(e)):{},oe(t||!e||!e.__esModule?H(a,"default",{value:e,enumerable:!0}):a,e)),me=e=>oe(H({},"__esModule",{value:!0}),e);var xe={};ce(xe,{ShelfDisplayHorizontalItem:()=>ue,ShelfDisplayWrapItem:()=>de,getProductImage:()=>le});module.exports=me(xe);var s=require("react/jsx-runtime"),Q=require("../AiuiProvider/index.js"),X=require("./shelfDisplay.js"),F=K(require("../../components/picture.js")),W=K(require("../../components/badge.js")),f=require("../../helpers/utils.js"),Y=require("../../components/text.js"),I=K(require("../../components/button.js")),Z=require("../../shared/track.js"),ee=require("../../shared/trackUrlRef.js"),te=require("../../components/heading.js"),se=require("../../hooks/useExposure.js"),r=require("react");const L="image",E="product_shelf",A=999999999e-2,le=e=>{const t=e?.sku,a=e?.variants,d=a?.find(k=>k?.sku===t),m=d?.image?.url||a?.[0]?.image?.url||"",w=d?.image?.altText||a?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:m,altText:w}},de=({data:e,configuration:t})=>{const{isDisplayBackImage:a=!1,itemShape:d,metafields:m,isTopTag:w=!1,isShowTag:k,isShowOriginalPrice:v}=t||{},{locale:g="us",copyWriting:$}=(0,Q.useAiuiContext)(),{discounts:P,discountsCopy:N}=m||{},j=(0,r.useRef)(null),[O,i]=(0,r.useState)([]),[B,M]=(0,r.useState)(""),R=(l,p,x,J)=>t?.event?.primaryButton?.(l,p+1,x,J),V=(l,p,x,J)=>t?.event?.secondaryButton?.(l,p+1,x,J),n=(0,r.useMemo)(()=>{const l=e?.variants||[];if(l.length)return e?.sku?l?.find?.(p=>p?.sku===e?.sku)||l[0]:l?.[0]},[e?.sku,e?.variants]),h=n?.id?.split?.("/")||[],C=h?.[h?.length-1],U=!n?.availableForSale&&(n?.price?.amount===A||n?.price===A),y=n?.coupons?.[0]||n?.coupons,D=!!(v&&y),z=e?.price?.currencyCode||"USD",T=(0,r.useMemo)(()=>(0,X.formatVariantPrice)({locale:g,amount:D?y?.variant_price4wscode:n?.price,baseAmount:D?n?.price:0,currencyCode:z}),[z,g,D,y?.variant_price4wscode,n]),{price:q,basePrice:G,discount:u}=T,{imageUrl:_,altText:S}=le(e),b=e?.custom_name||e?.title,o=e?.custom_description||e?.description;(0,r.useEffect)(()=>{let l=[];if(u){const x=`${u}${P?.off||N?.off||""}`;M(x),l.push(x)}const p=e?.tags?.filter?.(x=>x?.startsWith?.("CLtag"))?.map?.(x=>x?.replace?.("CLtag:",""))?.slice?.(0,u?1:2);i(l.concat(p))},[e?.tags,u,P?.off,N?.off]),(0,se.useExposure)(j,{componentType:L,componentName:E,componentTitle:b,componentDescription:o,position:t?.index+1});const c=()=>(0,s.jsxs)(s.Fragment,{children:[k&&O?.length>0?(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:O?.map?.((l,p)=>(0,s.jsx)(W.default,{className:"shelf-items-tag",children:l},p))}):null,b?(0,s.jsx)(te.Heading,{as:"h3",title:b||"",size:2,className:"shelf-display-product-title line-clamp-2",html:b||""}):null,o?(0,s.jsx)(Y.Text,{size:2,className:"lg-desktop:text-lg desktop:text-base shelf-display-product-description line-clamp-1 text-sm",html:o||""}):null,(0,s.jsx)("div",{className:"mb-2 mt-4 flex items-center",children:U?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:$?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:n?.availableForSale&&q||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:n?.availableForSale&&G||""})]})}),(0,s.jsxs)("div",{className:(0,f.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(I.default,{variant:"secondary",onClick:()=>V(e,t?.index,t,y),className:`
1
+ "use strict";var ae=Object.create;var H=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var ce=(e,t)=>{for(var a in t)H(e,a,{get:t[a],enumerable:!0})},oe=(e,t,a,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of ne(t))!pe.call(e,m)&&m!==a&&H(e,m,{get:()=>t[m],enumerable:!(d=ie(t,m))||d.enumerable});return e};var K=(e,t,a)=>(a=e!=null?ae(re(e)):{},oe(t||!e||!e.__esModule?H(a,"default",{value:e,enumerable:!0}):a,e)),me=e=>oe(H({},"__esModule",{value:!0}),e);var xe={};ce(xe,{ShelfDisplayHorizontalItem:()=>ue,ShelfDisplayWrapItem:()=>de,getProductImage:()=>le});module.exports=me(xe);var s=require("react/jsx-runtime"),Q=require("../AiuiProvider/index.js"),X=require("./shelfDisplay.js"),F=K(require("../../components/picture.js")),W=K(require("../../components/badge.js")),f=require("../../helpers/utils.js"),Y=require("../../components/text.js"),I=K(require("../../components/button.js")),Z=require("../../shared/track.js"),ee=require("../../shared/trackUrlRef.js"),te=require("../../components/heading.js"),se=require("../../hooks/useExposure.js"),r=require("react");const L="image",E="product_shelf",A=999999999e-2,le=e=>{const t=e?.sku,a=e?.variants,d=a?.find(k=>k?.sku===t),m=d?.image?.url||a?.[0]?.image?.url||"",w=d?.image?.altText||a?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:m,altText:w}},de=({data:e,configuration:t})=>{const{isDisplayBackImage:a=!1,itemShape:d,metafields:m,isTopTag:w=!1,isShowTag:k,isShowOriginalPrice:v}=t||{},{locale:g="us",copyWriting:$}=(0,Q.useAiuiContext)(),{discounts:P,discountsCopy:N}=m||{},j=(0,r.useRef)(null),[O,i]=(0,r.useState)([]),[B,M]=(0,r.useState)(""),R=(l,p,x,J)=>t?.event?.primaryButton?.(l,p+1,x,J),V=(l,p,x,J)=>t?.event?.secondaryButton?.(l,p+1,x,J),n=(0,r.useMemo)(()=>{const l=e?.variants||[];if(l.length)return e?.sku?l?.find?.(p=>p?.sku===e?.sku)||l[0]:l?.[0]},[e?.sku,e?.variants]),h=n?.id?.split?.("/")||[],C=h?.[h?.length-1],U=!n?.availableForSale&&(n?.price?.amount===A||n?.price===A),y=n?.coupons?.[0],D=!!(v&&y),z=e?.price?.currencyCode||"USD",T=(0,r.useMemo)(()=>(0,X.formatVariantPrice)({locale:g,amount:D?y?.variant_price4wscode:n?.price,baseAmount:D?n?.price:0,currencyCode:z}),[z,g,D,y?.variant_price4wscode,n]),{price:q,basePrice:G,discount:u}=T,{imageUrl:_,altText:S}=le(e),b=e?.custom_name||e?.title,o=e?.custom_description||e?.description;(0,r.useEffect)(()=>{let l=[];if(u){const x=`${u}${P?.off||N?.off||""}`;M(x),l.push(x)}const p=e?.tags?.filter?.(x=>x?.startsWith?.("CLtag"))?.map?.(x=>x?.replace?.("CLtag:",""))?.slice?.(0,u?1:2);i(l.concat(p))},[e?.tags,u,P?.off,N?.off]),(0,se.useExposure)(j,{componentType:L,componentName:E,componentTitle:b,componentDescription:o,position:t?.index+1});const c=()=>(0,s.jsxs)(s.Fragment,{children:[k&&O?.length>0?(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:O?.map?.((l,p)=>(0,s.jsx)(W.default,{className:"shelf-items-tag",children:l},p))}):null,b?(0,s.jsx)(te.Heading,{as:"h3",title:b||"",size:2,className:"shelf-display-product-title line-clamp-2",html:b||""}):null,o?(0,s.jsx)(Y.Text,{size:2,className:"lg-desktop:text-lg desktop:text-base shelf-display-product-description line-clamp-1 text-sm",html:o||""}):null,(0,s.jsx)("div",{className:"mb-2 mt-4 flex items-center",children:U?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:$?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:n?.availableForSale&&q||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:n?.availableForSale&&G||""})]})}),(0,s.jsxs)("div",{className:(0,f.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(I.default,{variant:"secondary",onClick:()=>V(e,t?.index,t,y),className:`
2
2
  ${t.direction==="vertical"?"w-full":""}
3
3
  `,children:t?.secondaryButton||""}):null,t?.primaryButton?(0,s.jsx)(I.default,{variant:"primary",onClick:()=>R(e,t?.index,t,y),className:`
4
4
  ${t.direction==="vertical"?"w-full":""}
5
- `,children:t?.primaryButton||""}):null]})]});return(0,s.jsx)("div",{ref:j,className:(0,f.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",d==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item"),children:a?(0,s.jsx)("div",{className:"absolute inset-0 box-border overflow-hidden",children:(0,s.jsxs)("div",{className:"relative inset-0 size-full",children:[(0,s.jsx)(F.default,{source:_,alt:S,className:"flex h-full justify-center object-cover [&_img]:w-auto"}),(0,s.jsx)("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:c()})]})}):(0,s.jsxs)("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[B&&w&&(0,s.jsx)(W.default,{className:"shelf-prices-tag absolute left-4 top-4 z-10",children:B||""}),(0,s.jsx)("div",{className:(0,f.cn)("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:(0,s.jsx)("a",{"aria-label":b,target:t?.target,href:(0,ee.trackUrlRef)(`${g==="us"||!g?"":`/${g}`}/products/${e?.handle}?variant=${C}`,`${L}_${E}`),onClick:()=>{(0,Z.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||n?.sku,item_name:e?.name,item_variant:n?.name,price:n?.price,index:t?.index+1}]}})},children:(0,s.jsx)(F.default,{source:_,alt:S,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),c()]})},e?.id||e?.handle)},ue=({data:e,configuration:t})=>{const{itemShape:a,itemLength:d,metafields:m}=t||{},{discounts:w,discountsCopy:k}=m||{},{locale:v="us",copyWriting:g}=(0,Q.useAiuiContext)(),[$,P]=(0,r.useState)([]),N=(0,r.useRef)(null),j=(o,c,l,p)=>t?.event?.primaryButton?.(o,c+1,l,p),O=(o,c,l,p)=>t?.event?.secondaryButton?.(o,c+1,l,p),i=(0,r.useMemo)(()=>{const o=e?.variants||[];if(o.length)return e?.sku&&o.find(c=>c?.sku===e?.sku)||o[0]},[e?.sku,e?.variants]),B=i?.id?.split?.("/")||[],M=B?.[B?.length-1],R=!i?.availableForSale&&(i?.price?.amount===A||i?.price===A),V=t?.isShowTag,n=t?.isShowOriginalPrice,h=i?.coupons?.[0]||i?.coupons,C=!!(n&&h),U=e?.price?.currencyCode||"USD",y=(0,r.useMemo)(()=>(0,X.formatVariantPrice)({locale:v,amount:C?h?.variant_price4wscode:i?.price,baseAmount:C?i?.price:0,currencyCode:U}),[U,v,C,h?.variant_price4wscode,i]),{price:D,basePrice:z,discount:T}=y,{imageUrl:q,altText:G}=le(e),u=e?.custom_name||e?.title,_=e?.custom_description||e?.description;(0,se.useExposure)(N,{componentType:L,componentName:E,componentTitle:u,componentDescription:_,position:t?.index+1});const S=()=>d>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},b=()=>d>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col";return(0,r.useEffect)(()=>{let o=[];if(T){const l=`${T}${w?.off||k?.off||""}`;o.push(l)}const c=e?.tags?.filter?.(l=>l?.startsWith?.("CLtag"))?.map?.(l=>l?.replace?.("CLtag:",""))?.slice?.(0,T?1:2);P(o.concat(c))},[e?.tags,T,w?.off,k?.off]),(0,s.jsx)("div",{ref:N,className:(0,f.cn)(S().wrap,a==="round"?"rounded-2xl":"rounded-none","shelf-display-item","bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden"),children:(0,s.jsxs)("div",{className:(0,f.cn)(b(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[(0,s.jsx)("div",{className:(0,f.cn)(S().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden"),children:(0,s.jsx)("a",{"aria-label":u,target:t?.target,href:(0,ee.trackUrlRef)(`${v==="us"||!v?"":`/${v}`}/products/${e?.handle}?variant=${M}`,`${L}_${E}`),onClick:()=>{(0,Z.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||i?.sku,item_name:e?.name,item_variant:i?.name,price:i?.price,index:t?.index+1}]}})},children:(0,s.jsx)(F.default,{source:q,alt:G,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),(0,s.jsxs)("div",{className:(0,f.cn)("flex flex-col items-start justify-center",S().boxItem),children:[V&&$?.length>0?(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:$?.map?.((o,c)=>(0,s.jsx)(W.default,{className:"shelf-items-tag",children:o},c))}):null,u?(0,s.jsx)(te.Heading,{as:"h3",title:u||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:u||""}):null,_?(0,s.jsx)(Y.Text,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:_||""}):null,(0,s.jsx)("div",{className:"mb-2 mt-5 flex items-center",children:R?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:g?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:i?.availableForSale&&D||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:i?.availableForSale&&z||""})]})}),(0,s.jsxs)("div",{className:(0,f.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(I.default,{variant:"secondary",onClick:()=>O(e,t?.index,t,h),className:`
5
+ `,children:t?.primaryButton||""}):null]})]});return(0,s.jsx)("div",{ref:j,className:(0,f.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",d==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item"),children:a?(0,s.jsx)("div",{className:"absolute inset-0 box-border overflow-hidden",children:(0,s.jsxs)("div",{className:"relative inset-0 size-full",children:[(0,s.jsx)(F.default,{source:_,alt:S,className:"flex h-full justify-center object-cover [&_img]:w-auto"}),(0,s.jsx)("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:c()})]})}):(0,s.jsxs)("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[B&&w&&(0,s.jsx)(W.default,{className:"shelf-prices-tag absolute left-4 top-4 z-10",children:B||""}),(0,s.jsx)("div",{className:(0,f.cn)("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:(0,s.jsx)("a",{"aria-label":b,target:t?.target,href:(0,ee.trackUrlRef)(`${g==="us"||!g?"":`/${g}`}/products/${e?.handle}?variant=${C}`,`${L}_${E}`),onClick:()=>{(0,Z.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||n?.sku,item_name:e?.name,item_variant:n?.name,price:n?.price,index:t?.index+1}]}})},children:(0,s.jsx)(F.default,{source:_,alt:S,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),c()]})},e?.id||e?.handle)},ue=({data:e,configuration:t})=>{const{itemShape:a,itemLength:d,metafields:m}=t||{},{discounts:w,discountsCopy:k}=m||{},{locale:v="us",copyWriting:g}=(0,Q.useAiuiContext)(),[$,P]=(0,r.useState)([]),N=(0,r.useRef)(null),j=(o,c,l,p)=>t?.event?.primaryButton?.(o,c+1,l,p),O=(o,c,l,p)=>t?.event?.secondaryButton?.(o,c+1,l,p),i=(0,r.useMemo)(()=>{const o=e?.variants||[];if(o.length)return e?.sku&&o.find(c=>c?.sku===e?.sku)||o[0]},[e?.sku,e?.variants]),B=i?.id?.split?.("/")||[],M=B?.[B?.length-1],R=!i?.availableForSale&&(i?.price?.amount===A||i?.price===A),V=t?.isShowTag,n=t?.isShowOriginalPrice,h=i?.coupons?.[0],C=!!(n&&h),U=e?.price?.currencyCode||"USD",y=(0,r.useMemo)(()=>(0,X.formatVariantPrice)({locale:v,amount:C?h?.variant_price4wscode:i?.price,baseAmount:C?i?.price:0,currencyCode:U}),[U,v,C,h?.variant_price4wscode,i]),{price:D,basePrice:z,discount:T}=y,{imageUrl:q,altText:G}=le(e),u=e?.custom_name||e?.title,_=e?.custom_description||e?.description;(0,se.useExposure)(N,{componentType:L,componentName:E,componentTitle:u,componentDescription:_,position:t?.index+1});const S=()=>d>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},b=()=>d>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col";return(0,r.useEffect)(()=>{let o=[];if(T){const l=`${T}${w?.off||k?.off||""}`;o.push(l)}const c=e?.tags?.filter?.(l=>l?.startsWith?.("CLtag"))?.map?.(l=>l?.replace?.("CLtag:",""))?.slice?.(0,T?1:2);P(o.concat(c))},[e?.tags,T,w?.off,k?.off]),(0,s.jsx)("div",{ref:N,className:(0,f.cn)(S().wrap,a==="round"?"rounded-2xl":"rounded-none","shelf-display-item","bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden"),children:(0,s.jsxs)("div",{className:(0,f.cn)(b(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[(0,s.jsx)("div",{className:(0,f.cn)(S().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden"),children:(0,s.jsx)("a",{"aria-label":u,target:t?.target,href:(0,ee.trackUrlRef)(`${v==="us"||!v?"":`/${v}`}/products/${e?.handle}?variant=${M}`,`${L}_${E}`),onClick:()=>{(0,Z.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||i?.sku,item_name:e?.name,item_variant:i?.name,price:i?.price,index:t?.index+1}]}})},children:(0,s.jsx)(F.default,{source:q,alt:G,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),(0,s.jsxs)("div",{className:(0,f.cn)("flex flex-col items-start justify-center",S().boxItem),children:[V&&$?.length>0?(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:$?.map?.((o,c)=>(0,s.jsx)(W.default,{className:"shelf-items-tag",children:o},c))}):null,u?(0,s.jsx)(te.Heading,{as:"h3",title:u||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:u||""}):null,_?(0,s.jsx)(Y.Text,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:_||""}):null,(0,s.jsx)("div",{className:"mb-2 mt-5 flex items-center",children:R?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:g?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:i?.availableForSale&&D||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:i?.availableForSale&&z||""})]})}),(0,s.jsxs)("div",{className:(0,f.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(I.default,{variant:"secondary",onClick:()=>O(e,t?.index,t,h),className:`
6
6
  ${t.direction==="vertical"?"w-full":""}
7
7
  `,children:t?.secondaryButton||""}):null,t?.primaryButton?(0,s.jsx)(I.default,{variant:"primary",onClick:()=>j(e,t?.index,t,h),className:`
8
8
  ${t.direction==="vertical"?"w-full":""}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplayItem.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef, useEffect, useMemo, useState } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\n// \u516C\u5171\u51FD\u6570\uFF1A\u83B7\u53D6\u4EA7\u54C1\u56FE\u7247URL\u548CaltText\nexport const getProductImage = (data: any) => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n const imageUrl = findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n const altText = findSku?.image?.altText || skuArray?.[0]?.image?.altText || data?.custom_name || data?.title || ''\n\n return {\n imageUrl,\n altText,\n }\n}\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n isDisplayBackImage = false,\n itemShape,\n metafields,\n isTopTag = false,\n isShowTag,\n isShowOriginalPrice,\n } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { discounts, discountsCopy } = metafields || {}\n const ref = useRef<HTMLDivElement>(null)\n const [showTags, setShowTags] = useState<string[]>([])\n const [currentPriceTag, setCurrentPriceTag] = useState<string>('')\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.primaryButton?.(params, index + 1, data, coupon)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data, coupon)\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants?.[0]\n }\n return variants?.find?.((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale && (variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE)\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0] || variant?.coupons\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount) {\n const discountTag = `${discount}${discounts?.off || discountsCopy?.off || ''}`\n setCurrentPriceTag(discountTag)\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discounts?.off, discountsCopy?.off])\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:text-base shelf-display-product-description line-clamp-1 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-4 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px] shelf-display-item'\n )}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n {currentPriceTag && isTopTag && (\n <Badge className=\"shelf-prices-tag absolute left-4 top-4 z-10\">{currentPriceTag || ''}</Badge>\n )}\n <div\n className={cn(\n 'lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape, itemLength, metafields } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n const [showTags, setShowTags] = useState<string[]>([])\n const ref = useRef<HTMLDivElement>(null)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.primaryButton?.(params, index + 1, data, coupon)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data, coupon)\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants[0]\n }\n return variants.find((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale && (variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE)\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0] || variant?.coupons\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const showSizeClass = (): {\n boxItem: string\n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n\n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount) {\n const discountTag = `${discount}${discounts?.off || discountsCopy?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discounts?.off, discountsCopy?.off])\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'shelf-display-item',\n 'bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden'\n )}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden')}>\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,gCAAAE,GAAA,yBAAAC,GAAA,oBAAAC,KAAA,eAAAC,GAAAL,IA4Hc,IAAAM,EAAA,6BA5HdC,EAA+B,oCAC/BC,EAAmC,6BACnCC,EAAoB,0CACpBC,EAAkB,wCAClBC,EAAmB,kCACnBC,EAAqB,oCACrB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EA,QAAC,OACC,aAAW,MACT,0BACA,2CACA9B,EAAc,YAAc,WAAa,WAAa,EACxD,EAEC,UAAAA,GAAe,mBACd,OAAC,EAAAuC,QAAA,CACC,QAAQ,YACR,QAAS,IAAMnB,EAAkB3B,EAAMO,GAAe,MAAOA,EAAemB,CAAM,EAClF,UAAW;AAAA,kBACTnB,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,gBAGvD,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,iBACd,OAAC,EAAAuC,QAAA,CACC,QAAQ,UACR,QAAS,IAAMvB,EAAgBvB,EAAMO,GAAe,MAAOA,EAAemB,CAAM,EAChF,UAAW;AAAA,gBACXnB,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,cAGrD,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GArHKP,GAAM,IAAMA,GAAM,MAsHzB,CAEJ",
4
+ "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef, useEffect, useMemo, useState } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\n// \u516C\u5171\u51FD\u6570\uFF1A\u83B7\u53D6\u4EA7\u54C1\u56FE\u7247URL\u548CaltText\nexport const getProductImage = (data: any) => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n const imageUrl = findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n const altText = findSku?.image?.altText || skuArray?.[0]?.image?.altText || data?.custom_name || data?.title || ''\n\n return {\n imageUrl,\n altText,\n }\n}\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n isDisplayBackImage = false,\n itemShape,\n metafields,\n isTopTag = false,\n isShowTag,\n isShowOriginalPrice,\n } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { discounts, discountsCopy } = metafields || {}\n const ref = useRef<HTMLDivElement>(null)\n const [showTags, setShowTags] = useState<string[]>([])\n const [currentPriceTag, setCurrentPriceTag] = useState<string>('')\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.primaryButton?.(params, index + 1, data, coupon)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data, coupon)\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants?.[0]\n }\n return variants?.find?.((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale && (variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE)\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount) {\n const discountTag = `${discount}${discounts?.off || discountsCopy?.off || ''}`\n setCurrentPriceTag(discountTag)\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discounts?.off, discountsCopy?.off])\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:text-base shelf-display-product-description line-clamp-1 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-4 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px] shelf-display-item'\n )}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n {currentPriceTag && isTopTag && (\n <Badge className=\"shelf-prices-tag absolute left-4 top-4 z-10\">{currentPriceTag || ''}</Badge>\n )}\n <div\n className={cn(\n 'lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape, itemLength, metafields } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n const [showTags, setShowTags] = useState<string[]>([])\n const ref = useRef<HTMLDivElement>(null)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.primaryButton?.(params, index + 1, data, coupon)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data, coupon)\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants[0]\n }\n return variants.find((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale && (variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE)\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const showSizeClass = (): {\n boxItem: string\n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n\n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount) {\n const discountTag = `${discount}${discounts?.off || discountsCopy?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discounts?.off, discountsCopy?.off])\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'shelf-display-item',\n 'bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden'\n )}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden')}>\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration, coupon)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\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B,GAC9B,EACE,QACJ,OAAC,OAAI,UAAU,8BACZ,SAAAR,KACC,OAAC,OAAI,UAAU,sDAAuD,SAAAjB,GAAa,YAAY,KAE/F,oBACE,oBAAC,OAAI,UAAU,kEACZ,SAAAa,GAAS,kBAAmBQ,GAAS,GACxC,KACA,OAAC,OAAI,UAAU,sFACZ,SAAAR,GAAS,kBAAmBS,GAAa,GAC5C,GACF,EAEJ,KAEA,QAAC,OACC,aAAW,MACT,0BACA,2CACA9B,EAAc,YAAc,WAAa,WAAa,EACxD,EAEC,UAAAA,GAAe,mBACd,OAAC,EAAAuC,QAAA,CACC,QAAQ,YACR,QAAS,IAAMnB,EAAkB3B,EAAMO,GAAe,MAAOA,EAAemB,CAAM,EAClF,UAAW;AAAA,kBACTnB,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,gBAGvD,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,iBACd,OAAC,EAAAuC,QAAA,CACC,QAAQ,UACR,QAAS,IAAMvB,EAAgBvB,EAAMO,GAAe,MAAOA,EAAemB,CAAM,EAChF,UAAW;AAAA,gBACXnB,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,cAGrD,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GArHKP,GAAM,IAAMA,GAAM,MAsHzB,CAEJ",
6
6
  "names": ["shelfDisplayItem_exports", "__export", "ShelfDisplayHorizontalItem", "ShelfDisplayWrapItem", "getProductImage", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_shelfDisplay", "import_picture", "import_badge", "import_utils", "import_text", "import_button", "import_track", "import_trackUrlRef", "import_heading", "import_useExposure", "import_react", "componentType", "componentName", "SOLD_OUT_PRICE", "data", "sku", "skuArray", "findSku", "item", "imageUrl", "altText", "configuration", "isDisplayBackImage", "itemShape", "metafields", "isTopTag", "isShowTag", "isShowOriginalPrice", "locale", "copyWriting", "discounts", "discountsCopy", "ref", "showTags", "setShowTags", "currentPriceTag", "setCurrentPriceTag", "onPrimaryButton", "params", "index", "coupon", "onSecondaryButton", "variant", "variants", "variantArr", "variantId", "isSoldOut", "shouldUseCouponPrice", "currencyCode", "priceInfo", "price", "basePrice", "discount", "displayTitle", "displayDescription", "handleTags", "discountTag", "newTags", "bottomContent", "Badge", "Button", "Picture", "itemLength", "showSizeClass", "handleWrapClass"]
7
7
  }
@@ -8,8 +8,8 @@ export interface ContainerProps {
8
8
  };
9
9
  }
10
10
  export interface StylesProps {
11
- /** 自定义样式字符串 */
12
- style?: string;
11
+ /** 自定义样式字符串或对象 */
12
+ style?: string | React.CSSProperties;
13
13
  /** 唯一标识符 */
14
14
  uid?: string;
15
15
  /** 是否禁用 */
@@ -1,2 +1,2 @@
1
- "use strict";var $=Object.create;var c=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var n in e)c(t,n,{get:e[n],enumerable:!0})},y=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h(e))!G.call(t,o)&&o!==n&&c(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t};var d=(t,e,n)=>(n=t!=null?$(x(t)):{},y(e||!t||!t.__esModule?c(n,"default",{value:t,enumerable:!0}):n,t)),I=t=>y(c({},"__esModule",{value:!0}),t);var W={};T(W,{getStylesProps:()=>g,useStyles:()=>C,withLayout:()=>L});module.exports=I(W);var a=require("react/jsx-runtime"),l=d(require("react")),b=require("./simpleHash.js"),p=d(require("./getKeyPropsString.js")),i=require("../components/grid.js"),P=require("../components/container.js"),S=d(require("./ErrorBoundary.js"));const B={12:"col-start-1 col-end-13",10:"col-start-2 col-end-12",8:"col-start-3 col-end-11",6:"col-start-4 col-end-10",4:"col-start-5 col-end-9"},E={12:"tablet:col-start-1 tablet:col-end-13",10:"tablet:col-start-2 tablet:col-end-12",8:"tablet:col-start-3 tablet:col-end-11",6:"tablet:col-start-4 tablet:col-end-10",4:"tablet:col-start-5 tablet:col-end-9"},u=t=>{const e=(0,p.default)(t);return`style_${(0,b.simpleHash)(e)}`},g=t=>{const{style:e,uid:n,disabled:s}=t;return{style:e,uid:n,disabled:s}},H=({style:t,uid:e=u({}),disabled:n=!1})=>!t||n?null:(0,a.jsx)("style",{suppressHydrationWarning:!0,"data-style-id":e,children:`.block-${e} { ${t} }`}),C=(t,e)=>{const n=(0,l.useMemo)(()=>t?.uid||u({...t,data:e}),[e,t]),s=(0,l.useMemo)(()=>(0,a.jsx)(H,{...t,uid:n}),[t,n]);return{className:`block-${n} `,StyleComponent:s,uid:n}},K=t=>{const{desktopSpan:e,mobileSpan:n}=t?.container||{},s=n?B[n]:"",o=e?E[e]:"";return`${s} ${o}`.trim()};function L(t,e){const n=l.default.forwardRef((s,o)=>{const f={...e,...g(s)},{className:m,StyleComponent:N}=C(f,s?.data),R=r=>(0,a.jsx)(P.Container,{className:`${m} ${r?.className}`,children:(0,a.jsx)(i.Grid,{className:"container_grid",children:(0,a.jsx)(i.GridItem,{className:K(r),children:(0,a.jsx)(t,{...r,ref:o})})})}),k=r=>(0,a.jsx)(t,{...r,className:`${m} ${r?.className}`,ref:o});return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(S.default,{children:[N,Reflect.ownKeys(s?.container||{})?.length>0?R(s):k(s)]})})});return n.displayName=t.displayName||t.name||"Component",n}
1
+ "use strict";var G=Object.create;var c=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var W=(t,e)=>{for(var n in e)c(t,n,{get:e[n],enumerable:!0})},p=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of j(e))!I.call(t,a)&&a!==n&&c(t,a,{get:()=>e[a],enumerable:!(r=K(e,a))||r.enumerable});return t};var d=(t,e,n)=>(n=t!=null?G(B(t)):{},p(e||!t||!t.__esModule?c(n,"default",{value:t,enumerable:!0}):n,t)),E=t=>p(c({},"__esModule",{value:!0}),t);var D={};W(D,{getStylesProps:()=>C,useStyles:()=>$,withLayout:()=>A});module.exports=E(D);var o=require("react/jsx-runtime"),l=d(require("react")),b=require("./simpleHash.js"),g=d(require("./getKeyPropsString.js")),i=require("../components/grid.js"),P=require("../components/container.js"),f=d(require("./ErrorBoundary.js"));const H={12:"col-start-1 col-end-13",10:"col-start-2 col-end-12",8:"col-start-3 col-end-11",6:"col-start-4 col-end-10",4:"col-start-5 col-end-9"},L={12:"tablet:col-start-1 tablet:col-end-13",10:"tablet:col-start-2 tablet:col-end-12",8:"tablet:col-start-3 tablet:col-end-11",6:"tablet:col-start-4 tablet:col-end-10",4:"tablet:col-start-5 tablet:col-end-9"},S=t=>{const e=(0,g.default)(t);return`style_${(0,b.simpleHash)(e)}`},C=t=>{const{style:e,uid:n,disabled:r}=t;return{style:e,uid:n,disabled:r}},O=({style:t,uid:e=S({}),disabled:n=!1})=>!t||n?null:(0,o.jsx)("style",{suppressHydrationWarning:!0,"data-style-id":e,children:`.block-${e} { ${t} }`}),$=(t,e)=>{const n=(0,l.useMemo)(()=>t?.uid||S({...t,data:e}),[e,t]),r=(0,l.useMemo)(()=>(0,o.jsx)(O,{...t,uid:n}),[t,n]);return{className:`block-${n} `,StyleComponent:r,uid:n}},_=t=>{const{desktopSpan:e,mobileSpan:n}=t?.container||{},r=n?H[n]:"",a=e?L[e]:"";return`${r} ${a}`.trim()};function A(t,e){const n=l.default.forwardRef((r,a)=>{const m=C(r),R=s=>s?typeof s=="string"?s:Object.entries(s).map(([x,T])=>`${x.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${T}`).join("; ")+";":"",y=[e?.style,m?.style].map(R).filter(s=>!!s).map(s=>s.trim().endsWith(";")?s:`${s};`).join(" "),N={...e,...m,...y&&{style:y}},{className:u,StyleComponent:k}=$(N,r?.data),w=s=>(0,o.jsx)(P.Container,{className:`${u} ${s?.className}`,children:(0,o.jsx)(i.Grid,{className:"container_grid",children:(0,o.jsx)(i.GridItem,{className:_(s),children:(0,o.jsx)(t,{...s,ref:a})})})}),h=s=>(0,o.jsx)(t,{...s,className:`${u} ${s?.className}`,ref:a});return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(f.default,{children:[k,Reflect.ownKeys(r?.container||{})?.length>0?w(r):h(r)]})})});return n.displayName=t.displayName||t.name||"Component",n}
2
2
  //# sourceMappingURL=Styles.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/shared/Styles.tsx"],
4
- "sourcesContent": ["import React, { useMemo } from 'react'\nimport { simpleHash } from './simpleHash.js'\nimport getKeyPropsString from './getKeyPropsString.js'\nimport { Grid, GridItem } from '../components/grid.js'\nimport { Container } from '../components/container.js'\nimport ErrorBoundary from './ErrorBoundary.js'\n\nconst colContentClasses: Record<number, string> = {\n 12: 'col-start-1 col-end-13',\n 10: 'col-start-2 col-end-12',\n 8: 'col-start-3 col-end-11',\n 6: 'col-start-4 col-end-10',\n 4: 'col-start-5 col-end-9',\n} as const\n\n// \u9884\u5B9A\u4E49\u5E26 tablet \u524D\u7F00\u7684\u7C7B\u540D\uFF0C\u786E\u4FDD Tailwind \u53EF\u4EE5\u8BC6\u522B\nconst colContentClassesTablet: Record<number, string> = {\n 12: 'tablet:col-start-1 tablet:col-end-13',\n 10: 'tablet:col-start-2 tablet:col-end-12',\n 8: 'tablet:col-start-3 tablet:col-end-11',\n 6: 'tablet:col-start-4 tablet:col-end-10',\n 4: 'tablet:col-start-5 tablet:col-end-9',\n} as const\n\nexport interface ContainerProps {\n container?: {\n /** \u684C\u9762\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n desktopSpan: number\n /** \u79FB\u52A8\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n mobileSpan: number\n }\n}\n\nexport interface StylesProps {\n /** \u81EA\u5B9A\u4E49\u6837\u5F0F\u5B57\u7B26\u4E32 */\n style?: string\n /** \u552F\u4E00\u6807\u8BC6\u7B26 */\n uid?: string\n /** \u662F\u5426\u7981\u7528 */\n disabled?: boolean\n}\n\n/**\n * \u6839\u636E props \u751F\u6210\u786E\u5B9A\u6027 uid\n */\nconst generateUID = (props: Record<string, any>) => {\n const keyString = getKeyPropsString(props)\n return `style_${simpleHash(keyString)}`\n}\n\n/**\n * \u4ECE\u7EC4\u4EF6 props \u4E2D\u63D0\u53D6\u6837\u5F0F\u76F8\u5173\u5C5E\u6027\n */\nexport const getStylesProps = <T extends Record<string, unknown>>(props: T & StylesProps): StylesProps => {\n const { style, uid, disabled } = props\n return { style, uid, disabled }\n}\n\n/**\n * \u6837\u5F0F\u6CE8\u5165\u7EC4\u4EF6\n */\nconst Styles: React.FC<StylesProps> = ({ style, uid = generateUID({}), disabled = false }) => {\n if (!style || disabled) {\n return null\n }\n\n return <style suppressHydrationWarning data-style-id={uid}>{`.block-${uid} { ${style} }`}</style>\n}\n\n/**\n * \u6837\u5F0F Hook\uFF0C\u8FD4\u56DE\u6837\u5F0F\u7C7B\u540D\u548C\u6837\u5F0F\u7EC4\u4EF6\n * @param styleProps - \u6837\u5F0F\u5C5E\u6027\n */\nexport const useStyles = (styleProps: Partial<StylesProps>, data?: Record<string, any>) => {\n const uid = useMemo(() => styleProps?.uid || generateUID({ ...styleProps, data }), [data, styleProps])\n\n const StyleComponent = useMemo(() => <Styles {...styleProps} uid={uid} />, [styleProps, uid])\n\n return {\n className: `block-${uid} `,\n StyleComponent,\n uid,\n } as const\n}\n\nconst getContainerClassName = (props?: Partial<StylesProps & ContainerProps>) => {\n const { desktopSpan, mobileSpan } = props?.container || {}\n const mobileClasses = mobileSpan ? colContentClasses[mobileSpan] : ''\n const desktopClasses = desktopSpan ? colContentClassesTablet[desktopSpan] : ''\n return `${mobileClasses} ${desktopClasses}`.trim()\n}\n\n/**\n * \u9AD8\u9636\u7EC4\u4EF6\uFF0C \u7528\u4E8E\u7ED9\u7EC4\u4EF6\u7528style \u6807\u7B7E\u7684\u5F62\u5F0F\u8FFD\u52A0\u6837\u5F0F\n * @param WrappedComponent - \u9700\u8981\u5305\u88C5\u7684\u7EC4\u4EF6\n * @param defaultLayoutProps - \u9ED8\u8BA4\u6837\u5F0F\u5C5E\u6027\n */\nexport function withLayout<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n defaultLayoutProps?: Partial<StylesProps & ContainerProps>\n) {\n const withLayout = React.forwardRef<\n any,\n Omit<P, keyof StylesProps> &\n Partial<StylesProps & ContainerProps> & { className?: string; data?: Record<string, any> }\n >((props, ref) => {\n const finalStyleProps = {\n ...defaultLayoutProps,\n ...getStylesProps(props),\n }\n\n const { className, StyleComponent } = useStyles(finalStyleProps, (props as any)?.data)\n\n const WithContainerWrapper = (props: any) => {\n return (\n <Container className={`${className} ${(props as any)?.className}`}>\n <Grid className=\"container_grid\">\n <GridItem className={getContainerClassName(props)}>\n <WrappedComponent {...(props as unknown as P)} ref={ref} />\n </GridItem>\n </Grid>\n </Container>\n )\n }\n\n const WithoutContainerWrapper = (props: any) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n className={`${className} ${(props as any)?.className}`}\n ref={ref}\n />\n )\n }\n\n return (\n <>\n <ErrorBoundary>\n {StyleComponent}\n {Reflect.ownKeys((props as any)?.container || {})?.length > 0\n ? WithContainerWrapper(props)\n : WithoutContainerWrapper(props)}\n </ErrorBoundary>\n </>\n )\n })\n\n // \u76F4\u63A5\u4F7F\u7528\u539F\u59CB\u7EC4\u4EF6\u7684\u540D\u79F0\n withLayout.displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'\n return withLayout\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,cAAAC,EAAA,eAAAC,IAAA,eAAAC,EAAAL,GAkES,IAAAM,EAAA,6BAlETC,EAA+B,oBAC/BC,EAA2B,2BAC3BC,EAA8B,qCAC9BC,EAA+B,iCAC/BC,EAA0B,sCAC1BC,EAA0B,iCAE1B,MAAMC,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ACA,MAAM5B,EAAa,EAAA6B,QAAM,WAIvB,CAACjB,EAAOkB,IAAQ,CAChB,MAAMC,EAAkB,CACtB,GAAGH,EACH,GAAG9B,EAAec,CAAK,CACzB,EAEM,CAAE,UAAAoB,EAAW,eAAAX,CAAe,EAAItB,EAAUgC,EAAkBnB,GAAe,IAAI,EAE/EqB,EAAwBrB,MAE1B,OAAC,aAAU,UAAW,GAAGoB,CAAS,IAAKpB,GAAe,SAAS,GAC7D,mBAAC,QAAK,UAAU,iBACd,mBAAC,YAAS,UAAWU,EAAsBV,CAAK,EAC9C,mBAACe,EAAA,CAAkB,GAAIf,EAAwB,IAAKkB,EAAK,EAC3D,EACF,EACF,EAIEI,EAA2BtB,MAE7B,OAACe,EAAA,CACE,GAAIf,EACL,UAAW,GAAGoB,CAAS,IAAKpB,GAAe,SAAS,GACpD,IAAKkB,EACP,EAIJ,SACE,mBACE,oBAAC,EAAAK,QAAA,CACE,UAAAd,EACA,QAAQ,QAAST,GAAe,WAAa,CAAC,CAAC,GAAG,OAAS,EACxDqB,EAAqBrB,CAAK,EAC1BsB,EAAwBtB,CAAK,GACnC,EACF,CAEJ,CAAC,EAGD,OAAAZ,EAAW,YAAc2B,EAAiB,aAAeA,EAAiB,MAAQ,YAC3E3B,CACT",
6
- "names": ["Styles_exports", "__export", "getStylesProps", "useStyles", "withLayout", "__toCommonJS", "import_jsx_runtime", "import_react", "import_simpleHash", "import_getKeyPropsString", "import_grid", "import_container", "import_ErrorBoundary", "colContentClasses", "colContentClassesTablet", "generateUID", "props", "keyString", "getKeyPropsString", "style", "uid", "disabled", "Styles", "styleProps", "data", "StyleComponent", "getContainerClassName", "desktopSpan", "mobileSpan", "mobileClasses", "desktopClasses", "WrappedComponent", "defaultLayoutProps", "React", "ref", "finalStyleProps", "className", "WithContainerWrapper", "WithoutContainerWrapper", "ErrorBoundary"]
4
+ "sourcesContent": ["import React, { useMemo } from 'react'\nimport { simpleHash } from './simpleHash.js'\nimport getKeyPropsString from './getKeyPropsString.js'\nimport { Grid, GridItem } from '../components/grid.js'\nimport { Container } from '../components/container.js'\nimport ErrorBoundary from './ErrorBoundary.js'\n\nconst colContentClasses: Record<number, string> = {\n 12: 'col-start-1 col-end-13',\n 10: 'col-start-2 col-end-12',\n 8: 'col-start-3 col-end-11',\n 6: 'col-start-4 col-end-10',\n 4: 'col-start-5 col-end-9',\n} as const\n\n// \u9884\u5B9A\u4E49\u5E26 tablet \u524D\u7F00\u7684\u7C7B\u540D\uFF0C\u786E\u4FDD Tailwind \u53EF\u4EE5\u8BC6\u522B\nconst colContentClassesTablet: Record<number, string> = {\n 12: 'tablet:col-start-1 tablet:col-end-13',\n 10: 'tablet:col-start-2 tablet:col-end-12',\n 8: 'tablet:col-start-3 tablet:col-end-11',\n 6: 'tablet:col-start-4 tablet:col-end-10',\n 4: 'tablet:col-start-5 tablet:col-end-9',\n} as const\n\nexport interface ContainerProps {\n container?: {\n /** \u684C\u9762\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n desktopSpan: number\n /** \u79FB\u52A8\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n mobileSpan: number\n }\n}\n\nexport interface StylesProps {\n /** \u81EA\u5B9A\u4E49\u6837\u5F0F\u5B57\u7B26\u4E32\u6216\u5BF9\u8C61 */\n style?: string | React.CSSProperties\n /** \u552F\u4E00\u6807\u8BC6\u7B26 */\n uid?: string\n /** \u662F\u5426\u7981\u7528 */\n disabled?: boolean\n}\n\n/**\n * \u6839\u636E props \u751F\u6210\u786E\u5B9A\u6027 uid\n */\nconst generateUID = (props: Record<string, any>) => {\n const keyString = getKeyPropsString(props)\n return `style_${simpleHash(keyString)}`\n}\n\n/**\n * \u4ECE\u7EC4\u4EF6 props \u4E2D\u63D0\u53D6\u6837\u5F0F\u76F8\u5173\u5C5E\u6027\n */\nexport const getStylesProps = <T extends Record<string, unknown>>(props: T & StylesProps): StylesProps => {\n const { style, uid, disabled } = props\n return { style, uid, disabled }\n}\n\n/**\n * \u6837\u5F0F\u6CE8\u5165\u7EC4\u4EF6\n */\nconst Styles: React.FC<StylesProps> = ({ style, uid = generateUID({}), disabled = false }) => {\n if (!style || disabled) {\n return null\n }\n\n return <style suppressHydrationWarning data-style-id={uid}>{`.block-${uid} { ${style} }`}</style>\n}\n\n/**\n * \u6837\u5F0F Hook\uFF0C\u8FD4\u56DE\u6837\u5F0F\u7C7B\u540D\u548C\u6837\u5F0F\u7EC4\u4EF6\n * @param styleProps - \u6837\u5F0F\u5C5E\u6027\n */\nexport const useStyles = (styleProps: Partial<StylesProps>, data?: Record<string, any>) => {\n const uid = useMemo(() => styleProps?.uid || generateUID({ ...styleProps, data }), [data, styleProps])\n\n const StyleComponent = useMemo(() => <Styles {...styleProps} uid={uid} />, [styleProps, uid])\n\n return {\n className: `block-${uid} `,\n StyleComponent,\n uid,\n } as const\n}\n\nconst getContainerClassName = (props?: Partial<StylesProps & ContainerProps>) => {\n const { desktopSpan, mobileSpan } = props?.container || {}\n const mobileClasses = mobileSpan ? colContentClasses[mobileSpan] : ''\n const desktopClasses = desktopSpan ? colContentClassesTablet[desktopSpan] : ''\n return `${mobileClasses} ${desktopClasses}`.trim()\n}\n\n/**\n * \u9AD8\u9636\u7EC4\u4EF6\uFF0C \u7528\u4E8E\u7ED9\u7EC4\u4EF6\u7528style \u6807\u7B7E\u7684\u5F62\u5F0F\u8FFD\u52A0\u6837\u5F0F\n * @param WrappedComponent - \u9700\u8981\u5305\u88C5\u7684\u7EC4\u4EF6\n * @param defaultLayoutProps - \u9ED8\u8BA4\u6837\u5F0F\u5C5E\u6027\n */\nexport function withLayout<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n defaultLayoutProps?: Partial<StylesProps & ContainerProps>\n) {\n const withLayout = React.forwardRef<\n any,\n Omit<P, keyof StylesProps> &\n Partial<StylesProps & ContainerProps> & { className?: string; data?: Record<string, any> }\n >((props, ref) => {\n const propsStyleProps = getStylesProps(props)\n\n // \u5C06 style \u5BF9\u8C61\u8F6C\u6362\u4E3A\u5B57\u7B26\u4E32\n const styleToString = (style: string | React.CSSProperties | undefined): string => {\n if (!style) return ''\n if (typeof style === 'string') return style\n return (\n Object.entries(style)\n .map(([key, value]) => {\n const cssKey = key.replace(/([A-Z])/g, '-$1').toLowerCase()\n return `${cssKey}: ${value}`\n })\n .join('; ') + ';'\n )\n }\n\n // \u5408\u5E76 style \u5B57\u6BB5\uFF0C\u907F\u514D\u8986\u76D6\uFF0C\u786E\u4FDD\u6BCF\u4E2A\u6837\u5F0F\u90FD\u4EE5\u5206\u53F7\u7ED3\u5C3E\n const mergedStyle = [defaultLayoutProps?.style, propsStyleProps?.style]\n .map(styleToString)\n .filter((style): style is string => Boolean(style))\n .map(style => (style.trim().endsWith(';') ? style : `${style};`))\n .join(' ')\n\n const finalStyleProps = {\n ...defaultLayoutProps,\n ...propsStyleProps,\n ...(mergedStyle && { style: mergedStyle }),\n }\n\n const { className, StyleComponent } = useStyles(finalStyleProps, (props as any)?.data)\n\n const WithContainerWrapper = (props: any) => {\n return (\n <Container className={`${className} ${(props as any)?.className}`}>\n <Grid className=\"container_grid\">\n <GridItem className={getContainerClassName(props)}>\n <WrappedComponent {...(props as unknown as P)} ref={ref} />\n </GridItem>\n </Grid>\n </Container>\n )\n }\n\n const WithoutContainerWrapper = (props: any) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n className={`${className} ${(props as any)?.className}`}\n ref={ref}\n />\n )\n }\n\n return (\n <>\n <ErrorBoundary>\n {StyleComponent}\n {Reflect.ownKeys((props as any)?.container || {})?.length > 0\n ? WithContainerWrapper(props)\n : WithoutContainerWrapper(props)}\n </ErrorBoundary>\n </>\n )\n })\n\n // \u76F4\u63A5\u4F7F\u7528\u539F\u59CB\u7EC4\u4EF6\u7684\u540D\u79F0\n withLayout.displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'\n return withLayout\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAA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ACE,UAAAnB,EACA,QAAQ,QAAST,GAAe,WAAa,CAAC,CAAC,GAAG,OAAS,EACxD0B,EAAqB1B,CAAK,EAC1B2B,EAAwB3B,CAAK,GACnC,EACF,CAEJ,CAAC,EAGD,OAAAZ,EAAW,YAAc2B,EAAiB,aAAeA,EAAiB,MAAQ,YAC3E3B,CACT",
6
+ "names": ["Styles_exports", "__export", "getStylesProps", "useStyles", "withLayout", "__toCommonJS", "import_jsx_runtime", "import_react", "import_simpleHash", "import_getKeyPropsString", "import_grid", "import_container", "import_ErrorBoundary", "colContentClasses", "colContentClassesTablet", "generateUID", "props", "keyString", "getKeyPropsString", "style", "uid", "disabled", "Styles", "styleProps", "data", "StyleComponent", "getContainerClassName", "desktopSpan", "mobileSpan", "mobileClasses", "desktopClasses", "WrappedComponent", "defaultLayoutProps", "React", "ref", "propsStyleProps", "styleToString", "key", "value", "mergedStyle", "finalStyleProps", "className", "WithContainerWrapper", "WithoutContainerWrapper", "ErrorBoundary"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as D,jsx as t,jsxs as l}from"react/jsx-runtime";import g,{useImperativeHandle as F,useRef as T}from"react";import{Heading as u,Picture as v,Text as c}from"../../components/index.js";import{cn as f}from"../../helpers/utils.js";import{withLayout as z}from"../../shared/Styles.js";import{useExposure as H}from"../../hooks/useExposure.js";import{trackUrlRef as R}from"../../shared/trackUrlRef.js";import{Swiper as $,SwiperSlide as S}from"swiper/react";const n="image",x="feature_cards",j=(a,r)=>r===2?a===0?"laptop:flex-[2]":"laptop:flex-[3]":r===3?"laptop:flex-[1]":r===4?a===0?"laptop:flex-[2]":a===1||a===2?"laptop:flex-[3]":"laptop:flex-[2]":r===5?a<3?"laptop:flex-[1]":a===3?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]",L=(a,r)=>r===4&&a===1||r===5&&a===2,b=g.forwardRef(({data:a,className:r},k)=>{const{title:i,subtitle:o,items:p=[],theme:N="light"}=a,d=T(null);H(d,{componentType:n,componentName:x,componentTitle:i,componentDescription:o}),F(k,()=>d.current);const m="rounded-box",w=(e,s)=>{const h=l(D,{children:[t(v,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),l("div",{className:"feature-cards__card-content z-10",children:[t(u,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:e.title}),t(c,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[44px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[40px] text-[14px]",children:e.subtitle})]})]}),y="feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",C=s!==void 0?j(s,p.length):"flex-1",_=f(y,m,C,{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"});return e.link?t("a",{href:R(e.link,`${n}_${x}`),className:_,"data-headless-type-name":`${n}#${x}`,"data-headless-title-desc-button":`${i}#${e.title}#${e.subtitle}`,children:h}):t("div",{className:_,children:h})};return l("section",{ref:d,"data-ui-component-id":"FeatureCards",className:f("feature-cards text-info-primary flex w-full flex-col justify-center",{"aiui-dark":N==="dark"},r),children:[l("div",{className:"feature-cards__header",children:[t(u,{size:4,as:"h1",className:"feature-cards__title laptop:text-center text-left",children:i}),o&&t(c,{size:2,as:"p",className:"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]",children:o})]}),t("div",{className:"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]",children:p.map((e,s)=>l(g.Fragment,{children:[w(e,s),L(s,p.length)&&t("div",{className:"laptop:basis-full laptop:h-0"})]},e.title))}),t("div",{className:"feature-cards__swiper-container laptop:hidden mt-[24px] w-full",children:t($,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:p.map(e=>t(S,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:l("div",{className:f("feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]",m,{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"}),children:[t(v,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),l("div",{className:"feature-cards__card-content z-10",children:[t(u,{size:3,as:"h2",className:"feature-cards__card-title",children:e.title}),t(c,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[50px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[40px] overflow-visible text-[14px]",children:e.subtitle})]})]},e.title)},e.title))})})]})});b.displayName="FeatureCards";var q=z(b);export{q as default};
1
+ "use client";import{Fragment as D,jsx as t,jsxs as l}from"react/jsx-runtime";import g,{useImperativeHandle as F,useRef as T}from"react";import{Heading as u,Picture as v,Text as c}from"../../components/index.js";import{cn as f}from"../../helpers/utils.js";import{withLayout as z}from"../../shared/Styles.js";import{useExposure as H}from"../../hooks/useExposure.js";import{trackUrlRef as R}from"../../shared/trackUrlRef.js";import{Swiper as $,SwiperSlide as S}from"swiper/react";const n="image",x="feature_cards",j=(a,r)=>r===2?a===0?"laptop:flex-[2]":"laptop:flex-[3]":r===3?"laptop:flex-[1]":r===4?a===0?"laptop:flex-[2]":a===1||a===2?"laptop:flex-[3]":"laptop:flex-[2]":r===5?a<3?"laptop:flex-[1]":a===3?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]",L=(a,r)=>r===4&&a===1||r===5&&a===2,b=g.forwardRef(({data:a,className:r},k)=>{const{title:o,subtitle:i,items:p=[],theme:N="light"}=a,d=T(null);H(d,{componentType:n,componentName:x,componentTitle:o,componentDescription:i}),F(k,()=>d.current);const m="rounded-box",w=(e,s)=>{const h=l(D,{children:[t(v,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),l("div",{className:"feature-cards__card-content z-10",children:[t(u,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:e.title}),t(c,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] text-[14px]",children:e.subtitle})]})]}),y="feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",C=s!==void 0?j(s,p.length):"flex-1",_=f(y,m,C,{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"});return e.link?t("a",{href:R(e.link,`${n}_${x}`),className:_,"data-headless-type-name":`${n}#${x}`,"data-headless-title-desc-button":`${o}#${e.title}#${e.subtitle}`,children:h}):t("div",{className:_,children:h})};return l("section",{ref:d,"data-ui-component-id":"FeatureCards",className:f("feature-cards text-info-primary flex w-full flex-col justify-center",{"aiui-dark":N==="dark"},r),children:[l("div",{className:"feature-cards__header",children:[t(u,{size:4,as:"h1",className:"feature-cards__title laptop:text-center text-left",children:o}),i&&t(c,{size:2,as:"p",className:"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]",children:i})]}),t("div",{className:"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]",children:p.map((e,s)=>l(g.Fragment,{children:[w(e,s),L(s,p.length)&&t("div",{className:"laptop:basis-full laptop:h-0"})]},e.title))}),t("div",{className:"feature-cards__swiper-container laptop:hidden mt-[24px] w-full",children:t($,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:p.map(e=>t(S,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:l("div",{className:f("feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]",m,{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"}),children:[t(v,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),l("div",{className:"feature-cards__card-content z-10",children:[t(u,{size:3,as:"h2",className:"feature-cards__card-title",children:e.title}),t(c,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] overflow-visible text-[14px]",children:e.subtitle})]})]},e.title)},e.title))})})]})});b.displayName="FeatureCards";var q=z(b);export{q as default};
2
2
  //# sourceMappingURL=FeatureCards.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/FeatureCards/FeatureCards.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { FeatureCardsProps, FeatureCardItem } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\n\nconst componentType = 'image'\nconst componentName = 'feature_cards'\n\n/**\n * \u6839\u636E\u5361\u7247\u6570\u91CF\u83B7\u53D6\u684C\u9762\u7AEF\uFF08laptop+\uFF09\u7684\u7F51\u683C\u5E03\u5C40\u7C7B\u540D\n * - 2\u5F20\u5361\u7247: 2:3\n * - 3\u5F20\u5361\u7247: 1:1:1\n * - 4\u5F20\u5361\u7247: \u7B2C\u4E00\u884C 2:3\uFF0C\u7B2C\u4E8C\u884C 3:2\n * - 5\u5F20\u5361\u7247: \u7B2C\u4E00\u884C 1:1:1\uFF0C\u7B2C\u4E8C\u884C 2:3\n */\nconst getCardLayoutClasses = (index: number, totalCards: number): string => {\n if (totalCards === 2) {\n // 2:3 \u6BD4\u4F8B\n return index === 0 ? 'laptop:flex-[2]' : 'laptop:flex-[3]'\n }\n\n if (totalCards === 3) {\n // 1:1:1 \u6BD4\u4F8B\n return 'laptop:flex-[1]'\n }\n\n if (totalCards === 4) {\n // \u7B2C\u4E00\u884C 2:3\uFF0C\u7B2C\u4E8C\u884C 3:2\n if (index === 0) return 'laptop:flex-[2]'\n if (index === 1) return 'laptop:flex-[3]'\n if (index === 2) return 'laptop:flex-[3]'\n return 'laptop:flex-[2]'\n }\n\n if (totalCards === 5) {\n // \u7B2C\u4E00\u884C 1:1:1\uFF0C\u7B2C\u4E8C\u884C 2:3\n if (index < 3) return 'laptop:flex-[1]'\n if (index === 3) return 'laptop:flex-[2]'\n return 'laptop:flex-[3]'\n }\n\n // \u9ED8\u8BA4\u7B49\u5BBD\n return 'laptop:flex-[1]'\n}\n\n/**\n * \u6839\u636E\u5361\u7247\u6570\u91CF\u786E\u5B9A\u662F\u5426\u9700\u8981\u6362\u884C\n * - 4\u5F20\u5361\u7247: \u7B2C\u4E00\u884C2\u5F20\uFF0C\u7B2C\u4E8C\u884C2\u5F20\n * - 5\u5F20\u5361\u7247: \u7B2C\u4E00\u884C3\u5F20\uFF0C\u7B2C\u4E8C\u884C2\u5F20\n */\nconst shouldBreakRow = (index: number, totalCards: number): boolean => {\n if (totalCards === 4 && index === 1) return true\n if (totalCards === 5 && index === 2) return true\n return false\n}\n\nconst FeatureCards = React.forwardRef<HTMLDivElement, FeatureCardsProps>(({ data, className }, ref) => {\n const { title, subtitle, items = [], theme = 'light' } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u7EDF\u4E00\u4F7F\u7528 rounded-box\n const roundedClasses = 'rounded-box'\n\n const renderCard = (item: FeatureCardItem, index?: number) => {\n const cardContent = (\n <>\n <Picture\n source={item.image?.url}\n alt={item.image?.alt || item.title}\n className=\"feature-cards__card-image absolute inset-0 !h-full\"\n imgClassName=\"!h-full object-cover\"\n />\n <div className=\"feature-cards__card-content z-10\">\n <Heading\n size={3}\n as=\"h2\"\n className=\"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]\"\n >\n {item.title}\n </Heading>\n <Text\n size={4}\n as=\"p\"\n className=\"feature-cards__card-subtitle laptop:h-[44px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[40px] text-[14px]\"\n >\n {item.subtitle}\n </Text>\n </div>\n </>\n )\n\n // \u57FA\u7840\u6837\u5F0F\uFF08\u79FB\u9664\u539F\u6709\u7684 rounded \u7C7B\uFF09\n const baseClasses =\n 'feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]'\n\n // \u83B7\u53D6\u54CD\u5E94\u5F0F\u5E03\u5C40\u7C7B\u540D\uFF08\u4EC5\u7528\u4E8E\u684C\u9762\u7AEF\uFF09\n const layoutClasses = index !== undefined ? getCardLayoutClasses(index, items.length) : 'flex-1'\n\n const cardClasses = cn(baseClasses, roundedClasses, layoutClasses, {\n 'aiui-dark': item.theme === 'dark',\n 'aiui-light': item.theme === 'light',\n })\n\n if (item.link) {\n return (\n <a\n href={trackUrlRef(item.link, `${componentType}_${componentName}`)}\n className={cardClasses}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${item.title}#${item.subtitle}`}\n >\n {cardContent}\n </a>\n )\n }\n\n return <div className={cardClasses}>{cardContent}</div>\n }\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"FeatureCards\"\n className={cn(\n 'feature-cards text-info-primary flex w-full flex-col justify-center',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n {/* \u6807\u9898\u533A\u57DF */}\n <div className=\"feature-cards__header\">\n <Heading size={4} as=\"h1\" className=\"feature-cards__title laptop:text-center text-left\">\n {title}\n </Heading>\n {subtitle && (\n <Text\n size={2}\n as=\"p\"\n className=\"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]\"\n >\n {subtitle}\n </Text>\n )}\n </div>\n\n {/* \u684C\u9762\u7AEF\u7F51\u683C\u5E03\u5C40 */}\n <div className=\"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]\">\n {items.map((item, index) => (\n <React.Fragment key={item.title}>\n {renderCard(item, index)}\n {/* \u5728\u7279\u5B9A\u4F4D\u7F6E\u63D2\u5165\u6362\u884C */}\n {shouldBreakRow(index, items.length) && <div className=\"laptop:basis-full laptop:h-0\" />}\n </React.Fragment>\n ))}\n </div>\n\n {/* \u79FB\u52A8\u7AEF Swiper \u5E03\u5C40 */}\n <div className=\"feature-cards__swiper-container laptop:hidden mt-[24px] w-full\">\n <Swiper\n spaceBetween={12}\n slidesPerView=\"auto\"\n grabCursor\n className=\"feature-cards__swiper relative w-full !overflow-visible\"\n >\n {items.map(item => (\n <SwiperSlide key={item.title} className=\"feature-cards__swiper-slide relative !h-[360px] !w-[296px]\">\n <div\n key={item.title}\n className={cn(\n 'feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]',\n roundedClasses,\n {\n 'aiui-dark': item.theme === 'dark',\n 'aiui-light': item.theme === 'light',\n }\n )}\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.alt || item.title}\n className=\"feature-cards__card-image absolute inset-0 !h-full\"\n imgClassName=\"!h-full object-cover\"\n />\n <div className=\"feature-cards__card-content z-10\">\n <Heading size={3} as=\"h2\" className=\"feature-cards__card-title\">\n {item.title}\n </Heading>\n <Text\n size={4}\n as=\"p\"\n className=\"feature-cards__card-subtitle laptop:h-[50px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[40px] overflow-visible text-[14px]\"\n >\n {item.subtitle}\n </Text>\n </div>\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nFeatureCards.displayName = 'FeatureCards'\n\nexport default withLayout(FeatureCards)\n"],
5
- "mappings": "aAgFM,mBAAAA,EACE,OAAAC,EAMA,QAAAC,MAPF,oBA/EN,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BACvC,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAE5B,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eAEpC,MAAMC,EAAgB,QAChBC,EAAgB,gBAShBC,EAAuB,CAACC,EAAeC,IACvCA,IAAe,EAEVD,IAAU,EAAI,kBAAoB,kBAGvCC,IAAe,EAEV,kBAGLA,IAAe,EAEbD,IAAU,EAAU,kBACpBA,IAAU,GACVA,IAAU,EAAU,kBACjB,kBAGLC,IAAe,EAEbD,EAAQ,EAAU,kBAClBA,IAAU,EAAU,kBACjB,kBAIF,kBAQHE,EAAiB,CAACF,EAAeC,IACjCA,IAAe,GAAKD,IAAU,GAC9BC,IAAe,GAAKD,IAAU,E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B,IAAOgB,EAAQ3B,EAAWW,CAAY",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { FeatureCardsProps, FeatureCardItem } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\n\nconst componentType = 'image'\nconst componentName = 'feature_cards'\n\n/**\n * \u6839\u636E\u5361\u7247\u6570\u91CF\u83B7\u53D6\u684C\u9762\u7AEF\uFF08laptop+\uFF09\u7684\u7F51\u683C\u5E03\u5C40\u7C7B\u540D\n * - 2\u5F20\u5361\u7247: 2:3\n * - 3\u5F20\u5361\u7247: 1:1:1\n * - 4\u5F20\u5361\u7247: \u7B2C\u4E00\u884C 2:3\uFF0C\u7B2C\u4E8C\u884C 3:2\n * - 5\u5F20\u5361\u7247: \u7B2C\u4E00\u884C 1:1:1\uFF0C\u7B2C\u4E8C\u884C 2:3\n */\nconst getCardLayoutClasses = (index: number, totalCards: number): string => {\n if (totalCards === 2) {\n // 2:3 \u6BD4\u4F8B\n return index === 0 ? 'laptop:flex-[2]' : 'laptop:flex-[3]'\n }\n\n if (totalCards === 3) {\n // 1:1:1 \u6BD4\u4F8B\n return 'laptop:flex-[1]'\n }\n\n if (totalCards === 4) {\n // \u7B2C\u4E00\u884C 2:3\uFF0C\u7B2C\u4E8C\u884C 3:2\n if (index === 0) return 'laptop:flex-[2]'\n if (index === 1) return 'laptop:flex-[3]'\n if (index === 2) return 'laptop:flex-[3]'\n return 'laptop:flex-[2]'\n }\n\n if (totalCards === 5) {\n // \u7B2C\u4E00\u884C 1:1:1\uFF0C\u7B2C\u4E8C\u884C 2:3\n if (index < 3) return 'laptop:flex-[1]'\n if (index === 3) return 'laptop:flex-[2]'\n return 'laptop:flex-[3]'\n }\n\n // \u9ED8\u8BA4\u7B49\u5BBD\n return 'laptop:flex-[1]'\n}\n\n/**\n * \u6839\u636E\u5361\u7247\u6570\u91CF\u786E\u5B9A\u662F\u5426\u9700\u8981\u6362\u884C\n * - 4\u5F20\u5361\u7247: \u7B2C\u4E00\u884C2\u5F20\uFF0C\u7B2C\u4E8C\u884C2\u5F20\n * - 5\u5F20\u5361\u7247: \u7B2C\u4E00\u884C3\u5F20\uFF0C\u7B2C\u4E8C\u884C2\u5F20\n */\nconst shouldBreakRow = (index: number, totalCards: number): boolean => {\n if (totalCards === 4 && index === 1) return true\n if (totalCards === 5 && index === 2) return true\n return false\n}\n\nconst FeatureCards = React.forwardRef<HTMLDivElement, FeatureCardsProps>(({ data, className }, ref) => {\n const { title, subtitle, items = [], theme = 'light' } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u7EDF\u4E00\u4F7F\u7528 rounded-box\n const roundedClasses = 'rounded-box'\n\n const renderCard = (item: FeatureCardItem, index?: number) => {\n const cardContent = (\n <>\n <Picture\n source={item.image?.url}\n alt={item.image?.alt || item.title}\n className=\"feature-cards__card-image absolute inset-0 !h-full\"\n imgClassName=\"!h-full object-cover\"\n />\n <div className=\"feature-cards__card-content z-10\">\n <Heading\n size={3}\n as=\"h2\"\n className=\"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]\"\n >\n {item.title}\n </Heading>\n <Text\n size={4}\n as=\"p\"\n className=\"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] text-[14px]\"\n >\n {item.subtitle}\n </Text>\n </div>\n </>\n )\n\n // \u57FA\u7840\u6837\u5F0F\uFF08\u79FB\u9664\u539F\u6709\u7684 rounded \u7C7B\uFF09\n const baseClasses =\n 'feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]'\n\n // \u83B7\u53D6\u54CD\u5E94\u5F0F\u5E03\u5C40\u7C7B\u540D\uFF08\u4EC5\u7528\u4E8E\u684C\u9762\u7AEF\uFF09\n const layoutClasses = index !== undefined ? getCardLayoutClasses(index, items.length) : 'flex-1'\n\n const cardClasses = cn(baseClasses, roundedClasses, layoutClasses, {\n 'aiui-dark': item.theme === 'dark',\n 'aiui-light': item.theme === 'light',\n })\n\n if (item.link) {\n return (\n <a\n href={trackUrlRef(item.link, `${componentType}_${componentName}`)}\n className={cardClasses}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${item.title}#${item.subtitle}`}\n >\n {cardContent}\n </a>\n )\n }\n\n return <div className={cardClasses}>{cardContent}</div>\n }\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"FeatureCards\"\n className={cn(\n 'feature-cards text-info-primary flex w-full flex-col justify-center',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n {/* \u6807\u9898\u533A\u57DF */}\n <div className=\"feature-cards__header\">\n <Heading size={4} as=\"h1\" className=\"feature-cards__title laptop:text-center text-left\">\n {title}\n </Heading>\n {subtitle && (\n <Text\n size={2}\n as=\"p\"\n className=\"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]\"\n >\n {subtitle}\n </Text>\n )}\n </div>\n\n {/* \u684C\u9762\u7AEF\u7F51\u683C\u5E03\u5C40 */}\n <div className=\"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]\">\n {items.map((item, index) => (\n <React.Fragment key={item.title}>\n {renderCard(item, index)}\n {/* \u5728\u7279\u5B9A\u4F4D\u7F6E\u63D2\u5165\u6362\u884C */}\n {shouldBreakRow(index, items.length) && <div className=\"laptop:basis-full laptop:h-0\" />}\n </React.Fragment>\n ))}\n </div>\n\n {/* \u79FB\u52A8\u7AEF Swiper \u5E03\u5C40 */}\n <div className=\"feature-cards__swiper-container laptop:hidden mt-[24px] w-full\">\n <Swiper\n spaceBetween={12}\n slidesPerView=\"auto\"\n grabCursor\n className=\"feature-cards__swiper relative w-full !overflow-visible\"\n >\n {items.map(item => (\n <SwiperSlide key={item.title} className=\"feature-cards__swiper-slide relative !h-[360px] !w-[296px]\">\n <div\n key={item.title}\n className={cn(\n 'feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]',\n roundedClasses,\n {\n 'aiui-dark': item.theme === 'dark',\n 'aiui-light': item.theme === 'light',\n }\n )}\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.alt || item.title}\n className=\"feature-cards__card-image absolute inset-0 !h-full\"\n imgClassName=\"!h-full object-cover\"\n />\n <div className=\"feature-cards__card-content z-10\">\n <Heading size={3} as=\"h2\" className=\"feature-cards__card-title\">\n {item.title}\n </Heading>\n <Text\n size={4}\n as=\"p\"\n className=\"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] overflow-visible text-[14px]\"\n >\n {item.subtitle}\n </Text>\n </div>\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nFeatureCards.displayName = 'FeatureCards'\n\nexport default withLayout(FeatureCards)\n"],
5
+ "mappings": "aAgFM,mBAAAA,EACE,OAAAC,EAMA,QAAAC,MAPF,oBA/EN,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BACvC,OAAS,MAAAC,MAAU,yBACnB,OAA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,EAAK,QAAU,OAC5B,aAAcA,EAAK,QAAU,OAC/B,CACF,EAEA,UAAA/B,EAACM,EAAA,CACC,OAAQyB,EAAK,OAAO,IACpB,IAAKA,EAAK,OAAO,KAAOA,EAAK,MAC7B,UAAU,qDACV,aAAa,uBACf,EACA9B,EAAC,OAAI,UAAU,mCACb,UAAAD,EAACK,EAAA,CAAQ,KAAM,EAAG,GAAG,KAAK,UAAU,4BACjC,SAAA0B,EAAK,MACR,EACA/B,EAACO,EAAA,CACC,KAAM,EACN,GAAG,IACH,UAAU,sJAET,SAAAwB,EAAK,SACR,GACF,IA3BKA,EAAK,KA4BZ,GA9BgBA,EAAK,KA+BvB,CACD,EACH,EACF,GACF,CAEJ,CAAC,EAEDX,EAAa,YAAc,eAE3B,IAAOgB,EAAQ3B,EAAWW,CAAY",
6
6
  "names": ["Fragment", "jsx", "jsxs", "React", "useImperativeHandle", "useRef", "Heading", "Picture", "Text", "cn", "withLayout", "useExposure", "trackUrlRef", "Swiper", "SwiperSlide", "componentType", "componentName", "getCardLayoutClasses", "index", "totalCards", "shouldBreakRow", "FeatureCards", "data", "className", "ref", "title", "subtitle", "items", "theme", "boxRef", "roundedClasses", "renderCard", "item", "cardContent", "baseClasses", "layoutClasses", "cardClasses", "FeatureCards_default"]
7
7
  }