@anker-in/headless-ui 1.3.21 → 1.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/components/alert.d.ts +1 -0
- package/dist/cjs/components/alert.js +1 -1
- package/dist/cjs/components/alert.js.map +2 -2
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +2 -2
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/otp-input.d.ts +18 -0
- package/dist/cjs/components/otp-input.js +2 -0
- package/dist/cjs/components/otp-input.js.map +7 -0
- package/dist/cjs/helpers/utils.d.ts +7 -1
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.js +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/components/alert.d.ts +1 -0
- package/dist/esm/components/alert.js +1 -1
- package/dist/esm/components/alert.js.map +2 -2
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +2 -2
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/otp-input.d.ts +18 -0
- package/dist/esm/components/otp-input.js +2 -0
- package/dist/esm/components/otp-input.js.map +7 -0
- package/dist/esm/helpers/utils.d.ts +7 -1
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/package.json +1 -1
- package/style.css +42 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as de,jsx as o,jsxs as b}from"react/jsx-runtime";import{useAiuiContext as ue}from"../AiuiProvider/index.js";import{formatVariantPrice as fe}from"./shelfDisplay.js";import ce from"../../components/picture.js";import pe from"../../components/badge.js";import{cn as v}from"../../helpers/utils.js";import{Text as he}from"../../components/text.js";import Z from"../../components/button.js";import{gaTrack as xe}from"../../shared/track.js";import{trackUrlRef as ye}from"../../shared/trackUrlRef.js";import{Heading as ge}from"../../components/heading.js";import{useExposure as ve}from"../../hooks/useExposure.js";import{useRef as be,useEffect as ke,useMemo as ee,useState as me}from"react";const te="image",se="product_shelf",re=999999999e-2,we=e=>{const t=e?.sku,N=e?.variants,S=N?.find($=>$?.sku===t),M=S?.image?.url||N?.[0]?.image?.url||"",j=S?.image?.altText||N?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:M,altText:j}},Fe=({data:e,configuration:t})=>{const{isDisplayBackImage:N=!1,itemShape:S,metafields:M,isTopTag:j=!1,isShowTag:$,isShowOriginalPrice:V,isShowShortTitle:oe=!1,formatPrice:D,renderOriginalPrice:O,renderPriceLabel:q,renderPrice:h}=t||{},{locale:T="es",copyWriting:ie,currencyDisplay:G}=ue(),{discounts:J,discountsCopy:W}=M||{},K=be(null),[Q,c]=me([]),[U,le]=me(""),z=(s,r,i,n)=>{const{primaryFun:m,onAddCart:d,onBuyNow:g,onLearnMore:R,event:ae}=t||{};if(m){if(m==="AddCart"&&d)return d(s,r+1,i,n);if(m==="BuyNow"&&g)return g(s,r+1,i,n);if(m==="LearnMore"&&R)return R(s,r+1,i,n)}ae?.primaryButton?.(s,r+1,i,n)},ne=(s,r,i,n)=>{const{secondaryFun:m,onAddCart:d,onBuyNow:g,onLearnMore:R,event:ae}=t||{};if(m){if(m==="AddCart"&&d)return d(s,r+1,i,n);if(m==="BuyNow"&&g)return g(s,r+1,i,n);if(m==="LearnMore"&&R)return R(s,r+1,i,n)}ae?.secondaryButton?.(s,r+1,i,n)},p=ee(()=>{const s=e?.variants||[];if(s.length)return e?.sku?s?.find?.(r=>r?.sku===e?.sku)||s[0]:s?.[0]},[e?.sku,e?.variants]),u=p?.id?.split?.("/")||[],H=u?.[u?.length-1],B=!p?.availableForSale||p?.price?.amount===re||p?.price===re,x=p?.coupons?.[0],C=!!(V&&x),P=e?.price?.currencyCode||"USD",k=ee(()=>fe({locale:T,amount:C?x?.variant_price4wscode:p?.price,baseAmount:C?p?.price:0,currencyCode:P,currencyDisplay:G,customFormatPrice:D}),[P,T,C,x?.variant_price4wscode,p,D]),{price:y,basePrice:I,discount:w,discountAmount:f}=k,{imageUrl:L,altText:A}=we(e),_=e?.custom_name||e?.title,E=oe&&p?.metafields?.infos?.page_short_title||_,X=e?.custom_description||e?.description,F=()=>{if(x?.value_type==="fixed_amount"){const s=f||"",r=s.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(r){const[,i,n,m]=r;let d=n;return n.endsWith(".00")?d=n.replace(/\.00$/,""):n.endsWith(",00")&&(d=n.replace(/,00$/,"")),`${i}${d}${m}`}return s}return w||""};ke(()=>{let s=[];if(w||f){const i=`${F()} ${J?.off||W?.off||""}`;le(i),s.push(i)}const r=e?.tags?.filter?.(i=>i?.startsWith?.("CLtag"))?.map?.(i=>i?.replace?.("CLtag:",""))?.slice?.(0,w?1:2);c(s.concat(r))},[e?.tags,w,f,J?.off,W?.off]),ve(K,{componentType:te,componentName:se,componentTitle:_,componentDescription:X,position:t?.index+1});const Y=()=>b(de,{children:[$&&Q?.length>0?o("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:Q?.map?.((s,r)=>o(pe,{className:"shelf-items-tag",variant:"fill",children:s},r))}):null,E?o(ge,{as:"h3",title:E||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12",html:E||""}):null,o(he,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm",html:X||""}),o("div",{className:"mb-2 mt-4 flex items-center",children:h?h(e,{price:y,basePrice:I,discount:w,discountAmount:f,variant:p,coupon:x,isSoldOut:B}):B?o("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:ie?.soldOutText}):b(de,{children:[o("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:p?.availableForSale&&y||""}),O?O(e,{price:y,basePrice:I,discount:w,discountAmount:f}):I&&o("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:p?.availableForSale&&I||""})]})}),!h&&q?.(e,p),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?o(Z,{disabled:B&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&ne(e,t?.index,t,x),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?o(Z,{disabled:B&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&z(e,t?.index,t,x),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]}),l=e?.custom_bg_image,a=e?.custom_theme;return o("div",{ref:K,className:v("box-border w-full cursor-pointer overflow-hidden duration-300",S==="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",l?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":a==="dark"}),style:l?{backgroundImage:`url(${l})`}:void 0,children:N?o("div",{className:"absolute inset-0 box-border overflow-hidden",children:b("div",{className:"relative inset-0 size-full",children:[o(ce,{source:L,alt:A,className:v("flex h-full justify-center object-cover [&_img]:w-auto",{"opacity-0":l})}),o("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:Y()})]})}):b("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[U&&j&&o(pe,{className:"shelf-prices-tag absolute left-4 top-4 z-10",variant:"fill",children:U||""}),o("div",{className:v("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden",{"opacity-0":l}),children:o("a",{"aria-label":_,target:t?.target,href:ye(`${T==="us"||!T?"":`/${T}`}/products/${e?.handle}?variant=${H}`,`${te}_${se}`),onClick:()=>{xe({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||p?.sku,item_name:e?.name,item_variant:p?.name,price:p?.price,index:t?.index+1}]}})},children:o(ce,{source:L,alt:A,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),Y()]})},e?.id||e?.handle)},Me=({data:e,configuration:t})=>{const{itemShape:N,itemLength:S,metafields:M,isShowShortTitle:j,formatPrice:$,renderOriginalPrice:V,renderPriceLabel:oe,renderPrice:D}=t||{},{discounts:O,discountsCopy:q}=M||{},{locale:h="us",copyWriting:T,currencyDisplay:ie}=ue(),[G,J]=me([]),W=be(null),K=(l,a,s,r)=>{const{primaryFun:i,onAddCart:n,onBuyNow:m,onLearnMore:d,event:g}=t||{};if(i){if(i==="AddCart"&&n)return n(l,a+1,s,r);if(i==="BuyNow"&&m)return m(l,a+1,s,r);if(i==="LearnMore"&&d)return d(l,a+1,s,r)}g?.primaryButton?.(l,a+1,s,r)},Q=(l,a,s,r)=>{const{secondaryFun:i,onAddCart:n,onBuyNow:m,onLearnMore:d,event:g}=t||{};if(i){if(i==="AddCart"&&n)return n(l,a+1,s,r);if(i==="BuyNow"&&m)return m(l,a+1,s,r);if(i==="LearnMore"&&d)return d(l,a+1,s,r)}g?.secondaryButton?.(l,a+1,s,r)},c=ee(()=>{const l=e?.variants||[];if(l.length)return e?.sku&&l.find(a=>a?.sku===e?.sku)||l[0]},[e?.sku,e?.variants]),U=c?.id?.split?.("/")||[],le=U?.[U?.length-1],z=!c?.availableForSale||c?.price?.amount===re||c?.price===re,ne=t?.isShowTag,p=t?.isShowOriginalPrice,u=c?.coupons?.[0],H=!!(p&&u),B=e?.price?.currencyCode||"USD",x=ee(()=>fe({locale:h,amount:H?u?.variant_price4wscode:c?.price,baseAmount:H?c?.price:0,currencyCode:B,currencyDisplay:ie,customFormatPrice:$}),[B,h,H,u?.variant_price4wscode,c,$]),{price:C,basePrice:P,discount:k,discountAmount:y}=x,{imageUrl:I,altText:w}=we(e),f=e?.custom_name||e?.title,L=j&&c?.metafields?.infos?.page_short_title||f,A=e?.custom_description||e?.description;ve(W,{componentType:te,componentName:se,componentTitle:f,componentDescription:A,position:t?.index+1});const _=()=>S>=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"},E=()=>S>=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",X=()=>{if(u?.value_type==="fixed_amount"){const l=y||"",a=l.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,s,r,i]=a;let n=r;return r.endsWith(".00")?n=r.replace(/\.00$/,""):r.endsWith(",00")&&(n=r.replace(/,00$/,"")),`${s}${n}${i}`}return l}return k||""};ke(()=>{let l=[];if(k||y){const s=`${X()} ${O?.off||q?.off||""}`;l.push(s)}const a=e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,k?1:2);J(l.concat(a))},[e?.tags,k,y,O?.off,q?.off]);const F=e?.custom_bg_image,Y=e?.custom_theme;return o("div",{ref:W,className:v(_().wrap,N==="round"?"rounded-2xl":"rounded-none","shelf-display-item","duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden",F?"bg-cover bg-center bg-no-repeat":"bg-container-secondary-1 tablet:hover:bg-info-white",{"aiui-dark":Y==="dark"}),style:F?{backgroundImage:`url(${F})`}:void 0,children:b("div",{className:v(E(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[o("div",{className:v(_().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden",{"opacity-0":F}),children:o("a",{"aria-label":f,target:t?.target,href:ye(`${h==="us"||!h?"":`/${h}`}/products/${e?.handle}?variant=${le}`,`${te}_${se}`),onClick:()=>{xe({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||c?.sku,item_name:e?.name,item_variant:c?.name,price:c?.price,index:t?.index+1}]}})},children:o(ce,{source:I,alt:w,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),b("div",{className:v("flex flex-col items-start justify-center",_().boxItem),children:[ne&&o("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:G?.length>0&&G?.map?.((l,a)=>o(pe,{className:"shelf-items-tag",variant:"fill",children:l},a))}),L?o(ge,{as:"h3",title:L||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]",html:L||""}):null,A?o(he,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm",html:A||""}):null,o("div",{className:"mb-2 mt-5 flex items-center",children:D?D(e,{price:C,basePrice:P,discount:k,discountAmount:y,variant:c,coupon:u,isSoldOut:z}):z?o("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:T?.soldOutText}):b(de,{children:[o("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:c?.availableForSale&&C||""}),V?V(e,{price:C,basePrice:P,discount:k,discountAmount:y}):P&&o("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:c?.availableForSale&&P||""})]})}),!D&&oe?.(e,c),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?o(Z,{variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&Q(e,t?.index,t,u),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?o(Z,{disabled:z,variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&K(e,t?.index,t,u),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{Me as ShelfDisplayHorizontalItem,Fe as ShelfDisplayWrapItem,we as getProductImage};
|
|
1
|
+
import{Fragment as ge,jsx as i,jsxs as b}from"react/jsx-runtime";import{useAiuiContext as ve}from"../AiuiProvider/index.js";import{formatVariantPrice as be}from"./shelfDisplay.js";import he from"../../components/picture.js";import xe from"../../components/badge.js";import{cn as v}from"../../helpers/utils.js";import{Text as ke}from"../../components/text.js";import ie from"../../components/button.js";import{gaTrack as we}from"../../shared/track.js";import{trackUrlRef as _e}from"../../shared/trackUrlRef.js";import{Heading as Se}from"../../components/heading.js";import{useExposure as Ne}from"../../hooks/useExposure.js";import{useRef as Te,useEffect as Be,useMemo as oe,useState as P}from"react";const ne="image",le="product_shelf",ae=999999999e-2,Ce=e=>{const t=e?.sku,_=e?.variants,S=_?.find(L=>L?.sku===t),W=S?.image?.url||_?.[0]?.image?.url||"",U=S?.image?.altText||_?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:W,altText:U}},ze=({data:e,configuration:t})=>{const{isDisplayBackImage:_=!1,itemShape:S,metafields:W,isTopTag:U=!1,isShowTag:L,isShowOriginalPrice:Q,isShowShortTitle:ce=!1,formatPrice:$,renderOriginalPrice:z,renderPriceLabel:X,renderPrice:y}=t||{},{locale:N="es",copyWriting:me,currencyDisplay:Y}=ve(),{discounts:Z,discountsCopy:H}=W||{},E=Te(null),[R,ee]=P([]),[V,pe]=P(""),[te,c]=P(!1),[q,se]=P(!1),D=(s,r,o,l)=>{const{primaryFun:p,onAddCart:d,onBuyNow:g,onLearnMore:K,event:ye}=t||{};if(p){if(p==="AddCart"&&d)return d(s,r+1,o,l);if(p==="BuyNow"&&g)return g(s,r+1,o,l);if(p==="LearnMore"&&K)return K(s,r+1,o,l)}ye?.primaryButton?.(s,r+1,o,l)},de=(s,r,o,l)=>{const{secondaryFun:p,onAddCart:d,onBuyNow:g,onLearnMore:K,event:ye}=t||{};if(p){if(p==="AddCart"&&d)return d(s,r+1,o,l);if(p==="BuyNow"&&g)return g(s,r+1,o,l);if(p==="LearnMore"&&K)return K(s,r+1,o,l)}ye?.secondaryButton?.(s,r+1,o,l)},m=oe(()=>{const s=e?.variants||[];if(s.length)return e?.sku?s?.find?.(r=>r?.sku===e?.sku)||s[0]:s?.[0]},[e?.sku,e?.variants]),u=m?.id?.split?.("/")||[],G=u?.[u?.length-1],T=!m?.availableForSale||m?.price?.amount===ae||m?.price===ae,h=m?.coupons?.[0],B=!!(Q&&h),C=e?.price?.currencyCode||"USD",k=oe(()=>be({locale:N,amount:B?h?.variant_price4wscode:m?.price,baseAmount:B?m?.price:0,currencyCode:C,currencyDisplay:Y,customFormatPrice:$}),[C,N,B,h?.variant_price4wscode,m,$]),{price:x,basePrice:I,discount:w,discountAmount:f}=k,{imageUrl:A,altText:F}=Ce(e),M=e?.custom_name||e?.title,J=ce&&m?.metafields?.infos?.page_short_title||M,j=e?.custom_description||e?.description,ue=()=>{if(h?.value_type==="fixed_amount"){const s=f||"",r=s.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(r){const[,o,l,p]=r;let d=l;return l.endsWith(".00")?d=l.replace(/\.00$/,""):l.endsWith(",00")&&(d=l.replace(/,00$/,"")),`${o}${d}${p}`}return s}return w||""};Be(()=>{let s=[];if(w||f){const o=`${ue()} ${Z?.off||H?.off||""}`;pe(o),s.push(o)}const r=e?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,w?1:2);ee(s.concat(r))},[e?.tags,w,f,Z?.off,H?.off]),Ne(E,{componentType:ne,componentName:le,componentTitle:M,componentDescription:j,position:t?.index+1});const fe=async()=>{if(!te&&!e?.custom_primary_link){c(!0);try{await D(e,t?.index,t,h)}finally{c(!1)}}},O=async()=>{if(!q&&!e?.custom_secondary_link){se(!0);try{await de(e,t?.index,t,h)}finally{se(!1)}}},re=()=>b(ge,{children:[L&&R?.length>0?i("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:R?.map?.((s,r)=>i(xe,{className:"shelf-items-tag",variant:"fill",children:s},r))}):null,J?i(Se,{as:"h3",title:J||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12",html:J||""}):null,i(ke,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm",html:j||""}),i("div",{className:"mb-2 mt-4 flex items-center",children:y?y(e,{price:x,basePrice:I,discount:w,discountAmount:f,variant:m,coupon:h,isSoldOut:T}):T?i("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:me?.soldOutText}):b(ge,{children:[i("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:m?.availableForSale&&x||""}),z?z(e,{price:x,basePrice:I,discount:w,discountAmount:f}):I&&i("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:m?.availableForSale&&I||""})]})}),!y&&X?.(e,m),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?i(ie,{disabled:T&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:O,loading:q,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?i(ie,{disabled:T&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:fe,loading:te,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]}),n=e?.custom_bg_image,a=e?.custom_theme;return i("div",{ref:E,className:v("box-border w-full cursor-pointer overflow-hidden duration-300",S==="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",n?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":a==="dark"}),style:n?{backgroundImage:`url(${n})`}:void 0,children:_?i("div",{className:"absolute inset-0 box-border overflow-hidden",children:b("div",{className:"relative inset-0 size-full",children:[i(he,{source:A,alt:F,className:v("flex h-full justify-center object-cover [&_img]:w-auto",{"opacity-0":n})}),i("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:re()})]})}):b("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[V&&U&&i(xe,{className:"shelf-prices-tag absolute left-4 top-4 z-10",variant:"fill",children:V||""}),i("div",{className:v("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden",{"opacity-0":n}),children:i("a",{"aria-label":M,target:t?.target,href:_e(`${N==="us"||!N?"":`/${N}`}/products/${e?.handle}?variant=${G}`,`${ne}_${le}`),onClick:()=>{we({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||m?.sku,item_name:e?.name,item_variant:m?.name,price:m?.price,index:t?.index+1}]}})},children:i(he,{source:A,alt:F,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),re()]})},e?.id||e?.handle)},He=({data:e,configuration:t})=>{const{itemShape:_,itemLength:S,metafields:W,isShowShortTitle:U,formatPrice:L,renderOriginalPrice:Q,renderPriceLabel:ce,renderPrice:$}=t||{},{discounts:z,discountsCopy:X}=W||{},{locale:y="us",copyWriting:N,currencyDisplay:me}=ve(),[Y,Z]=P([]),H=Te(null),[E,R]=P(!1),[ee,V]=P(!1),pe=(n,a,s,r)=>{const{primaryFun:o,onAddCart:l,onBuyNow:p,onLearnMore:d,event:g}=t||{};if(o){if(o==="AddCart"&&l)return l(n,a+1,s,r);if(o==="BuyNow"&&p)return p(n,a+1,s,r);if(o==="LearnMore"&&d)return d(n,a+1,s,r)}g?.primaryButton?.(n,a+1,s,r)},te=(n,a,s,r)=>{const{secondaryFun:o,onAddCart:l,onBuyNow:p,onLearnMore:d,event:g}=t||{};if(o){if(o==="AddCart"&&l)return l(n,a+1,s,r);if(o==="BuyNow"&&p)return p(n,a+1,s,r);if(o==="LearnMore"&&d)return d(n,a+1,s,r)}g?.secondaryButton?.(n,a+1,s,r)},c=oe(()=>{const n=e?.variants||[];if(n.length)return e?.sku&&n.find(a=>a?.sku===e?.sku)||n[0]},[e?.sku,e?.variants]),q=c?.id?.split?.("/")||[],se=q?.[q?.length-1],D=!c?.availableForSale||c?.price?.amount===ae||c?.price===ae,de=t?.isShowTag,m=t?.isShowOriginalPrice,u=c?.coupons?.[0],G=!!(m&&u),T=e?.price?.currencyCode||"USD",h=oe(()=>be({locale:y,amount:G?u?.variant_price4wscode:c?.price,baseAmount:G?c?.price:0,currencyCode:T,currencyDisplay:me,customFormatPrice:L}),[T,y,G,u?.variant_price4wscode,c,L]),{price:B,basePrice:C,discount:k,discountAmount:x}=h,{imageUrl:I,altText:w}=Ce(e),f=e?.custom_name||e?.title,A=U&&c?.metafields?.infos?.page_short_title||f,F=e?.custom_description||e?.description;Ne(H,{componentType:ne,componentName:le,componentTitle:f,componentDescription:F,position:t?.index+1});const M=async()=>{if(!E&&!e?.custom_primary_link){R(!0);try{await pe(e,t?.index,t,u)}finally{R(!1)}}},J=async()=>{if(!ee&&!e?.custom_secondary_link){V(!0);try{await te(e,t?.index,t,u)}finally{V(!1)}}},j=()=>S>=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"},ue=()=>S>=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",fe=()=>{if(u?.value_type==="fixed_amount"){const n=x||"",a=n.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,s,r,o]=a;let l=r;return r.endsWith(".00")?l=r.replace(/\.00$/,""):r.endsWith(",00")&&(l=r.replace(/,00$/,"")),`${s}${l}${o}`}return n}return k||""};Be(()=>{let n=[];if(k||x){const s=`${fe()} ${z?.off||X?.off||""}`;n.push(s)}const a=e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,k?1:2);Z(n.concat(a))},[e?.tags,k,x,z?.off,X?.off]);const O=e?.custom_bg_image,re=e?.custom_theme;return i("div",{ref:H,className:v(j().wrap,_==="round"?"rounded-2xl":"rounded-none","shelf-display-item","duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden",O?"bg-cover bg-center bg-no-repeat":"bg-container-secondary-1 tablet:hover:bg-info-white",{"aiui-dark":re==="dark"}),style:O?{backgroundImage:`url(${O})`}:void 0,children:b("div",{className:v(ue(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[i("div",{className:v(j().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden",{"opacity-0":O}),children:i("a",{"aria-label":f,target:t?.target,href:_e(`${y==="us"||!y?"":`/${y}`}/products/${e?.handle}?variant=${se}`,`${ne}_${le}`),onClick:()=>{we({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||c?.sku,item_name:e?.name,item_variant:c?.name,price:c?.price,index:t?.index+1}]}})},children:i(he,{source:I,alt:w,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),b("div",{className:v("flex flex-col items-start justify-center",j().boxItem),children:[de&&i("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:Y?.length>0&&Y?.map?.((n,a)=>i(xe,{className:"shelf-items-tag",variant:"fill",children:n},a))}),A?i(Se,{as:"h3",title:A||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]",html:A||""}):null,F?i(ke,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm",html:F||""}):null,i("div",{className:"mb-2 mt-5 flex items-center",children:$?$(e,{price:B,basePrice:C,discount:k,discountAmount:x,variant:c,coupon:u,isSoldOut:D}):D?i("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:N?.soldOutText}):b(ge,{children:[i("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:c?.availableForSale&&B||""}),Q?Q(e,{price:B,basePrice:C,discount:k,discountAmount:x}):C&&i("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:c?.availableForSale&&C||""})]})}),!$&&ce?.(e,c),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?i(ie,{disabled:D&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:J,loading:ee,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?i(ie,{disabled:D&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:M,loading:E,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{He as ShelfDisplayHorizontalItem,ze as ShelfDisplayWrapItem,Ce as getProductImage};
|
|
2
2
|
//# sourceMappingURL=shelfDisplayItem.js.map
|
|
@@ -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 isShowShortTitle = false,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { locale = 'es', copyWriting, currencyDisplay } = 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 const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\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 currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${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, discountAmount, 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\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm\"\n html={displayDescription || ''}\n />\n <div className=\"mb-2 mt-4 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\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-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\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 )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\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 disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_secondary_link && onSecondaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_primary_link && onPrimaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n '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 custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-background tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\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={cn('flex h-full justify-center object-cover [&_img]:w-auto', {\n 'opacity-0': custom_bg_image,\n })}\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\" variant=\"fill\">\n {currentPriceTag || ''}\n </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 { 'opacity-0': custom_bg_image }\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 {\n itemShape,\n itemLength,\n metafields,\n isShowShortTitle,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting, currencyDisplay } = 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 const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\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 currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\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 const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${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, discountAmount, discounts?.off, discountsCopy?.off])\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\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 'duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-container-secondary-1 tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div\n className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden', {\n 'opacity-0': custom_bg_image,\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 <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.length > 0 &&\n showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n )}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]\"\n html={currentDisplayTitle || ''}\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 text-info-primary line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\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-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\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 )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\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 href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_secondary_link && onSecondaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_primary_link && onPrimaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "AA2Lc,OA0BF,YAAAA,GA1BE,OAAAC,EA0BF,QAAAC,MA1BE,oBA3Ld,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,sBAAAC,OAA0B,oBACnC,OAAOC,OAAa,8BACpB,OAAOC,OAAW,4BAClB,OAAS,MAAAC,MAAU,yBACnB,OAAS,QAAAC,OAAY,2BACrB,OAAOC,MAAY,6BACnB,OAAS,WAAAC,OAAe,wBACxB,OAAS,eAAAC,OAAmB,8BAC5B,OAAS,WAAAC,OAAe,8BAExB,OAAS,eAAAC,OAAmB,6BAC5B,OAAS,UAAAC,GAAQ,aAAAC,GAAW,WAAAC,GAAS,YAAAC,OAAgB,QAErD,MAAMC,GAAgB,QAChBC,GAAgB,gBAEhBC,GAAiB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text", "Button", "gaTrack", "trackUrlRef", "Heading", "useExposure", "useRef", "useEffect", "useMemo", "useState", "componentType", "componentName", "SOLD_OUT_PRICE", "getProductImage", "data", "sku", "skuArray", "findSku", "item", "imageUrl", "altText", "ShelfDisplayWrapItem", "configuration", "isDisplayBackImage", "itemShape", "metafields", "isTopTag", "isShowTag", "isShowOriginalPrice", "isShowShortTitle", "formatPrice", "renderOriginalPrice", "renderPriceLabel", "renderPrice", "locale", "copyWriting", "currencyDisplay", "discounts", "discountsCopy", "ref", "showTags", "setShowTags", "currentPriceTag", "setCurrentPriceTag", "onPrimaryButton", "params", "index", "coupon", "primaryFun", "onAddCart", "onBuyNow", "onLearnMore", "event", "onSecondaryButton", "secondaryFun", "variant", "variants", "variantArr", "variantId", "isSoldOut", "shouldUseCouponPrice", "currencyCode", "priceInfo", "price", "basePrice", "discount", "discountAmount", "displayTitle", "currentDisplayTitle", "displayDescription", "showPrice", "amountStr", "match", "prefix", "numeric", "suffix", "updatedNumeric", "handleTags", "discountTag", "newTags", "bottomContent", "custom_bg_image", "custom_theme", "ShelfDisplayHorizontalItem", "itemLength", "showSizeClass", "handleWrapClass"]
|
|
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 isShowShortTitle = false,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { locale = 'es', copyWriting, currencyDisplay } = 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 const [primaryLoading, setPrimaryLoading] = useState(false)\n const [secondaryLoading, setSecondaryLoading] = useState(false)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\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 currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${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, discountAmount, 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 handlePrimaryClick = async () => {\n if (primaryLoading) return\n if (data?.custom_primary_link) return\n setPrimaryLoading(true)\n try {\n await onPrimaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setPrimaryLoading(false)\n }\n }\n\n const handleSecondaryClick = async () => {\n if (secondaryLoading) return\n if (data?.custom_secondary_link) return\n setSecondaryLoading(true)\n try {\n await onSecondaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setSecondaryLoading(false)\n }\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\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm\"\n html={displayDescription || ''}\n />\n <div className=\"mb-2 mt-4 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\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-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\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 )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\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 disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={handleSecondaryClick}\n loading={secondaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={handlePrimaryClick}\n loading={primaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n '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 custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-background tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\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={cn('flex h-full justify-center object-cover [&_img]:w-auto', {\n 'opacity-0': custom_bg_image,\n })}\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\" variant=\"fill\">\n {currentPriceTag || ''}\n </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 { 'opacity-0': custom_bg_image }\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 {\n itemShape,\n itemLength,\n metafields,\n isShowShortTitle,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting, currencyDisplay } = useAiuiContext()\n const [showTags, setShowTags] = useState<string[]>([])\n const ref = useRef<HTMLDivElement>(null)\n const [primaryLoading, setPrimaryLoading] = useState(false)\n const [secondaryLoading, setSecondaryLoading] = useState(false)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\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 currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\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 handlePrimaryClick = async () => {\n if (primaryLoading) return\n if (data?.custom_primary_link) return\n setPrimaryLoading(true)\n try {\n await onPrimaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setPrimaryLoading(false)\n }\n }\n\n const handleSecondaryClick = async () => {\n if (secondaryLoading) return\n if (data?.custom_secondary_link) return\n setSecondaryLoading(true)\n try {\n await onSecondaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setSecondaryLoading(false)\n }\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 const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${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, discountAmount, discounts?.off, discountsCopy?.off])\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\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 'duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-container-secondary-1 tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div\n className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden', {\n 'opacity-0': custom_bg_image,\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 <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.length > 0 &&\n showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n )}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]\"\n html={currentDisplayTitle || ''}\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 text-info-primary line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\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-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\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 )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\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 disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={handleSecondaryClick}\n loading={secondaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={handlePrimaryClick}\n loading={primaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAmNc,OA0BF,YAAAA,GA1BE,OAAAC,EA0BF,QAAAC,MA1BE,oBAnNd,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,sBAAAC,OAA0B,oBACnC,OAAOC,OAAa,8BACpB,OAAOC,OAAW,4BAClB,OAAS,MAAAC,MAAU,yBACnB,OAAS,QAAAC,OAAY,2BACrB,OAAOC,OAAY,6BACnB,OAAS,WAAAC,OAAe,wBACxB,OAAS,eAAAC,OAAmB,8BAC5B,OAAS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AI,UAAU,iEACZ,SAAAkE,GAAS,kBAAmBQ,GAAS,GACxC,EACCpC,EACGA,EAAoBjB,EAAM,CAAE,MAAAqD,EAAO,UAAAC,EAAW,SAAAC,EAAU,eAAAC,CAAe,CAAC,EACxEF,GACE3E,EAAC,OAAI,UAAU,sFACZ,SAAAkE,GAAS,kBAAmBS,GAAa,GAC5C,GAER,EAEJ,EACC,CAACnC,GAAeD,KAAmBlB,EAAM6C,CAAO,EAEjDjE,EAAC,OACC,UAAWK,EACT,0BACA,2CACAuB,EAAc,YAAc,WAAa,WAAa,EACxD,EAEC,UAAAA,GAAe,gBACd7B,EAACQ,GAAA,CACC,SAAU8D,GAAazC,GAAe,eAAiB,YACvD,QAAQ,YACR,KAAMR,GAAM,sBACZ,GAAIA,GAAM,sBAAwB,IAAM,SACxC,QAASuE,EACT,QAASvC,GACT,UAAWxB,EAAc,YAAc,WAAa,SAAW,GAE9D,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,cACd7B,EAACQ,GAAA,CACC,SAAU8D,GAAazC,GAAe,aAAe,YACrD,QAAQ,UACR,KAAMR,GAAM,oBACZ,GAAIA,GAAM,oBAAsB,IAAM,SACtC,QAASsE,EACT,QAASxC,EACT,UAAWtB,EAAc,YAAc,WAAa,SAAW,GAE9D,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GAxIKR,GAAM,IAAMA,GAAM,MAyIzB,CAEJ",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "formatVariantPrice", "Picture", "Badge", "cn", "Text", "Button", "gaTrack", "trackUrlRef", "Heading", "useExposure", "useRef", "useEffect", "useMemo", "useState", "componentType", "componentName", "SOLD_OUT_PRICE", "getProductImage", "data", "sku", "skuArray", "findSku", "item", "imageUrl", "altText", "ShelfDisplayWrapItem", "configuration", "isDisplayBackImage", "itemShape", "metafields", "isTopTag", "isShowTag", "isShowOriginalPrice", "isShowShortTitle", "formatPrice", "renderOriginalPrice", "renderPriceLabel", "renderPrice", "locale", "copyWriting", "currencyDisplay", "discounts", "discountsCopy", "ref", "showTags", "setShowTags", "currentPriceTag", "setCurrentPriceTag", "primaryLoading", "setPrimaryLoading", "secondaryLoading", "setSecondaryLoading", "onPrimaryButton", "params", "index", "coupon", "primaryFun", "onAddCart", "onBuyNow", "onLearnMore", "event", "onSecondaryButton", "secondaryFun", "variant", "variants", "variantArr", "variantId", "isSoldOut", "shouldUseCouponPrice", "currencyCode", "priceInfo", "price", "basePrice", "discount", "discountAmount", "displayTitle", "currentDisplayTitle", "displayDescription", "showPrice", "amountStr", "match", "prefix", "numeric", "suffix", "updatedNumeric", "handleTags", "discountTag", "newTags", "handlePrimaryClick", "handleSecondaryClick", "bottomContent", "custom_bg_image", "custom_theme", "ShelfDisplayHorizontalItem", "itemLength", "showSizeClass", "handleWrapClass"]
|
|
7
7
|
}
|
|
@@ -7,6 +7,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
7
7
|
*/
|
|
8
8
|
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
9
9
|
variant?: "default" | "destructive" | null | undefined;
|
|
10
|
+
status?: "error" | "success" | "warning" | "info" | null | undefined;
|
|
10
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
11
12
|
/**
|
|
12
13
|
* 状态
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as s from"react";import{cva as
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as s from"react";import{cva as w}from"class-variance-authority";import{cn as o}from"../helpers/index.js";const h=w("[&>svg:first-child]:text-foreground laptop:max-w-[824px] relative w-full max-w-[358px] items-center rounded-lg border px-4 py-3 text-sm font-bold [&>:first-child]:absolute [&>svg:first-child+div]:translate-y-[-3px] [&>svg:first-child]:left-4 [&>svg:first-child]:top-2 [&>svg:first-child~*]:pl-7",{variants:{variant:{default:"bg-container-secondary-1 text-info-primary",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg:first-child]:text-destructive"},status:{info:"bg-[#626263]",success:"bg-[#D6F4DE]",warning:"bg-[#F6EAD0]",error:"bg-[#F6DBD8]"}},defaultVariants:{variant:"default",status:"info"}}),C=()=>e("svg",{className:"close absolute right-4 top-2 size-6 cursor-pointer !pl-0",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.3452 16.4762L12.1377 13.2687L8.92973 16.4767C8.61712 16.7893 8.11029 16.7891 7.79766 16.4765C7.48505 16.1638 7.4848 15.657 7.79741 15.3444L11.0054 12.1364L7.79791 8.92891C7.48503 8.61603 7.48503 8.10946 7.79765 7.79683C8.11015 7.48433 8.61688 7.48424 8.92973 7.79709L12.1372 11.0046L15.3452 7.79658C15.6577 7.48408 16.1646 7.48421 16.4772 7.79683C16.7899 8.10946 16.79 8.61641 16.4775 8.9289L13.2695 12.1369L16.477 15.3444C16.7899 15.6572 16.7898 16.1639 16.4773 16.4764C16.1647 16.789 15.6581 16.789 15.3452 16.4762L15.3452 16.4762Z",fill:"#1D1D1F"})}),x={info:r("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"12",cy:"12",r:"10.5",fill:"#00BEFA"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1249 7.13281C13.1249 6.51149 12.6213 6.00781 11.9999 6.00781C11.3786 6.00781 10.8749 6.51149 10.8749 7.13281V13.1328C10.8749 13.7541 11.3786 14.2578 11.9999 14.2578C12.6213 14.2578 13.1249 13.7541 13.1249 13.1328V7.13281ZM13.3499 16.6342C13.3499 15.8886 12.7455 15.2842 11.9999 15.2842C11.2543 15.2842 10.6499 15.8886 10.6499 16.6342C10.6499 17.3798 11.2543 17.9842 11.9999 17.9842C12.7455 17.9842 13.3499 17.3798 13.3499 16.6342Z",fill:"white"})]}),success:r("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"12.5",cy:"12.5",r:"10.5",fill:"#30D158"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.3976 8.6772C18.0468 8.32635 17.478 8.32635 17.1271 8.6772L11.5586 14.2457L8.15843 10.8456C7.80758 10.4947 7.23874 10.4947 6.88789 10.8456C6.53704 11.1964 6.53704 11.7653 6.88789 12.1161L10.849 16.0772C10.8632 16.0914 10.8778 16.1051 10.8928 16.1182C10.9028 16.1293 10.9132 16.1402 10.9239 16.1509C11.2748 16.5018 11.8436 16.5018 12.1945 16.1509L18.3976 9.94773C18.7485 9.59688 18.7485 9.02805 18.3976 8.6772Z",fill:"white"})]}),warning:r("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"12",cy:"12",r:"10.5",fill:"#FFC24D"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1249 7.13281C13.1249 6.51149 12.6213 6.00781 11.9999 6.00781C11.3786 6.00781 10.8749 6.51149 10.8749 7.13281V13.1328C10.8749 13.7541 11.3786 14.2578 11.9999 14.2578C12.6213 14.2578 13.1249 13.7541 13.1249 13.1328V7.13281ZM13.3499 16.6342C13.3499 15.8886 12.7455 15.2842 11.9999 15.2842C11.2543 15.2842 10.6499 15.8886 10.6499 16.6342C10.6499 17.3798 11.2543 17.9842 11.9999 17.9842C12.7455 17.9842 13.3499 17.3798 13.3499 16.6342Z",fill:"white"})]}),error:r("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"12",cy:"12",r:"10.5",fill:"#FF4D4D"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1249 7.13281C13.1249 6.51149 12.6213 6.00781 11.9999 6.00781C11.3786 6.00781 10.8749 6.51149 10.8749 7.13281V13.1328C10.8749 13.7541 11.3786 14.2578 11.9999 14.2578C12.6213 14.2578 13.1249 13.7541 13.1249 13.1328V7.13281ZM13.3499 16.6342C13.3499 15.8886 12.7455 15.2842 11.9999 15.2842C11.2543 15.2842 10.6499 15.8886 10.6499 16.6342C10.6499 17.3798 11.2543 17.9842 11.9999 17.9842C12.7455 17.9842 13.3499 17.3798 13.3499 16.6342Z",fill:"white"})]})},a=s.forwardRef(({className:l,variant:i,status:t,closable:d=!1,children:f,...g},p)=>{const v=t?x[t]:null;return r("div",{ref:p,role:"alert",className:o(h({variant:i,status:t}),l),...g,children:[v,f,d&&e(C,{})]})});a.displayName="Alert";const n=s.forwardRef(({className:l,...i},t)=>e("h5",{ref:t,className:o("mb-1 font-bold leading-none tracking-tight",l),...i}));n.displayName="AlertTitle";const c=s.forwardRef(({className:l,...i},t)=>e("p",{ref:t,className:o("lg-desktop:text-[18px] desktop:text-[16px] text-[14px] leading-[140%]",l),...i}));c.displayName="AlertDescription";export{a as Alert,c as AlertDescription,n as AlertTitle};
|
|
2
2
|
//# sourceMappingURL=alert.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/alert.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\nconst alertVariants = cva(\n '[&>svg:first-child]:text-foreground relative w-full rounded-lg border px-4 py-3 text-sm [&>:first-child]:absolute [&>svg:first-child+div]:translate-y-[-3px] [&>svg:first-child]:left-4 [&>svg:first-child]:top-2 [&>svg:first-child~*]:pl-7',\n {\n variants: {\n variant: {\n default: 'bg-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\nconst alertVariants = cva(\n '[&>svg:first-child]:text-foreground laptop:max-w-[824px] relative w-full max-w-[358px] items-center rounded-lg border px-4 py-3 text-sm font-bold [&>:first-child]:absolute [&>svg:first-child+div]:translate-y-[-3px] [&>svg:first-child]:left-4 [&>svg:first-child]:top-2 [&>svg:first-child~*]:pl-7',\n {\n variants: {\n variant: {\n default: 'bg-container-secondary-1 text-info-primary',\n destructive:\n 'border-destructive/50 text-destructive dark:border-destructive [&>svg:first-child]:text-destructive',\n },\n status: {\n info: 'bg-[#626263]',\n success: 'bg-[#D6F4DE]',\n warning: 'bg-[#F6EAD0]',\n error: 'bg-[#F6DBD8]',\n },\n },\n defaultVariants: {\n variant: 'default',\n status: 'info',\n },\n }\n)\n\nconst Close = () => (\n <svg\n className=\"close absolute right-4 top-2 size-6 cursor-pointer !pl-0\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M15.3452 16.4762L12.1377 13.2687L8.92973 16.4767C8.61712 16.7893 8.11029 16.7891 7.79766 16.4765C7.48505 16.1638 7.4848 15.657 7.79741 15.3444L11.0054 12.1364L7.79791 8.92891C7.48503 8.61603 7.48503 8.10946 7.79765 7.79683C8.11015 7.48433 8.61688 7.48424 8.92973 7.79709L12.1372 11.0046L15.3452 7.79658C15.6577 7.48408 16.1646 7.48421 16.4772 7.79683C16.7899 8.10946 16.79 8.61641 16.4775 8.9289L13.2695 12.1369L16.477 15.3444C16.7899 15.6572 16.7898 16.1639 16.4773 16.4764C16.1647 16.789 15.6581 16.789 15.3452 16.4762L15.3452 16.4762Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n)\n\nconst IconMap = {\n info: (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10.5\" fill=\"#00BEFA\" />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13.1249 7.13281C13.1249 6.51149 12.6213 6.00781 11.9999 6.00781C11.3786 6.00781 10.8749 6.51149 10.8749 7.13281V13.1328C10.8749 13.7541 11.3786 14.2578 11.9999 14.2578C12.6213 14.2578 13.1249 13.7541 13.1249 13.1328V7.13281ZM13.3499 16.6342C13.3499 15.8886 12.7455 15.2842 11.9999 15.2842C11.2543 15.2842 10.6499 15.8886 10.6499 16.6342C10.6499 17.3798 11.2543 17.9842 11.9999 17.9842C12.7455 17.9842 13.3499 17.3798 13.3499 16.6342Z\"\n fill=\"white\"\n />\n </svg>\n ),\n success: (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12.5\" cy=\"12.5\" r=\"10.5\" fill=\"#30D158\" />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M18.3976 8.6772C18.0468 8.32635 17.478 8.32635 17.1271 8.6772L11.5586 14.2457L8.15843 10.8456C7.80758 10.4947 7.23874 10.4947 6.88789 10.8456C6.53704 11.1964 6.53704 11.7653 6.88789 12.1161L10.849 16.0772C10.8632 16.0914 10.8778 16.1051 10.8928 16.1182C10.9028 16.1293 10.9132 16.1402 10.9239 16.1509C11.2748 16.5018 11.8436 16.5018 12.1945 16.1509L18.3976 9.94773C18.7485 9.59688 18.7485 9.02805 18.3976 8.6772Z\"\n fill=\"white\"\n />\n </svg>\n ),\n warning: (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10.5\" fill=\"#FFC24D\" />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13.1249 7.13281C13.1249 6.51149 12.6213 6.00781 11.9999 6.00781C11.3786 6.00781 10.8749 6.51149 10.8749 7.13281V13.1328C10.8749 13.7541 11.3786 14.2578 11.9999 14.2578C12.6213 14.2578 13.1249 13.7541 13.1249 13.1328V7.13281ZM13.3499 16.6342C13.3499 15.8886 12.7455 15.2842 11.9999 15.2842C11.2543 15.2842 10.6499 15.8886 10.6499 16.6342C10.6499 17.3798 11.2543 17.9842 11.9999 17.9842C12.7455 17.9842 13.3499 17.3798 13.3499 16.6342Z\"\n fill=\"white\"\n />\n </svg>\n ),\n error: (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10.5\" fill=\"#FF4D4D\" />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13.1249 7.13281C13.1249 6.51149 12.6213 6.00781 11.9999 6.00781C11.3786 6.00781 10.8749 6.51149 10.8749 7.13281V13.1328C10.8749 13.7541 11.3786 14.2578 11.9999 14.2578C12.6213 14.2578 13.1249 13.7541 13.1249 13.1328V7.13281ZM13.3499 16.6342C13.3499 15.8886 12.7455 15.2842 11.9999 15.2842C11.2543 15.2842 10.6499 15.8886 10.6499 16.6342C10.6499 17.3798 11.2543 17.9842 11.9999 17.9842C12.7455 17.9842 13.3499 17.3798 13.3499 16.6342Z\"\n fill=\"white\"\n />\n </svg>\n ),\n}\n\n/**\n * Alert - \u8B66\u544A\u63D0\u793A\n *\n * @description \u7528\u4E8E\u663E\u793A\u91CD\u8981\u7684\u8B66\u544A\u6216\u4FE1\u606F\u63D0\u793A\uFF0C\u652F\u6301\u591A\u79CD\u72B6\u6001\u548C\u53EF\u5173\u95ED\u529F\u80FD\n */\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof alertVariants> & {\n /**\n * \u72B6\u6001\n */\n status?: 'success' | 'error' | 'warning' | 'info'\n /**\n * \u662F\u5426\u53EF\u4EE5\u5173\u95ED\n */\n closable?: boolean\n }\n>(({ className, variant, status, closable = false, children, ...props }, ref) => {\n const icon = status ? IconMap[status] : null\n\n return (\n <div ref={ref} role=\"alert\" className={cn(alertVariants({ variant, status }), className)} {...props}>\n {icon}\n {children}\n {closable && <Close />}\n </div>\n )\n})\nAlert.displayName = 'Alert'\n\nconst AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h5 ref={ref} className={cn('mb-1 font-bold leading-none tracking-tight', className)} {...props} />\n )\n)\nAlertTitle.displayName = 'AlertTitle'\n\nconst AlertDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('lg-desktop:text-[18px] desktop:text-[16px] text-[14px] leading-[140%]', className)}\n {...props}\n />\n )\n)\nAlertDescription.displayName = 'AlertDescription'\n\nexport { Alert, AlertTitle, AlertDescription }\n"],
|
|
5
|
+
"mappings": "AAoCI,cAAAA,EASA,QAAAC,MATA,oBApCJ,UAAYC,MAAW,QACvB,OAAS,OAAAC,MAA8B,2BACvC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAgBF,EACpB,ySACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,6CACT,YACE,qGACJ,EACA,OAAQ,CACN,KAAM,eACN,QAAS,eACT,QAAS,eACT,MAAO,cACT,CACF,EACA,gBAAiB,CACf,QAAS,UACT,OAAQ,MACV,CACF,CACF,EAEMG,EAAQ,IACZN,EAAC,OACC,UAAU,2DACV,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BAEN,SAAAA,EAAC,QACC,EAAE,4hBACF,KAAK,UACP,EACF,EAGIO,EAAU,CACd,KACEN,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,UAAAD,EAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,OAAO,KAAK,UAAU,EAChDA,EAAC,QACC,SAAS,UACT,SAAS,UACT,EAAE,qbACF,KAAK,QACP,GACF,EAEF,QACEC,EAAC,OAAI,MAAM,KAAK,O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c,aAEzB,MAAMC,EAAmBhB,EAAM,WAC7B,CAAC,CAAE,UAAAO,EAAW,GAAGK,CAAM,EAAGC,IACxBf,EAAC,KACC,IAAKe,EACL,UAAWX,EAAG,wEAAyEK,CAAS,EAC/F,GAAGK,EACN,CAEJ,EACAI,EAAiB,YAAc",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "cva", "cn", "alertVariants", "Close", "IconMap", "Alert", "className", "variant", "status", "closable", "children", "props", "ref", "icon", "AlertTitle", "AlertDescription"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as f from"react";import*as t from"@radix-ui/react-checkbox";import{cn as i}from"../helpers/index.js";import{cva as l}from"class-variance-authority";const b=o=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:e("path",{d:"M7.5 15.8333L1.66667 10L3.75 7.91667L7.5 11.6667L16.25 3L18.3333 5.08333L7.5 15.8333Z",fill:"currentColor"})}),d=l("border-info-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-info-primary disabled:bg-btn-primary-disabled data-[state=checked]:text-info-white peer shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"size-[14px]",base:"size-4",lg:"size-5"}},defaultVariants:{size:"base"}}),r=f.forwardRef(({className:o,size:s,iconClassName:a,...c},n)=>e(t.Root,{ref:n,className:i(d({size:s}),o),...c,children:e(t.Indicator,{className:i("flex size-full items-center justify-center text-current"),children:e(b,{width:16,height:12,className:a})})}));r.displayName="Checkbox";var h=r;export{h as default};
|
|
2
2
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/checkbox.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\n// import { CheckIcon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst CheckIcon = (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=\"M7.5 15.8333L1.66667 10L3.75 7.91667L7.5 11.6667L16.25 3L18.3333 5.08333L7.5 15.8333Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst checkboxVariants = cva(\n 'border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-
|
|
5
|
-
"mappings": "aAYM,cAAAA,MAAA,oBAVN,UAAYC,MAAW,QACvB,UAAYC,MAAuB,2BAGnC,OAAS,MAAAC,MAAU,sBACnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAaC,GAEfN,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGM,EACjG,SAAAN,EAAC,QACC,EAAE,wFACF,KAAK,eACP,EACF,EAIEO,EAAmBH,EACvB,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\n// import { CheckIcon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst CheckIcon = (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=\"M7.5 15.8333L1.66667 10L3.75 7.91667L7.5 11.6667L16.25 3L18.3333 5.08333L7.5 15.8333Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst checkboxVariants = cva(\n 'border-info-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-info-primary disabled:bg-btn-primary-disabled data-[state=checked]:text-info-white peer shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'size-[14px]',\n base: 'size-4',\n lg: 'size-5',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\ninterface CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {\n iconClassName?: string\n}\n\n/**\n * Checkbox - \u590D\u9009\u6846\n *\n * @description \u5141\u8BB8\u7528\u6237\u8FDB\u884C\u591A\u9009\u64CD\u4F5C\u7684\u590D\u9009\u6846\u7EC4\u4EF6\uFF0C\u652F\u6301\u4E0D\u540C\u5C3A\u5BF8\u548C\u81EA\u5B9A\u4E49\u56FE\u6807\n */\nconst Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, size, iconClassName, ...props }, ref) => (\n <CheckboxPrimitive.Root ref={ref} className={cn(checkboxVariants({ size }), className)} {...props}>\n <CheckboxPrimitive.Indicator className={cn('flex size-full items-center justify-center text-current')}>\n <CheckIcon width={16} height={12} className={iconClassName} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\nexport type { CheckboxProps }\n"],
|
|
5
|
+
"mappings": "aAYM,cAAAA,MAAA,oBAVN,UAAYC,MAAW,QACvB,UAAYC,MAAuB,2BAGnC,OAAS,MAAAC,MAAU,sBACnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAaC,GAEfN,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGM,EACjG,SAAAN,EAAC,QACC,EAAE,wFACF,KAAK,eACP,EACF,EAIEO,EAAmBH,EACvB,4UACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,SACN,GAAI,QACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAYMI,EAAWP,EAAM,WACrB,CAAC,CAAE,UAAAQ,EAAW,KAAAC,EAAM,cAAAC,EAAe,GAAGL,CAAM,EAAGM,IAC7CZ,EAACE,EAAkB,KAAlB,CAAuB,IAAKU,EAAK,UAAWT,EAAGI,EAAiB,CAAE,KAAAG,CAAK,CAAC,EAAGD,CAAS,EAAI,GAAGH,EAC1F,SAAAN,EAACE,EAAkB,UAAlB,CAA4B,UAAWC,EAAG,yDAAyD,EAClG,SAAAH,EAACK,EAAA,CAAU,MAAO,GAAI,OAAQ,GAAI,UAAWM,EAAe,EAC9D,EACF,CAEJ,EACAH,EAAS,YAAc,WAEvB,IAAOK,EAAQL",
|
|
6
6
|
"names": ["jsx", "React", "CheckboxPrimitive", "cn", "cva", "CheckIcon", "props", "checkboxVariants", "Checkbox", "className", "size", "iconClassName", "ref", "checkbox_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as o,jsxs as r}from"react/jsx-runtime";import*as s from"react";import*as
|
|
1
|
+
"use client";import{jsx as o,jsxs as r}from"react/jsx-runtime";import*as s from"react";import*as t from"@radix-ui/react-dialog";import{cn as l}from"../helpers/index.js";const u=e=>o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o("path",{d:"M5.63657 5.63618C6.02704 5.2456 6.66026 5.24565 7.05079 5.63618L12.0005 10.5859L16.9503 5.63618C17.3408 5.24565 17.974 5.2456 18.3645 5.63618C18.7549 6.02672 18.7549 6.65986 18.3645 7.05039L13.4147 12.0001L18.3645 16.9499C18.7549 17.3404 18.7549 17.9736 18.3645 18.3641C17.974 18.7547 17.3408 18.7546 16.9503 18.3641L12.0005 13.4144L7.05079 18.3641C6.66026 18.7546 6.02704 18.7547 5.63657 18.3641C5.24614 17.9736 5.24615 17.3404 5.63657 16.9499L10.5863 12.0001L5.63657 7.05039C5.24615 6.65986 5.24614 6.02672 5.63657 5.63618Z",fill:"#4A4C56"})}),d=t.Root;d.displayName="Dialog";const C=t.Trigger,c=t.Portal,R=t.Close,n=s.forwardRef(({className:e,...a},i)=>o(t.Overlay,{ref:i,className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000] bg-black/80",e),...a}));n.displayName=t.Overlay.displayName;const m=s.forwardRef(({className:e,children:a,overlayClassName:i,...y},v)=>r(c,{children:[o(n,{className:i}),r(t.Content,{ref:v,className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] tablet:rounded-lg fixed left-1/2 top-1/2 z-[1001] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200",e),...y,children:[a,r(t.Close,{className:"dialog-close-button ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none",children:[o(u,{className:"dialog-close-icon tablet:size-6 size-4"}),o("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=t.Content.displayName;const p=({className:e,...a})=>o("div",{className:l("tablet:text-left flex flex-col space-y-1.5 text-center",e),...a});p.displayName="DialogHeader";const g=({className:e,...a})=>o("div",{className:l("tablet:flex-row tablet:justify-end tablet:space-x-2 flex flex-col-reverse",e),...a});g.displayName="DialogFooter";const f=s.forwardRef(({className:e,...a},i)=>o(t.Title,{ref:i,className:l("text-lg font-semibold leading-none tracking-tight",e),...a}));f.displayName=t.Title.displayName;const D=s.forwardRef(({className:e,...a},i)=>o(t.Description,{ref:i,className:l("text-muted-foreground text-sm",e),...a}));D.displayName=t.Description.displayName;export{d as Dialog,R as DialogClose,m as DialogContent,D as DialogDescription,g as DialogFooter,p as DialogHeader,n as DialogOverlay,c as DialogPortal,f as DialogTitle,C as DialogTrigger};
|
|
2
2
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dialog.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "DialogPrimitive", "Cross2Icon", "
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { cn } from '../helpers/index.js'\n\nconst Cross2Icon = (props: React.ComponentPropsWithoutRef<'svg'>) => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5.63657 5.63618C6.02704 5.2456 6.66026 5.24565 7.05079 5.63618L12.0005 10.5859L16.9503 5.63618C17.3408 5.24565 17.974 5.2456 18.3645 5.63618C18.7549 6.02672 18.7549 6.65986 18.3645 7.05039L13.4147 12.0001L18.3645 16.9499C18.7549 17.3404 18.7549 17.9736 18.3645 18.3641C17.974 18.7547 17.3408 18.7546 16.9503 18.3641L12.0005 13.4144L7.05079 18.3641C6.66026 18.7546 6.02704 18.7547 5.63657 18.3641C5.24614 17.9736 5.24615 17.3404 5.63657 16.9499L10.5863 12.0001L5.63657 7.05039C5.24615 6.65986 5.24614 6.02672 5.63657 5.63618Z\"\n fill=\"#4A4C56\"\n />\n </svg>\n)\n\nconst Dialog = DialogPrimitive.Root\nDialog.displayName = 'Dialog'\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\ntype OverlayProps = DialogPrimitive.DialogOverlayProps & React.HTMLAttributes<HTMLDivElement>\n\nconst DialogOverlay = React.forwardRef<HTMLDivElement, OverlayProps>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000] bg-black/80',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n overlayClassName?: string\n }\n>(({ className, children, overlayClassName, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] tablet:rounded-lg fixed left-1/2 top-1/2 z-[1001] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"dialog-close-button ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none\">\n <Cross2Icon className=\"dialog-close-icon tablet:size-6 size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('tablet:text-left flex flex-col space-y-1.5 text-center', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('tablet:flex-row tablet:justify-end tablet:space-x-2 flex flex-col-reverse', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],
|
|
5
|
+
"mappings": "aASI,cAAAA,EA+CE,QAAAC,MA/CF,oBAPJ,UAAYC,MAAW,QACvB,UAAYC,MAAqB,yBAEjC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAcC,GAClBN,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGM,EACjG,SA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C,IAAKU,EACL,UAAWT,EAAG,oDAAqDQ,CAAS,EAC3E,GAAGN,EACN,CACD,EACDa,EAAY,YAAchB,EAAgB,MAAM,YAEhD,MAAMiB,EAAoBlB,EAAM,WAG9B,CAAC,CAAE,UAAAU,EAAW,GAAGN,CAAM,EAAGO,IAC1Bb,EAACG,EAAgB,YAAhB,CAA4B,IAAKU,EAAK,UAAWT,EAAG,gCAAiCQ,CAAS,EAAI,GAAGN,EAAO,CAC9G,EACDc,EAAkB,YAAcjB,EAAgB,YAAY",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "DialogPrimitive", "cn", "Cross2Icon", "props", "Dialog", "DialogTrigger", "DialogPortal", "DialogClose", "DialogOverlay", "className", "ref", "DialogContent", "children", "overlayClassName", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription"]
|
|
7
7
|
}
|
|
@@ -28,3 +28,4 @@ export { default as LoadingDots } from './loadingDots.js';
|
|
|
28
28
|
export { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js';
|
|
29
29
|
export { default as BrandStrip } from './brand-strip.js';
|
|
30
30
|
export { default as Progress, type ProgressProps, type ProgressClassNames } from './progress.js';
|
|
31
|
+
export { default as OtpInput, type OtpInputProps } from './otp-input.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as e}from"./button.js";import{default as
|
|
1
|
+
import{default as e}from"./button.js";import{default as p}from"./badge.js";import{Input as n,InputSlot as u}from"./input.js";import{default as d}from"./checkbox.js";import{default as i}from"./skeleton.js";import{Dialog as m,DialogPortal as D,DialogOverlay as x,DialogClose as C,DialogTrigger as g,DialogContent as w,DialogHeader as P,DialogFooter as y,DialogTitle as T,DialogDescription as I}from"./dialog.js";import{Popover as b,PopoverTrigger as c,PopoverContent as G}from"./popover.js";import{RadioGroup as S,RadioGroupItem as A}from"./radio.js";import{Text as R}from"./text.js";import{Grid as L,GridItem as h}from"./grid.js";import{Heading as F}from"./heading.js";import{Container as O}from"./container.js";import{Color as j}from"./color.js";import{Drawer as z,DrawerPortal as J,DrawerOverlay as K,DrawerTrigger as Q,DrawerClose as U,DrawerContent as V,DrawerHeader as W,DrawerFooter as X,DrawerTitle as Y,DrawerDescription as Z}from"./drawer.js";import{default as $}from"./link.js";import{Avatar as or,AvatarImage as er,AvatarFallback as tr}from"./avatar.js";import{default as ar}from"./input-number.js";import{DropdownMenu as ur,DropdownMenuTrigger as sr,DropdownMenuContent as dr,DropdownMenuItem as lr,DropdownMenuCheckboxItem as ir,DropdownMenuRadioItem as fr,DropdownMenuLabel as mr,DropdownMenuSeparator as Dr,DropdownMenuShortcut as xr,DropdownMenuGroup as Cr,DropdownMenuPortal as gr,DropdownMenuSub as wr,DropdownMenuSubContent as Pr,DropdownMenuSubTrigger as yr,DropdownMenuRadioGroup as Tr}from"./drop-down.js";import{Card as Mr,CardHeader as br,CardFooter as cr,CardTitle as Gr,CardDescription as vr,CardContent as Sr}from"./card.js";import{default as kr}from"./Countdown.js";import{Carousel as Hr,CarouselContent as Lr,CarouselItem as hr,CarouselPrevious as Br,CarouselNext as Fr}from"./carousel.js";import{Tabs as Or,TabsList as Er,TabsTrigger as jr,TabsContent as qr}from"./tabs.js";import{Alert as Jr,AlertTitle as Kr,AlertDescription as Qr}from"./alert.js";import{default as Vr}from"./picture.js";import{default as Xr}from"./theme.js";import{default as Zr}from"./board.js";import{default as $r}from"./loadingDots.js";import{ExposureDetector as oo}from"./ExposureDetector.js";import{default as to}from"./brand-strip.js";import{default as ao}from"./progress.js";import{default as uo}from"./otp-input.js";export{Jr as Alert,Qr as AlertDescription,Kr as AlertTitle,or as Avatar,tr as AvatarFallback,er as AvatarImage,p as Badge,Zr as Board,to as BrandStrip,e as Button,Mr as Card,Sr as CardContent,vr as CardDescription,cr as CardFooter,br as CardHeader,Gr as CardTitle,Hr as Carousel,Lr as CarouselContent,hr as CarouselItem,Fr as CarouselNext,Br as CarouselPrevious,d as Checkbox,j as Color,O as Container,kr as Countdown,m as Dialog,C as DialogClose,w as DialogContent,I as DialogDescription,y as DialogFooter,P as DialogHeader,x as DialogOverlay,D as DialogPortal,T as DialogTitle,g as DialogTrigger,z as Drawer,U as DrawerClose,V as DrawerContent,Z as DrawerDescription,X as DrawerFooter,W as DrawerHeader,K as DrawerOverlay,J as DrawerPortal,Y as DrawerTitle,Q as DrawerTrigger,ur as DropdownMenu,ir as DropdownMenuCheckboxItem,dr as DropdownMenuContent,Cr as DropdownMenuGroup,lr as DropdownMenuItem,mr as DropdownMenuLabel,gr as DropdownMenuPortal,Tr as DropdownMenuRadioGroup,fr as DropdownMenuRadioItem,Dr as DropdownMenuSeparator,xr as DropdownMenuShortcut,wr as DropdownMenuSub,Pr as DropdownMenuSubContent,yr as DropdownMenuSubTrigger,sr as DropdownMenuTrigger,oo as ExposureDetector,L as Grid,h as GridItem,F as Heading,n as Input,ar as InputNumber,u as InputSlot,$ as Link,$r as LoadingDots,uo as OtpInput,Vr as Picture,b as Popover,G as PopoverContent,c as PopoverTrigger,ao as Progress,S as RadioGroup,A as RadioGroupItem,i as Skeleton,Or as Tabs,qr as TabsContent,Er as TabsList,jr as TabsTrigger,R as Text,Xr as Theme};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverContent } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js'\nexport { Heading, type HeadingProps } from './heading.js'\nexport { Container, type ContainerProps } from './container.js'\nexport { Color, type ColorProps } from './color.js'\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n} from './drawer.js'\nexport { default as Link, type LinkProps } from './link.js'\nexport { Avatar, AvatarImage, AvatarFallback } from './avatar.js'\nexport { default as InputNumber, type InputNumberProps } from './input-number.js'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './drop-down.js'\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card.js'\nexport { default as Countdown, type CountdownProps } from './Countdown.js'\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n} from './carousel.js'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.js'\nexport { Alert, AlertTitle, AlertDescription } from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\nexport { default as Board } from './board.js'\nexport { default as LoadingDots } from './loadingDots.js'\nexport { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js'\nexport { default as BrandStrip } from './brand-strip.js'\nexport { default as Progress, type ProgressProps, type ProgressClassNames } from './progress.js'\n"],
|
|
5
|
-
"mappings": "AAAA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,OAAS,SAAAC,EAAO,aAAAC,MAAiB,aAEjC,OAAoB,WAAXF,MAA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,OAA0B,eACnC,OAAoB,WAAXA,OAAwB,aACjC,OAAoB,WAAXA,OAAwB,aACjC,OAAoB,WAAXA,OAA8B,mBACvC,OAAS,oBAAAsE,OAAoD,wBAC7D,OAAoB,WAAXtE,OAA6B,mBACtC,OAAoB,WAAXA,OAAwE",
|
|
4
|
+
"sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverContent } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js'\nexport { Heading, type HeadingProps } from './heading.js'\nexport { Container, type ContainerProps } from './container.js'\nexport { Color, type ColorProps } from './color.js'\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n} from './drawer.js'\nexport { default as Link, type LinkProps } from './link.js'\nexport { Avatar, AvatarImage, AvatarFallback } from './avatar.js'\nexport { default as InputNumber, type InputNumberProps } from './input-number.js'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './drop-down.js'\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card.js'\nexport { default as Countdown, type CountdownProps } from './Countdown.js'\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n} from './carousel.js'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.js'\nexport { Alert, AlertTitle, AlertDescription } from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\nexport { default as Board } from './board.js'\nexport { default as LoadingDots } from './loadingDots.js'\nexport { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js'\nexport { default as BrandStrip } from './brand-strip.js'\nexport { default as Progress, type ProgressProps, type ProgressClassNames } from './progress.js'\nexport { default as OtpInput, type OtpInputProps } from './otp-input.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,OAAS,SAAAC,EAAO,aAAAC,MAAiB,aAEjC,OAAoB,WAAXF,MAA2B,gBAEpC,OAAoB,WAAXA,MAA2B,gBACpC,OACE,UAAAG,EACA,gBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,qBAAAC,MACK,cACP,OAAS,WAAAC,EAAS,kBAAAC,EAAgB,kBAAAC,MAAsB,eACxD,OAAS,cAAAC,EAAY,kBAAAC,MAAsE,aAC3F,OAAS,QAAAC,MAA4B,YACrC,OAAS,QAAAC,EAAM,YAAAC,MAAoD,YACnE,OAAS,WAAAC,MAAkC,eAC3C,OAAS,aAAAC,MAAsC,iBAC/C,OAAS,SAAAC,MAA8B,aACvC,OACE,UAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,qBAAAC,MACK,cACP,OAAoB,WAAXjC,MAAuC,YAChD,OAAS,UAAAkC,GAAQ,eAAAC,GAAa,kBAAAC,OAAsB,cACpD,OAAoB,WAAXpC,OAAqD,oBAC9D,OACE,gBAAAqC,GACA,uBAAAC,GACA,uBAAAC,GACA,oBAAAC,GACA,4BAAAC,GACA,yBAAAC,GACA,qBAAAC,GACA,yBAAAC,GACA,wBAAAC,GACA,qBAAAC,GACA,sBAAAC,GACA,mBAAAC,GACA,0BAAAC,GACA,0BAAAC,GACA,0BAAAC,OACK,iBACP,OAAS,QAAAC,GAAM,cAAAC,GAAY,cAAAC,GAAY,aAAAC,GAAW,mBAAAC,GAAiB,eAAAC,OAAmB,YACtF,OAAoB,WAAXzD,OAAiD,iBAC1D,OAEE,YAAA0D,GACA,mBAAAC,GACA,gBAAAC,GACA,oBAAAC,GACA,gBAAAC,OACK,gBACP,OAAS,QAAAC,GAAM,YAAAC,GAAU,eAAAC,GAAa,eAAAC,OAAmB,YACzD,OAAS,SAAAC,GAAO,cAAAC,GAAY,oBAAAC,OAAwB,aACpD,OAAoB,WAAXrE,OAA0B,eACnC,OAAoB,WAAXA,OAAwB,aACjC,OAAoB,WAAXA,OAAwB,aACjC,OAAoB,WAAXA,OAA8B,mBACvC,OAAS,oBAAAsE,OAAoD,wBAC7D,OAAoB,WAAXtE,OAA6B,mBACtC,OAAoB,WAAXA,OAAwE,gBACjF,OAAoB,WAAXA,OAA+C",
|
|
6
6
|
"names": ["default", "Input", "InputSlot", "Dialog", "DialogPortal", "DialogOverlay", "DialogClose", "DialogTrigger", "DialogContent", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription", "Popover", "PopoverTrigger", "PopoverContent", "RadioGroup", "RadioGroupItem", "Text", "Grid", "GridItem", "Heading", "Container", "Color", "Drawer", "DrawerPortal", "DrawerOverlay", "DrawerTrigger", "DrawerClose", "DrawerContent", "DrawerHeader", "DrawerFooter", "DrawerTitle", "DrawerDescription", "Avatar", "AvatarImage", "AvatarFallback", "DropdownMenu", "DropdownMenuTrigger", "DropdownMenuContent", "DropdownMenuItem", "DropdownMenuCheckboxItem", "DropdownMenuRadioItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuShortcut", "DropdownMenuGroup", "DropdownMenuPortal", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuRadioGroup", "Card", "CardHeader", "CardFooter", "CardTitle", "CardDescription", "CardContent", "Carousel", "CarouselContent", "CarouselItem", "CarouselPrevious", "CarouselNext", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "Alert", "AlertTitle", "AlertDescription", "ExposureDetector"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface OtpInputProps {
|
|
3
|
+
length?: number;
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
onComplete?: (value: string) => void;
|
|
7
|
+
onFocus?: (index: number) => void;
|
|
8
|
+
onBlur?: () => void;
|
|
9
|
+
onPaste?: (text: string) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
cellClassName?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
error?: boolean;
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const OtpInput: React.ForwardRefExoticComponent<OtpInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export default OtpInput;
|