@anker-in/headless-ui 1.3.83 → 1.3.84
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/MiniCart/CircleProgress.js +2 -2
- package/dist/cjs/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/cjs/biz-components/MiniCart/index.d.ts +6 -3
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/MiniCart/CircleProgress.js +2 -2
- package/dist/esm/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/esm/biz-components/MiniCart/index.d.ts +6 -3
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/package.json +1 -1
- package/style.css +21 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
2
|
-
`),
|
|
1
|
+
"use strict";"use client";var _=Object.create;var w=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var se=(e,r)=>{for(var n in r)w(e,n,{get:r[n],enumerable:!0})},F=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of te(r))!ne.call(e,m)&&m!==n&&w(e,m,{get:()=>r[m],enumerable:!(o=ee(r,m))||o.enumerable});return e};var G=(e,r,n)=>(n=e!=null?_(re(e)):{},F(r||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e)),ie=e=>F(w({},"__esModule",{value:!0}),e);var ae={};se(ae,{default:()=>oe});module.exports=ie(ae);var t=require("react/jsx-runtime"),z=G(require("react")),D=G(require("fitty")),d=require("../../components/index.js"),s=require("../../helpers/index.js");const H=({totalSteps:e=4,currentStep:r=0,image:n,label:o,progressColor:m="var(--brand-color-0)",labelColor:O="var(--marketing-color-1)",trackColor:W="#DADCE0",backgroundColor:$="#EAEAEC",size:b=64,laptopSize:y=96,gap:N=3,centerText:S,dimmed:X=!1,dimmedBadge:P,className:Y,classNames:a})=>{const v=Math.max(b,y),k=6,c=(v-k)/2,u=v/2,q=z.useMemo(()=>{const f=(N+k)/c*(180/Math.PI),i=(360-f*e)/e,C=l=>l*Math.PI/180,J=(l,x)=>{const h=l-90,M=x-90,K=u+c*Math.cos(C(h)),Q=u+c*Math.sin(C(h)),U=u+c*Math.cos(C(M)),V=u+c*Math.sin(C(M)),Z=x-l>180?1:0;return`M ${K} ${Q} A ${c} ${c} 0 ${Z} 1 ${U} ${V}`},L=[];let I=e===2?-45:0;for(let l=0;l<e;l++){const x=I+f/2,h=x+i,M=l<r;L.push({path:J(x,h),isCompleted:M,index:l}),I=h+f/2}return L},[e,r,N,c,u]),[T,...B]=(S||"").split(`
|
|
2
|
+
`),g=B.join(" "),j=z.useRef(null),R=z.useRef(null);return z.useEffect(()=>{const p=[j.current,R.current].filter(i=>!!i);if(!p.length)return;let f=[];const A=()=>{f=p.map(i=>(0,D.default)(i,{minSize:6,maxSize:parseFloat(getComputedStyle(i).fontSize),multiLine:!1}))},E=()=>{f.forEach(i=>i.unsubscribe()),A()};return A(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E),f.forEach(i=>i.unsubscribe())}},[T,g]),(0,t.jsxs)("div",{className:(0,s.cn)("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",Y,a?.root),style:{"--circle-size":`${b}px`,"--circle-laptop-size":`${y}px`,"--circle-height":`${o?b+8:b}px`,"--circle-laptop-height":`${o?y+8:y}px`},children:[(0,t.jsxs)("div",{className:(0,s.cn)("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",a?.ring),children:[(0,t.jsxs)("svg",{viewBox:`0 0 ${v} ${v}`,className:(0,s.cn)("absolute inset-0 size-full",o?"translate-y-[-8px]":""),children:[(0,t.jsx)("circle",{cx:u,cy:u,r:c,fill:$,stroke:"none"}),q.map(p=>(0,t.jsx)("path",{d:p.path,className:(0,s.cn)("mini-cart-progress-segment",p.isCompleted&&"mini-cart-progress-segment-completed"),fill:"none",stroke:p.isCompleted?m:W,strokeWidth:k,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},p.index))]}),(0,t.jsx)("div",{className:(0,s.cn)("absolute inset-[10px] flex items-center justify-center",o?"translate-y-[-8px]":"",a?.inner),children:(0,t.jsxs)("div",{className:(0,s.cn)("flex size-full items-center justify-center overflow-hidden rounded-full",P&&"relative"),style:{backgroundColor:$},children:[n?.url&&(0,t.jsx)(d.Picture,{className:(0,s.cn)("size-full",X&&"opacity-40 grayscale",a?.image),imgClassName:"h-full object-contain",source:n.url,alt:n.alt||""}),!n?.url&&S&&(0,t.jsxs)("div",{className:(0,s.cn)("text-info-primary flex w-4/5 flex-col items-center justify-center text-center",g?"gap-0.5":"",a?.centerText),children:[(0,t.jsx)(d.Text,{ref:j,className:(0,s.cn)("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",g&&"font-bold",a?.centerTextMain),html:T}),g&&(0,t.jsx)(d.Text,{ref:R,className:(0,s.cn)("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",a?.centerTextSub),html:g})]}),P&&(0,t.jsx)("span",{className:(0,s.cn)("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",a?.badge),children:(0,t.jsx)(d.Text,{size:1,className:"text-center text-white",html:P})})]})})]}),o&&(0,t.jsx)("div",{className:(0,s.cn)("mini-cart-progress-label absolute bottom-2 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",a?.label),style:{backgroundColor:O},children:(0,t.jsx)(d.Text,{className:"mini-cart-progress-label-text text-xs font-medium text-white",html:o})})]})};H.displayName="CircleProgress";var oe=H;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var M=Object.create;var v=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var j=(i,t)=>{for(var l in t)v(i,l,{get:t[l],enumerable:!0})},I=(i,t,l,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of k(t))!S.call(i,r)&&r!==l&&v(i,r,{get:()=>t[r],enumerable:!(c=T(t,r))||c.enumerable});return i};var H=(i,t,l)=>(l=i!=null?M(q(i)):{},I(t||!i||!i.__esModule?v(l,"default",{value:i,enumerable:!0}):l,i)),B=i=>I(v({},"__esModule",{value:!0}),i);var A={};j(A,{MiniCartDialog:()=>C,default:()=>E});module.exports=B(A);var e=require("react/jsx-runtime"),h=require("react"),N=H(require("fitty")),a=require("../../helpers/index.js"),o=require("../../components/index.js"),z=require("./index.js");const O=({className:i})=>(0,e.jsx)("svg",{className:i,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),R=({className:i})=>(0,e.jsx)("svg",{className:i,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),V=({item:i,classNames:t,labelStyles:l,onIncrease:c,onDecrease:r})=>{const{merchandise:y,quantity:m,cost:w,readonly:g,productLabel:d,labelVariant:D}=i,{image:x,title:b}=y,{totalAmount:u,subtotalAmount:p}=w,f=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(!f.current)return;const P=(0,N.default)(f.current,{minSize:8,maxSize:12,multiLine:!1});return()=>P.unsubscribe()},[d]);const n=b||y.sku||"Product",s=u?.formattedPrice||"",L=p&&u&&parseFloat(p.amount)>parseFloat(u.amount);return(0,e.jsxs)("div",{className:(0,a.cn)("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",t?.item),children:[(0,e.jsxs)("div",{className:(0,a.cn)("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",t?.itemImage),children:[x?.url&&(0,e.jsx)("img",{src:x.url,alt:x.altText||n,className:"size-full object-cover"}),d&&(0,e.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex max-h-4 items-center justify-center overflow-hidden py-0 text-center backdrop-blur-sm",style:(0,z.resolveCartLineLabelStyle)(D,l),children:(0,e.jsx)(o.Text,{ref:f,size:1,className:"leading-[16px] text-white",html:d})})]}),(0,e.jsxs)("div",{className:(0,a.cn)("laptop:gap-4 flex flex-1 flex-col gap-2",t?.itemInfo),children:[(0,e.jsx)(o.Text,{as:"p",size:3,className:(0,a.cn)("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",t?.itemTitle),children:n}),(0,e.jsxs)("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[(0,e.jsxs)("div",{className:(0,a.cn)("flex items-center gap-1",t?.itemPrice),children:[s&&(0,e.jsx)(o.Text,{size:4,className:(0,a.cn)("text-info-primary laptop:text-[18px] text-[16px]",t?.itemCurrentPrice),children:s}),L&&p?.formattedPrice&&(0,e.jsx)(o.Text,{size:4,className:(0,a.cn)("text-info-tertiary laptop:text-[18px] text-[16px] line-through",t?.itemOriginalPrice),children:p.formattedPrice})]}),g?(0,e.jsx)("div",{className:(0,a.cn)("flex items-center",t?.quantityControl),children:(0,e.jsxs)("span",{className:"text-info-primary text-sm font-semibold",children:["x",m]})}):(0,e.jsxs)("div",{className:(0,a.cn)("flex items-center",t?.quantityControl),children:[(0,e.jsx)("button",{type:"button",onClick:r,disabled:m<=0,className:(0,a.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",t?.quantityButton),"aria-label":"Decrease quantity",children:(0,e.jsx)(O,{className:"laptop:size-3 size-[10.67px]"})}),(0,e.jsx)("div",{className:(0,a.cn)("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",t?.quantityValue),children:m}),(0,e.jsx)("button",{type:"button",onClick:c,className:(0,a.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",t?.quantityButton),"aria-label":"Increase quantity",children:(0,e.jsx)(R,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},C=({open:i,onOpenChange:t,cart:l,copy:c,classNames:r={},labelStyles:y,onIncreaseQuantity:m,onDecreaseQuantity:w,onQuantityChange:g})=>{const d=c?.title||"Selected ({count})",D=c?.emptyText||"Your cart is empty",x=l?.lineItems?.reduce((n,s)=>n+(s?.quantity||0),0)||0,b=l?.lineItems||[],u=b.length===0,p=(n,s)=>{m?.(n,s),g?.(n,s+1)},f=(n,s)=>{s>0&&(w?.(n,s),g?.(n,s-1))};return(0,e.jsx)(o.Dialog,{open:i,onOpenChange:t,children:(0,e.jsxs)(o.DialogContent,{className:(0,a.cn)("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",r?.root),children:[(0,e.jsx)(o.DialogHeader,{className:(0,a.cn)("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",r?.header),children:(0,e.jsx)(o.DialogTitle,{asChild:!0,children:(0,e.jsx)(o.Heading,{as:"h3",size:2,className:(0,a.cn)("text-info-primary font-bold",r?.title),children:d.replace("{count}",x.toString())})})}),(0,e.jsx)("div",{className:(0,a.cn)("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",r?.content),children:u?(0,e.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,e.jsx)(o.Text,{size:2,className:"text-info-tertiary",children:D})}):(0,e.jsx)("div",{className:(0,a.cn)("flex flex-col gap-2",r?.itemList),children:b.map(n=>(0,e.jsx)(V,{item:n,classNames:r,labelStyles:y,onIncrease:()=>p(n.id,n.quantity),onDecrease:()=>f(n.id,n.quantity)},n.id))})}),(0,e.jsx)("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};C.displayName="MiniCartDialog";var E=C;
|
|
@@ -20,15 +20,18 @@ export interface CircleProgressConfig {
|
|
|
20
20
|
labelColor?: string;
|
|
21
21
|
/** 背景颜色,默认为容器背景色 */
|
|
22
22
|
backgroundColor?: string;
|
|
23
|
-
/** 移动端组件尺寸,默认
|
|
23
|
+
/** 移动端组件尺寸,默认 64 */
|
|
24
24
|
size?: number;
|
|
25
|
-
/** laptop 以上组件尺寸,默认
|
|
25
|
+
/** laptop 以上组件尺寸,默认 96 */
|
|
26
26
|
laptopSize?: number;
|
|
27
27
|
/** 圆环中间显示的文字(如满减档位优惠),传入 image 时不渲染;字号随断点 12 / 16 / 18px */
|
|
28
28
|
centerText?: string;
|
|
29
29
|
/** 中间图片置灰(未达当前档时赠品图变灰),默认 false */
|
|
30
30
|
dimmed?: boolean;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* 盖在中间图片上的角标,按 HTML 渲染(Text html),传文字、<img> 或 <svg> 均可;有值才渲染,默认不渲染。
|
|
33
|
+
* 默认样式是贴底部的灰色文字条;要改成铺满圆形的印章(如赠品售罄),通过 classNames.badge 覆盖位置与尺寸。
|
|
34
|
+
*/
|
|
32
35
|
dimmedBadge?: string;
|
|
33
36
|
/** 未完成阶段的颜色 */
|
|
34
37
|
trackColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var Pt=Object.create;var v=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var zt=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty;var At=(i,e)=>{for(var c in e)v(i,c,{get:e[c],enumerable:!0})},U=(i,e,c,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Tt(e))!Bt.call(i,a)&&a!==c&&v(i,a,{get:()=>e[a],enumerable:!(s=It(e,a))||s.enumerable});return i};var X=(i,e,c)=>(c=i!=null?Pt(zt(i)):{},U(e||!i||!i.__esModule?v(c,"default",{value:i,enumerable:!0}):c,i)),Dt=i=>U(v({},"__esModule",{value:!0}),i);var Vt={};At(Vt,{default:()=>Rt,resolveCartLineLabelStyle:()=>$});module.exports=Dt(Vt);var t=require("react/jsx-runtime"),l=X(require("react")),r=require("../../helpers/index.js"),Q=require("../../components/index.js"),f=require("../../components/index.js"),g=require("../../components/index.js"),O=X(require("./CircleProgress.js")),Y=require("../../hooks/useExposure.js");const Et="cart",jt="mini_cart",$=(i,e)=>i==="notEligible"?{backgroundColor:e?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:i==="gift"?{backgroundColor:e?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},F=l.forwardRef(({className:i,classNames:e={},data:c,cart:s,progressConfig:a,onRemoveItem:Z,onCheckout:_,onClickToView:S,...J},K)=>{const y=l.useRef(null),{copy:p,theme:N="light",locale:Ht="us",showMobileViewMore:tt=!0,maxQuantityDisplay:C,labelStyles:et}=c||{};(0,Y.useExposure)(y,{componentType:Et,componentName:jt,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),l.useImperativeHandle(K,()=>y.current);const ot=p?.emptyCart||"Your Cart is Empty",P=p?.description||"",rt=p?.itemsInCart||"You have selected {count} items",at=p?.total||"Total {total}",Wt=p?.totalWithCoupon||"total: {total} ({subtotal})",I=p?.clickToView||"Click to view cart",nt=p?.buyNowText||"Buy Now",it=p?.savingText||"Saving {amount}",m=l.useMemo(()=>s?.lineItems||[],[s?.lineItems]),T=m.reduce((o,n)=>o+(n?.quantity||0),0),lt=T===0,st=parseFloat(s?.cost?.totalAmount?.amount||"0"),ct=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),pt=parseFloat(s?.cost?.savingAmount?.amount||"0"),dt=s?.cost?.totalAmount?.formattedPrice||"",z=ct>st?s?.cost?.subtotalAmount?.formattedPrice:null,B=pt>0?s?.cost?.savingAmount?.formattedPrice:null,d=l.useRef(null),[w,mt]=l.useState(!1),[A,D]=l.useState(!1),[E,j]=l.useState(null),R=async o=>{if(!E){j(o);try{await Z?.(o,s)}finally{j(null)}}},[V,k]=l.useState(!1),[ut,gt]=l.useState(0),[bt,ft]=l.useState(0),[H,xt]=l.useState(!1),[W,ht]=l.useState(!0),x=l.useCallback(()=>{const o=d.current;if(!o)return;const{scrollLeft:n,scrollWidth:u,clientWidth:h}=o;xt(n>0),ht(n<u-h-1)},[]),vt=l.useCallback(()=>{x()},[x]);l.useEffect(()=>{x()},[m.length,x]);const yt=o=>{d.current&&(k(!0),gt(o.pageX-d.current.offsetLeft),ft(d.current.scrollLeft))},Ct=o=>{if(!V||!d.current)return;o.preventDefault();const u=(o.pageX-d.current.offsetLeft-ut)*1.5;d.current.scrollLeft=bt-u},wt=()=>{k(!1)},kt=()=>{k(!1)},q=o=>{if(d.current){const n=d.current,u=100;n.scrollBy({left:o==="right"?u:-u,behavior:"smooth"})}},L=({className:o})=>(0,t.jsx)("svg",{className:o,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),Lt=({className:o})=>(0,t.jsx)("svg",{className:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Mt=o=>m.length?(0,t.jsxs)("div",{className:(0,r.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[m.length>=5&&(0,t.jsx)("button",{onClick:()=>q("left"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!H}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:d,onMouseDown:yt,onMouseMove:Ct,onMouseUp:wt,onMouseLeave:kt,onScroll:vt,className:(0,r.cn)("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",V?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[m.filter(n=>n&&n.id).map(n=>{const h=(n.merchandise||{}).image||{},G=h.url,Nt=h.altText||"Product image",M=E===n.id;return(0,t.jsxs)("div",{className:(0,r.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[G&&(0,t.jsx)("img",{src:G,alt:Nt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),M&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>R(n.id),className:(0,r.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",M&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),n.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:$(n.labelVariant,et),children:(0,t.jsx)(f.Text,{size:1,className:"relative text-center text-white",html:n.productLabel})})}),n.quantity>1&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 z-10 flex size-4 items-center justify-center rounded-full text-white",children:(0,t.jsx)(f.Text,{className:"text-sm",html:St(n.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>R(n.id),className:(0,r.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",M&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(Lt,{className:"pointer-events-none size-[20px] text-white"})})]},n.id)}),tt&&(0,t.jsx)("button",{onClick:()=>S?.(s),className:(0,r.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":I,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m.length>=5&&(0,t.jsx)("button",{onClick:()=>q("right"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!W&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!W}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5"})})]}):null,b=!lt&&m.length>0,St=o=>C!==void 0&&o>C?`${C}+`:String(o);return(0,t.jsx)("div",{ref:y,className:(0,r.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":N==="dark"}),...J,children:(0,t.jsxs)("div",{className:(0,r.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,r.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",a&&"laptop:pl-[104px] pl-[72px]"),children:[a&&(0,t.jsx)(O.default,{totalSteps:a.totalSteps,currentStep:a.currentStep,image:a.image,label:a.label,progressColor:a.progressColor,labelColor:a.labelColor,backgroundColor:a.backgroundColor,size:a.size,laptopSize:a.laptopSize,centerText:a.centerText,dimmed:a.dimmed,dimmedBadge:a.dimmedBadge,trackColor:a.trackColor,classNames:a.classNames,className:(0,r.cn)("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,r.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:b?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(g.Heading,{size:2,as:"h3",className:(0,r.cn)("",e?.cartTitle),html:rt.replace("{count}",`<span class="text-brand-0">${T||0}</span>`)}),(0,t.jsxs)(g.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?mt(!w):S?.(s)},className:(0,r.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(f.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:I}),(0,t.jsx)(L,{className:(0,r.cn)("size-4 transition-transform",w?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(g.Heading,{as:"h3",size:2,className:(0,r.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:ot})}),P&&(0,t.jsx)(f.Text,{size:2,className:(0,r.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:P})]})]}),b&&(0,t.jsx)("div",{className:(0,r.cn)("laptop:block laptop:shrink",w?"block":"hidden"),children:Mt(N)}),b&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,r.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:at.replace("{total}",dt)}),z&&(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:z})]}),B&&(0,t.jsx)(g.Heading,{size:2,as:"h6",className:(0,r.cn)("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:it.replace("{amount}",B)})]}),(0,t.jsx)(Q.Button,{disabled:!b,loading:A,onClick:async()=>{if(!A){D(!0);try{await _?.(s)}finally{D(!1)}}},className:(0,r.cn)("whitespace-nowrap",e?.actionButton),children:nt})]})]})})});F.displayName="MiniCart";var Rt=F;
|
|
1
|
+
"use strict";"use client";var It=Object.create;var w=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var Dt=(i,e)=>{for(var p in e)w(i,p,{get:e[p],enumerable:!0})},X=(i,e,p,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of At(e))!Et.call(i,n)&&n!==p&&w(i,n,{get:()=>e[n],enumerable:!(s=zt(e,n))||s.enumerable});return i};var S=(i,e,p)=>(p=i!=null?It(Bt(i)):{},X(e||!i||!i.__esModule?w(p,"default",{value:i,enumerable:!0}):p,i)),jt=i=>X(w({},"__esModule",{value:!0}),i);var Wt={};Dt(Wt,{default:()=>Vt,resolveCartLineLabelStyle:()=>K});module.exports=jt(Wt);var t=require("react/jsx-runtime"),l=S(require("react")),Q=S(require("fitty")),r=require("../../helpers/index.js"),O=require("../../components/index.js"),b=require("../../components/index.js"),g=require("../../components/index.js"),Y=S(require("./CircleProgress.js")),$=require("../../hooks/useExposure.js");const Rt="cart",Ht="mini_cart",K=(i,e)=>i==="notEligible"?{backgroundColor:e?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:i==="gift"?{backgroundColor:e?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},F=l.forwardRef(({className:i,classNames:e={},data:p,cart:s,progressConfig:n,onRemoveItem:Z,onCheckout:_,onClickToView:N,...J},tt)=>{const x=l.useRef(null),{copy:d,theme:P="light",locale:qt="us",showMobileViewMore:et=!0,maxQuantityDisplay:C,labelStyles:ot}=p||{};(0,$.useExposure)(x,{componentType:Rt,componentName:Ht,componentTitle:d?.itemsInCart||"Mini Cart",componentDescription:d?.description}),l.useImperativeHandle(tt,()=>x.current);const rt=d?.emptyCart||"Your Cart is Empty",T=d?.description||"",at=d?.itemsInCart||"You have selected {count} items",nt=d?.total||"Total {total}",Gt=d?.totalWithCoupon||"total: {total} ({subtotal})",I=d?.clickToView||"Click to view cart",it=d?.buyNowText||"Buy Now",lt=d?.savingText||"Saving {amount}",u=l.useMemo(()=>s?.lineItems||[],[s?.lineItems]),z=u.reduce((o,a)=>o+(a?.quantity||0),0),st=z===0,ct=parseFloat(s?.cost?.totalAmount?.amount||"0"),pt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),dt=parseFloat(s?.cost?.savingAmount?.amount||"0"),mt=s?.cost?.totalAmount?.formattedPrice||"",A=pt>ct?s?.cost?.subtotalAmount?.formattedPrice:null,B=dt>0?s?.cost?.savingAmount?.formattedPrice:null,m=l.useRef(null),[h,ut]=l.useState(!1),[E,D]=l.useState(!1),[j,R]=l.useState(null),H=async o=>{if(!j){R(o);try{await Z?.(o,s)}finally{R(null)}}},[V,k]=l.useState(!1),[gt,ft]=l.useState(0),[bt,xt]=l.useState(0),[W,ht]=l.useState(!1),[q,vt]=l.useState(!0),v=l.useCallback(()=>{const o=m.current;if(!o)return;const{scrollLeft:a,scrollWidth:c,clientWidth:y}=o;ht(a>0),vt(a<c-y-1)},[]),yt=l.useCallback(()=>{v()},[v]);l.useEffect(()=>{v()},[u.length,v]);const wt=u.map(o=>o.productLabel??"").join("|");l.useEffect(()=>{const o=x.current?.querySelectorAll("[data-fit-label]");if(!o?.length)return;const a=Array.from(o,c=>(0,Q.default)(c,{minSize:8,maxSize:12,multiLine:!1}));return()=>a.forEach(c=>c.unsubscribe())},[wt,h]);const Ct=o=>{m.current&&(k(!0),ft(o.pageX-m.current.offsetLeft),xt(m.current.scrollLeft))},kt=o=>{if(!V||!m.current)return;o.preventDefault();const c=(o.pageX-m.current.offsetLeft-gt)*1.5;m.current.scrollLeft=bt-c},Lt=()=>{k(!1)},Mt=()=>{k(!1)},G=o=>{if(m.current){const a=m.current,c=100;a.scrollBy({left:o==="right"?c:-c,behavior:"smooth"})}},L=({className:o})=>(0,t.jsx)("svg",{className:o,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),St=({className:o})=>(0,t.jsx)("svg",{className:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Nt=o=>u.length?(0,t.jsxs)("div",{className:(0,r.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[u.length>=5&&(0,t.jsx)("button",{onClick:()=>G("left"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!W&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!W}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:m,onMouseDown:Ct,onMouseMove:kt,onMouseUp:Lt,onMouseLeave:Mt,onScroll:yt,className:(0,r.cn)("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",V?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[u.filter(a=>a&&a.id).map(a=>{const y=(a.merchandise||{}).image||{},U=y.url,Tt=y.altText||"Product image",M=j===a.id;return(0,t.jsxs)("div",{className:(0,r.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[U&&(0,t.jsx)("img",{src:U,alt:Tt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),M&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>H(a.id),className:(0,r.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",M&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:K(a.labelVariant,ot),children:(0,t.jsx)("div",{className:"w-full text-center",children:(0,t.jsx)(b.Text,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:a.productLabel})})})}),a.quantity>1&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:(0,t.jsx)(b.Text,{className:"whitespace-nowrap text-sm leading-none",html:Pt(a.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>H(a.id),className:(0,r.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",M&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(St,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),et&&(0,t.jsx)("button",{onClick:()=>N?.(s),className:(0,r.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":I,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u.length>=5&&(0,t.jsx)("button",{onClick:()=>G("right"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!q&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!q}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5"})})]}):null,f=!st&&u.length>0,Pt=o=>C!==void 0&&o>C?`${C}+`:String(o);return(0,t.jsx)("div",{ref:x,className:(0,r.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":P==="dark"}),...J,children:(0,t.jsxs)("div",{className:(0,r.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,r.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",n&&"laptop:pl-[104px] pl-[72px]"),children:[n&&(0,t.jsx)(Y.default,{totalSteps:n.totalSteps,currentStep:n.currentStep,image:n.image,label:n.label,progressColor:n.progressColor,labelColor:n.labelColor,backgroundColor:n.backgroundColor,size:n.size,laptopSize:n.laptopSize,centerText:n.centerText,dimmed:n.dimmed,dimmedBadge:n.dimmedBadge,trackColor:n.trackColor,classNames:n.classNames,className:(0,r.cn)("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,r.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:f?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(g.Heading,{size:2,as:"h3",className:(0,r.cn)("",e?.cartTitle),html:at.replace("{count}",`<span class="mini-cart-count text-brand-0">${z||0}</span>`)}),(0,t.jsxs)(g.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?ut(!h):N?.(s)},className:(0,r.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(b.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:I}),(0,t.jsx)(L,{className:(0,r.cn)("size-4 transition-transform",h?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(g.Heading,{as:"h3",size:2,className:(0,r.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:rt})}),T&&(0,t.jsx)(b.Text,{size:2,className:(0,r.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:T})]})]}),f&&(0,t.jsx)("div",{className:(0,r.cn)("laptop:block laptop:shrink",h?"block":"hidden"),children:Nt(P)}),f&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,r.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:nt.replace("{total}",mt)}),A&&(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:A})]}),B&&(0,t.jsx)(g.Heading,{size:2,as:"h6",className:(0,r.cn)("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:lt.replace("{amount}",B)})]}),(0,t.jsx)(O.Button,{disabled:!f,loading:E,onClick:async()=>{if(!E){D(!0);try{await _?.(s)}finally{D(!1)}}},className:(0,r.cn)("mini-cart-action-button whitespace-nowrap",e?.actionButton),children:it})]})]})})});F.displayName="MiniCart";var Vt=F;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
2
|
-
`),
|
|
1
|
+
"use client";import{jsx as r,jsxs as d}from"react/jsx-runtime";import*as C from"react";import U from"fitty";import{Picture as V,Text as M}from"../../components/index.js";import{cn as e}from"../../helpers/index.js";const I=({totalSteps:p=4,currentStep:A=0,image:g,label:l,progressColor:F="var(--brand-color-0)",labelColor:G="var(--marketing-color-1)",trackColor:H="#DADCE0",backgroundColor:E="#EAEAEC",size:x=64,laptopSize:h=96,gap:$=3,centerText:N,dimmed:D=!1,dimmedBadge:w,className:O,classNames:n})=>{const b=Math.max(x,h),z=6,s=(b-z)/2,a=b/2,W=C.useMemo(()=>{const c=($+z)/s*(180/Math.PI),t=(360-c*p)/p,y=i=>i*Math.PI/180,Y=(i,u)=>{const f=i-90,v=u-90,q=a+s*Math.cos(y(f)),B=a+s*Math.sin(y(f)),J=a+s*Math.cos(y(v)),K=a+s*Math.sin(y(v)),Q=u-i>180?1:0;return`M ${q} ${B} A ${s} ${s} 0 ${Q} 1 ${J} ${K}`},R=[];let L=p===2?-45:0;for(let i=0;i<p;i++){const u=L+c/2,f=u+t,v=i<A;R.push({path:Y(u,f),isCompleted:v,index:i}),L=f+c/2}return R},[p,A,$,s,a]),[S,...X]=(N||"").split(`
|
|
2
|
+
`),m=X.join(" "),T=C.useRef(null),j=C.useRef(null);return C.useEffect(()=>{const o=[T.current,j.current].filter(t=>!!t);if(!o.length)return;let c=[];const P=()=>{c=o.map(t=>U(t,{minSize:6,maxSize:parseFloat(getComputedStyle(t).fontSize),multiLine:!1}))},k=()=>{c.forEach(t=>t.unsubscribe()),P()};return P(),window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k),c.forEach(t=>t.unsubscribe())}},[S,m]),d("div",{className:e("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",O,n?.root),style:{"--circle-size":`${x}px`,"--circle-laptop-size":`${h}px`,"--circle-height":`${l?x+8:x}px`,"--circle-laptop-height":`${l?h+8:h}px`},children:[d("div",{className:e("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",n?.ring),children:[d("svg",{viewBox:`0 0 ${b} ${b}`,className:e("absolute inset-0 size-full",l?"translate-y-[-8px]":""),children:[r("circle",{cx:a,cy:a,r:s,fill:E,stroke:"none"}),W.map(o=>r("path",{d:o.path,className:e("mini-cart-progress-segment",o.isCompleted&&"mini-cart-progress-segment-completed"),fill:"none",stroke:o.isCompleted?F:H,strokeWidth:z,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},o.index))]}),r("div",{className:e("absolute inset-[10px] flex items-center justify-center",l?"translate-y-[-8px]":"",n?.inner),children:d("div",{className:e("flex size-full items-center justify-center overflow-hidden rounded-full",w&&"relative"),style:{backgroundColor:E},children:[g?.url&&r(V,{className:e("size-full",D&&"opacity-40 grayscale",n?.image),imgClassName:"h-full object-contain",source:g.url,alt:g.alt||""}),!g?.url&&N&&d("div",{className:e("text-info-primary flex w-4/5 flex-col items-center justify-center text-center",m?"gap-0.5":"",n?.centerText),children:[r(M,{ref:T,className:e("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",m&&"font-bold",n?.centerTextMain),html:S}),m&&r(M,{ref:j,className:e("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",n?.centerTextSub),html:m})]}),w&&r("span",{className:e("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",n?.badge),children:r(M,{size:1,className:"text-center text-white",html:w})})]})})]}),l&&r("div",{className:e("mini-cart-progress-label absolute bottom-2 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",n?.label),style:{backgroundColor:G},children:r(M,{className:"mini-cart-progress-label-text text-xs font-medium text-white",html:l})})]})};I.displayName="CircleProgress";var re=I;export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as N,useRef as z}from"react";import L from"fitty";import{cn as i}from"../../helpers/index.js";import{Heading as P,Text as u,Dialog as M,DialogContent as T,DialogHeader as k,DialogTitle as q}from"../../components/index.js";import{resolveCartLineLabelStyle as S}from"./index.js";const j=({className:l})=>e("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),H=({className:l})=>e("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),B=({item:l,classNames:a,labelStyles:f,onIncrease:y,onDecrease:o})=>{const{merchandise:g,quantity:c,cost:C,readonly:b,productLabel:p,labelVariant:h}=l,{image:m,title:v}=g,{totalAmount:d,subtotalAmount:s}=C,x=z(null);N(()=>{if(!x.current)return;const I=L(x.current,{minSize:8,maxSize:12,multiLine:!1});return()=>I.unsubscribe()},[p]);const t=v||g.sku||"Product",n=d?.formattedPrice||"",D=s&&d&&parseFloat(s.amount)>parseFloat(d.amount);return r("div",{className:i("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",a?.item),children:[r("div",{className:i("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",a?.itemImage),children:[m?.url&&e("img",{src:m.url,alt:m.altText||t,className:"size-full object-cover"}),p&&e("div",{className:"absolute inset-x-0 bottom-0 flex max-h-4 items-center justify-center overflow-hidden py-0 text-center backdrop-blur-sm",style:S(h,f),children:e(u,{ref:x,size:1,className:"leading-[16px] text-white",html:p})})]}),r("div",{className:i("laptop:gap-4 flex flex-1 flex-col gap-2",a?.itemInfo),children:[e(u,{as:"p",size:3,className:i("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",a?.itemTitle),children:t}),r("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[r("div",{className:i("flex items-center gap-1",a?.itemPrice),children:[n&&e(u,{size:4,className:i("text-info-primary laptop:text-[18px] text-[16px]",a?.itemCurrentPrice),children:n}),D&&s?.formattedPrice&&e(u,{size:4,className:i("text-info-tertiary laptop:text-[18px] text-[16px] line-through",a?.itemOriginalPrice),children:s.formattedPrice})]}),b?e("div",{className:i("flex items-center",a?.quantityControl),children:r("span",{className:"text-info-primary text-sm font-semibold",children:["x",c]})}):r("div",{className:i("flex items-center",a?.quantityControl),children:[e("button",{type:"button",onClick:o,disabled:c<=0,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",a?.quantityButton),"aria-label":"Decrease quantity",children:e(j,{className:"laptop:size-3 size-[10.67px]"})}),e("div",{className:i("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",a?.quantityValue),children:c}),e("button",{type:"button",onClick:y,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",a?.quantityButton),"aria-label":"Increase quantity",children:e(H,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},w=({open:l,onOpenChange:a,cart:f,copy:y,classNames:o={},labelStyles:g,onIncreaseQuantity:c,onDecreaseQuantity:C,onQuantityChange:b})=>{const p=y?.title||"Selected ({count})",h=y?.emptyText||"Your cart is empty",m=f?.lineItems?.reduce((t,n)=>t+(n?.quantity||0),0)||0,v=f?.lineItems||[],d=v.length===0,s=(t,n)=>{c?.(t,n),b?.(t,n+1)},x=(t,n)=>{n>0&&(C?.(t,n),b?.(t,n-1))};return e(M,{open:l,onOpenChange:a,children:r(T,{className:i("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",o?.root),children:[e(k,{className:i("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",o?.header),children:e(q,{asChild:!0,children:e(P,{as:"h3",size:2,className:i("text-info-primary font-bold",o?.title),children:p.replace("{count}",m.toString())})})}),e("div",{className:i("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",o?.content),children:d?e("div",{className:"flex items-center justify-center py-8",children:e(u,{size:2,className:"text-info-tertiary",children:h})}):e("div",{className:i("flex flex-col gap-2",o?.itemList),children:v.map(t=>e(B,{item:t,classNames:o,labelStyles:g,onIncrease:()=>s(t.id,t.quantity),onDecrease:()=>x(t.id,t.quantity)},t.id))})}),e("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};w.displayName="MiniCartDialog";var F=w;export{w as MiniCartDialog,F as default};
|
|
@@ -20,15 +20,18 @@ export interface CircleProgressConfig {
|
|
|
20
20
|
labelColor?: string;
|
|
21
21
|
/** 背景颜色,默认为容器背景色 */
|
|
22
22
|
backgroundColor?: string;
|
|
23
|
-
/** 移动端组件尺寸,默认
|
|
23
|
+
/** 移动端组件尺寸,默认 64 */
|
|
24
24
|
size?: number;
|
|
25
|
-
/** laptop 以上组件尺寸,默认
|
|
25
|
+
/** laptop 以上组件尺寸,默认 96 */
|
|
26
26
|
laptopSize?: number;
|
|
27
27
|
/** 圆环中间显示的文字(如满减档位优惠),传入 image 时不渲染;字号随断点 12 / 16 / 18px */
|
|
28
28
|
centerText?: string;
|
|
29
29
|
/** 中间图片置灰(未达当前档时赠品图变灰),默认 false */
|
|
30
30
|
dimmed?: boolean;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* 盖在中间图片上的角标,按 HTML 渲染(Text html),传文字、<img> 或 <svg> 均可;有值才渲染,默认不渲染。
|
|
33
|
+
* 默认样式是贴底部的灰色文字条;要改成铺满圆形的印章(如赠品售罄),通过 classNames.badge 覆盖位置与尺寸。
|
|
34
|
+
*/
|
|
32
35
|
dimmedBadge?: string;
|
|
33
36
|
/** 未完成阶段的颜色 */
|
|
34
37
|
trackColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import*as i from"react";import{cn as o}from"../../helpers/index.js";import{Button as wt}from"../../components/index.js";import{Text as h}from"../../components/index.js";import{Heading as u}from"../../components/index.js";import kt from"./CircleProgress.js";import{useExposure as Lt}from"../../hooks/useExposure.js";const Mt="cart",St="mini_cart",Nt=(b,r)=>b==="notEligible"?{backgroundColor:r?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:b==="gift"?{backgroundColor:r?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},G=i.forwardRef(({className:b,classNames:r={},data:U,cart:s,progressConfig:n,onRemoveItem:X,onCheckout:F,onClickToView:M,...Q},O)=>{const v=i.useRef(null),{copy:c,theme:S="light",locale:Pt="us",showMobileViewMore:Y=!0,maxQuantityDisplay:y,labelStyles:$}=U||{};Lt(v,{componentType:Mt,componentName:St,componentTitle:c?.itemsInCart||"Mini Cart",componentDescription:c?.description}),i.useImperativeHandle(O,()=>v.current);const Z=c?.emptyCart||"Your Cart is Empty",N=c?.description||"",_=c?.itemsInCart||"You have selected {count} items",J=c?.total||"Total {total}",It=c?.totalWithCoupon||"total: {total} ({subtotal})",P=c?.clickToView||"Click to view cart",K=c?.buyNowText||"Buy Now",tt=c?.savingText||"Saving {amount}",d=i.useMemo(()=>s?.lineItems||[],[s?.lineItems]),I=d.reduce((e,a)=>e+(a?.quantity||0),0),et=I===0,ot=parseFloat(s?.cost?.totalAmount?.amount||"0"),rt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),at=parseFloat(s?.cost?.savingAmount?.amount||"0"),nt=s?.cost?.totalAmount?.formattedPrice||"",T=rt>ot?s?.cost?.subtotalAmount?.formattedPrice:null,z=at>0?s?.cost?.savingAmount?.formattedPrice:null,p=i.useRef(null),[C,it]=i.useState(!1),[B,A]=i.useState(!1),[D,E]=i.useState(null),j=async e=>{if(!D){E(e);try{await X?.(e,s)}finally{E(null)}}},[R,w]=i.useState(!1),[lt,st]=i.useState(0),[ct,pt]=i.useState(0),[V,dt]=i.useState(!1),[H,mt]=i.useState(!0),f=i.useCallback(()=>{const e=p.current;if(!e)return;const{scrollLeft:a,scrollWidth:m,clientWidth:x}=e;dt(a>0),mt(a<m-x-1)},[]),ut=i.useCallback(()=>{f()},[f]);i.useEffect(()=>{f()},[d.length,f]);const gt=e=>{p.current&&(w(!0),st(e.pageX-p.current.offsetLeft),pt(p.current.scrollLeft))},bt=e=>{if(!R||!p.current)return;e.preventDefault();const m=(e.pageX-p.current.offsetLeft-lt)*1.5;p.current.scrollLeft=ct-m},ft=()=>{w(!1)},xt=()=>{w(!1)},W=e=>{if(p.current){const a=p.current,m=100;a.scrollBy({left:e==="right"?m:-m,behavior:"smooth"})}},k=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),ht=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),vt=e=>d.length?l("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",r?.itemsGrid),children:[d.length>=5&&t("button",{onClick:()=>W("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!V&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!V}),"aria-label":"Scroll left to see more items",children:t(k,{className:"laptop:size-4 size-5 rotate-180"})}),l("div",{ref:p,onMouseDown:gt,onMouseMove:bt,onMouseUp:ft,onMouseLeave:xt,onScroll:ut,className:o("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",R?"cursor-grabbing":"cursor-grab",r?.itemGridContainer),children:[d.filter(a=>a&&a.id).map(a=>{const x=(a.merchandise||{}).image||{},q=x.url,Ct=x.altText||"Product image",L=D===a.id;return l("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",r?.gridItem),children:[q&&t("img",{src:q,alt:Ct,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),L&&t("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:l("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>j(a.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",L&&"pointer-events-none opacity-0"),"aria-label":"delete",children:l("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:Nt(a.labelVariant,$),children:t(h,{size:1,className:"relative text-center text-white",html:a.productLabel})})}),a.quantity>1&&t("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 z-10 flex size-4 items-center justify-center rounded-full text-white",children:t(h,{className:"text-sm",html:yt(a.quantity)})}),t("div",{role:"button",onClick:()=>j(a.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",L&&"laptop:hidden",r?.gridItemOverlay),"aria-label":"Remove item",children:t(ht,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),Y&&t("button",{onClick:()=>M?.(s),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",r?.mobileViewMoreButton),"aria-label":P,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.length>=5&&t("button",{onClick:()=>W("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!H}),"aria-label":"Scroll right to see more items",children:t(k,{className:"laptop:size-4 size-5"})})]}):null,g=!et&&d.length>0,yt=e=>y!==void 0&&e>y?`${y}+`:String(e);return t("div",{ref:v,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",b,r?.root,{"aiui-dark bg-container-primary":S==="dark"}),...Q,children:l("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",r?.content),children:[l("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",n&&"laptop:pl-[104px] pl-[72px]"),children:[n&&t(kt,{totalSteps:n.totalSteps,currentStep:n.currentStep,image:n.image,label:n.label,progressColor:n.progressColor,labelColor:n.labelColor,backgroundColor:n.backgroundColor,size:n.size,laptopSize:n.laptopSize,centerText:n.centerText,dimmed:n.dimmed,dimmedBadge:n.dimmedBadge,trackColor:n.trackColor,classNames:n.classNames,className:o("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",r?.circleProgress)}),l("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",r?.cartInfo),children:g?l("div",{className:"flex w-full items-center gap-2",children:[t(u,{size:2,as:"h3",className:o("",r?.cartTitle),html:_.replace("{count}",`<span class="text-brand-0">${I||0}</span>`)}),l(u,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?it(!C):M?.(s)},className:o("flex cursor-pointer items-center gap-1",r?.expandButton),children:[t(h,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:P}),t(k,{className:o("size-4 transition-transform",C?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(u,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",r?.cartTitle),html:Z})}),N&&t(h,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.cartDescription),html:N})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",C?"block":"hidden"),children:vt(S)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),l("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",r?.priceSection),children:[l("div",{className:"flex flex-col items-end justify-center",children:[l("div",{className:"flex items-center gap-2",children:[t(u,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",r?.totalPrice),html:J.replace("{total}",nt)}),T&&t(u,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",r?.originalPrice),html:T})]}),z&&t(u,{size:2,as:"h6",className:o("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",r?.saveAmount),html:tt.replace("{amount}",z)})]}),t(wt,{disabled:!g,loading:B,onClick:async()=>{if(!B){A(!0);try{await F?.(s)}finally{A(!1)}}},className:o("whitespace-nowrap",r?.actionButton),children:K})]})]})})});G.displayName="MiniCart";var jt=G;export{jt as default,Nt as resolveCartLineLabelStyle};
|
|
1
|
+
"use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import*as n from"react";import kt from"fitty";import{cn as o}from"../../helpers/index.js";import{Button as Lt}from"../../components/index.js";import{Text as y}from"../../components/index.js";import{Heading as u}from"../../components/index.js";import Mt from"./CircleProgress.js";import{useExposure as St}from"../../hooks/useExposure.js";const Nt="cart",Pt="mini_cart",Tt=(f,r)=>f==="notEligible"?{backgroundColor:r?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:f==="gift"?{backgroundColor:r?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},G=n.forwardRef(({className:f,classNames:r={},data:U,cart:s,progressConfig:i,onRemoveItem:X,onCheckout:F,onClickToView:M,...Q},O)=>{const b=n.useRef(null),{copy:p,theme:S="light",locale:It="us",showMobileViewMore:Y=!0,maxQuantityDisplay:w,labelStyles:$}=U||{};St(b,{componentType:Nt,componentName:Pt,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),n.useImperativeHandle(O,()=>b.current);const K=p?.emptyCart||"Your Cart is Empty",N=p?.description||"",Z=p?.itemsInCart||"You have selected {count} items",_=p?.total||"Total {total}",zt=p?.totalWithCoupon||"total: {total} ({subtotal})",P=p?.clickToView||"Click to view cart",J=p?.buyNowText||"Buy Now",tt=p?.savingText||"Saving {amount}",m=n.useMemo(()=>s?.lineItems||[],[s?.lineItems]),T=m.reduce((e,a)=>e+(a?.quantity||0),0),et=T===0,ot=parseFloat(s?.cost?.totalAmount?.amount||"0"),rt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),at=parseFloat(s?.cost?.savingAmount?.amount||"0"),nt=s?.cost?.totalAmount?.formattedPrice||"",I=rt>ot?s?.cost?.subtotalAmount?.formattedPrice:null,z=at>0?s?.cost?.savingAmount?.formattedPrice:null,d=n.useRef(null),[x,it]=n.useState(!1),[A,B]=n.useState(!1),[E,D]=n.useState(null),j=async e=>{if(!E){D(e);try{await X?.(e,s)}finally{D(null)}}},[R,C]=n.useState(!1),[lt,st]=n.useState(0),[ct,pt]=n.useState(0),[H,dt]=n.useState(!1),[V,mt]=n.useState(!0),h=n.useCallback(()=>{const e=d.current;if(!e)return;const{scrollLeft:a,scrollWidth:c,clientWidth:v}=e;dt(a>0),mt(a<c-v-1)},[]),ut=n.useCallback(()=>{h()},[h]);n.useEffect(()=>{h()},[m.length,h]);const gt=m.map(e=>e.productLabel??"").join("|");n.useEffect(()=>{const e=b.current?.querySelectorAll("[data-fit-label]");if(!e?.length)return;const a=Array.from(e,c=>kt(c,{minSize:8,maxSize:12,multiLine:!1}));return()=>a.forEach(c=>c.unsubscribe())},[gt,x]);const ft=e=>{d.current&&(C(!0),st(e.pageX-d.current.offsetLeft),pt(d.current.scrollLeft))},bt=e=>{if(!R||!d.current)return;e.preventDefault();const c=(e.pageX-d.current.offsetLeft-lt)*1.5;d.current.scrollLeft=ct-c},xt=()=>{C(!1)},ht=()=>{C(!1)},W=e=>{if(d.current){const a=d.current,c=100;a.scrollBy({left:e==="right"?c:-c,behavior:"smooth"})}},k=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),vt=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),yt=e=>m.length?l("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",r?.itemsGrid),children:[m.length>=5&&t("button",{onClick:()=>W("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!H}),"aria-label":"Scroll left to see more items",children:t(k,{className:"laptop:size-4 size-5 rotate-180"})}),l("div",{ref:d,onMouseDown:ft,onMouseMove:bt,onMouseUp:xt,onMouseLeave:ht,onScroll:ut,className:o("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",R?"cursor-grabbing":"cursor-grab",r?.itemGridContainer),children:[m.filter(a=>a&&a.id).map(a=>{const v=(a.merchandise||{}).image||{},q=v.url,Ct=v.altText||"Product image",L=E===a.id;return l("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",r?.gridItem),children:[q&&t("img",{src:q,alt:Ct,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),L&&t("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:l("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>j(a.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",L&&"pointer-events-none opacity-0"),"aria-label":"delete",children:l("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:Tt(a.labelVariant,$),children:t("div",{className:"w-full text-center",children:t(y,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:a.productLabel})})})}),a.quantity>1&&t("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:t(y,{className:"whitespace-nowrap text-sm leading-none",html:wt(a.quantity)})}),t("div",{role:"button",onClick:()=>j(a.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",L&&"laptop:hidden",r?.gridItemOverlay),"aria-label":"Remove item",children:t(vt,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),Y&&t("button",{onClick:()=>M?.(s),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",r?.mobileViewMoreButton),"aria-label":P,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m.length>=5&&t("button",{onClick:()=>W("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!V&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!V}),"aria-label":"Scroll right to see more items",children:t(k,{className:"laptop:size-4 size-5"})})]}):null,g=!et&&m.length>0,wt=e=>w!==void 0&&e>w?`${w}+`:String(e);return t("div",{ref:b,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",f,r?.root,{"aiui-dark bg-container-primary":S==="dark"}),...Q,children:l("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",r?.content),children:[l("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",i&&"laptop:pl-[104px] pl-[72px]"),children:[i&&t(Mt,{totalSteps:i.totalSteps,currentStep:i.currentStep,image:i.image,label:i.label,progressColor:i.progressColor,labelColor:i.labelColor,backgroundColor:i.backgroundColor,size:i.size,laptopSize:i.laptopSize,centerText:i.centerText,dimmed:i.dimmed,dimmedBadge:i.dimmedBadge,trackColor:i.trackColor,classNames:i.classNames,className:o("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",r?.circleProgress)}),l("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",r?.cartInfo),children:g?l("div",{className:"flex w-full items-center gap-2",children:[t(u,{size:2,as:"h3",className:o("",r?.cartTitle),html:Z.replace("{count}",`<span class="mini-cart-count text-brand-0">${T||0}</span>`)}),l(u,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?it(!x):M?.(s)},className:o("flex cursor-pointer items-center gap-1",r?.expandButton),children:[t(y,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:P}),t(k,{className:o("size-4 transition-transform",x?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(u,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",r?.cartTitle),html:K})}),N&&t(y,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.cartDescription),html:N})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",x?"block":"hidden"),children:yt(S)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),l("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",r?.priceSection),children:[l("div",{className:"flex flex-col items-end justify-center",children:[l("div",{className:"flex items-center gap-2",children:[t(u,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",r?.totalPrice),html:_.replace("{total}",nt)}),I&&t(u,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",r?.originalPrice),html:I})]}),z&&t(u,{size:2,as:"h6",className:o("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",r?.saveAmount),html:tt.replace("{amount}",z)})]}),t(Lt,{disabled:!g,loading:A,onClick:async()=>{if(!A){B(!0);try{await F?.(s)}finally{B(!1)}}},className:o("mini-cart-action-button whitespace-nowrap",r?.actionButton),children:J})]})]})})});G.displayName="MiniCart";var Vt=G;export{Vt as default,Tt as resolveCartLineLabelStyle};
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -614,6 +614,9 @@ video {
|
|
|
614
614
|
.bottom-0 {
|
|
615
615
|
bottom: 0px;
|
|
616
616
|
}
|
|
617
|
+
.bottom-2 {
|
|
618
|
+
bottom: 0.5rem;
|
|
619
|
+
}
|
|
617
620
|
.bottom-4 {
|
|
618
621
|
bottom: 1rem;
|
|
619
622
|
}
|
|
@@ -1699,6 +1702,9 @@ video {
|
|
|
1699
1702
|
.\!max-h-none {
|
|
1700
1703
|
max-height: none !important;
|
|
1701
1704
|
}
|
|
1705
|
+
.max-h-4 {
|
|
1706
|
+
max-height: 1rem;
|
|
1707
|
+
}
|
|
1702
1708
|
.max-h-\[126px\] {
|
|
1703
1709
|
max-height: 126px;
|
|
1704
1710
|
}
|
|
@@ -1996,6 +2002,9 @@ video {
|
|
|
1996
2002
|
.min-w-32 {
|
|
1997
2003
|
min-width: 8rem;
|
|
1998
2004
|
}
|
|
2005
|
+
.min-w-4 {
|
|
2006
|
+
min-width: 1rem;
|
|
2007
|
+
}
|
|
1999
2008
|
.min-w-5 {
|
|
2000
2009
|
min-width: 1.25rem;
|
|
2001
2010
|
}
|
|
@@ -2723,9 +2732,9 @@ video {
|
|
|
2723
2732
|
border-bottom-right-radius: var(--box-radius);
|
|
2724
2733
|
border-bottom-left-radius: var(--box-radius);
|
|
2725
2734
|
}
|
|
2726
|
-
.rounded-b-
|
|
2727
|
-
border-bottom-right-radius:
|
|
2728
|
-
border-bottom-left-radius:
|
|
2735
|
+
.rounded-b-box-small {
|
|
2736
|
+
border-bottom-right-radius: var(--box-radius-small);
|
|
2737
|
+
border-bottom-left-radius: var(--box-radius-small);
|
|
2729
2738
|
}
|
|
2730
2739
|
.rounded-b-none {
|
|
2731
2740
|
border-bottom-right-radius: 0px;
|
|
@@ -3965,6 +3974,9 @@ video {
|
|
|
3965
3974
|
.leading-\[140\%\] {
|
|
3966
3975
|
line-height: 140%;
|
|
3967
3976
|
}
|
|
3977
|
+
.leading-\[16px\] {
|
|
3978
|
+
line-height: 16px;
|
|
3979
|
+
}
|
|
3968
3980
|
.leading-\[24px\] {
|
|
3969
3981
|
line-height: 24px;
|
|
3970
3982
|
}
|
|
@@ -6654,6 +6666,9 @@ video {
|
|
|
6654
6666
|
.laptop\:w-\[128px\] {
|
|
6655
6667
|
width: 128px;
|
|
6656
6668
|
}
|
|
6669
|
+
.laptop\:w-\[156px\] {
|
|
6670
|
+
width: 156px;
|
|
6671
|
+
}
|
|
6657
6672
|
.laptop\:w-\[160px\] {
|
|
6658
6673
|
width: 160px;
|
|
6659
6674
|
}
|
|
@@ -6663,9 +6678,6 @@ video {
|
|
|
6663
6678
|
.laptop\:w-\[232px\] {
|
|
6664
6679
|
width: 232px;
|
|
6665
6680
|
}
|
|
6666
|
-
.laptop\:w-\[256px\] {
|
|
6667
|
-
width: 256px;
|
|
6668
|
-
}
|
|
6669
6681
|
.laptop\:w-\[27\%\] {
|
|
6670
6682
|
width: 27%;
|
|
6671
6683
|
}
|
|
@@ -7785,6 +7797,9 @@ video {
|
|
|
7785
7797
|
.desktop\:w-\[160px\] {
|
|
7786
7798
|
width: 160px;
|
|
7787
7799
|
}
|
|
7800
|
+
.desktop\:w-\[256px\] {
|
|
7801
|
+
width: 256px;
|
|
7802
|
+
}
|
|
7788
7803
|
.desktop\:w-\[32\%\] {
|
|
7789
7804
|
width: 32%;
|
|
7790
7805
|
}
|