@@ -7,6 +7,7 @@ import { Link } from "~/components/link";
77import {
88 getCartMutationError ,
99 getCartMutationWarning ,
10+ getCartQuantityError ,
1011 getCartQuantityWarning ,
1112} from "~/utils/cart-error" ;
1213import { cn } from "~/utils/cn" ;
@@ -315,7 +316,7 @@ function CartLineItem({
315316 to = { lineItemUrl }
316317 prefetch = "intent"
317318 onClick = { onClose }
318- className = "size-26 shrink-0 overflow-hidden rounded-sm"
319+ className = "size-26 shrink-0 self-start overflow-hidden rounded-sm"
319320 >
320321 < Image
321322 alt = { merchandise . product . title }
@@ -462,7 +463,7 @@ function CartLineQuantity({
462463 const updateWarning = useCartStore ( ( state ) =>
463464 state . lineUpdateWarnings . get ( lineId ) ,
464465 ) ;
465- const errorMessage = getCartMutationError ( updateError ) ;
466+ const errorMessage = getCartQuantityError ( updateError ) ;
466467 const warningMessage = getCartQuantityWarning (
467468 updateWarning ,
468469 t ( "cart.outOfPurchaseLimit" ) ,
@@ -538,16 +539,13 @@ function CartLineQuantity({
538539 < fieldset
539540 aria-label = { `${ t ( "product.quantity" ) } , ${ optimisticQuantity } ` }
540541 className = { cn (
541- "flex w-fit items-center border border-border rounded-2xl h-10 " ,
542- layout === "page" && "gap-2 bg-background-basic md:row-start-2" ,
542+ "flex h-10 w-fit items-center gap-1 rounded-2xl border border-border bg-background-basic " ,
543+ layout === "page" && "md:row-start-2" ,
543544 ) }
544545 >
545546 < button
546547 type = "button"
547- className = { cn (
548- "flex items-center justify-center disabled:cursor-not-allowed disabled:opacity-50" ,
549- layout === "aside" ? "size-10" : "h-10 w-11" ,
550- ) }
548+ className = "flex h-10 shrink-0 items-center justify-center px-3.5 py-2.5 disabled:cursor-not-allowed disabled:opacity-50"
551549 aria-label = { t ( "product.decreaseQuantity" ) }
552550 disabled = {
553551 getValidInputQuantity ( ) <= 1 || isOptimistic || isQuantityUpdating
@@ -556,17 +554,16 @@ function CartLineQuantity({
556554 onMouseDown = { ( event ) => event . preventDefault ( ) }
557555 onClick = { ( ) => stepQuantity ( - 1 ) }
558556 >
559- < span className = "translate-y-px" > −</ span >
557+ < span className = "flex size-4 items-center justify-center leading-none" >
558+ −
559+ </ span >
560560 </ button >
561561 < input
562562 type = "text"
563563 inputMode = "numeric"
564564 pattern = "[0-9]*"
565565 aria-label = { t ( "product.quantity" ) }
566- className = { cn (
567- "translate-y-px appearance-none border-0 bg-transparent p-0 text-center font-body text-sm leading-none font-normal tracking-[-0.14px] text-text outline-none focus:ring-0 disabled:cursor-not-allowed" ,
568- layout === "aside" ? "w-8 min-w-8" : "w-[26px] min-w-[26px]" ,
569- ) }
566+ className = "field-sizing-content h-10 min-w-7 max-w-12 appearance-none border-0 bg-transparent p-0 text-center font-body !text-[14px] leading-none font-normal tracking-[-0.14px] text-text outline-none focus:ring-0 disabled:cursor-not-allowed"
570567 value = { quantityInput }
571568 disabled = { isOptimistic || isQuantityUpdating }
572569 onChange = { ( event ) => {
@@ -587,17 +584,16 @@ function CartLineQuantity({
587584 />
588585 < button
589586 type = "button"
590- className = { cn (
591- "flex items-center justify-center disabled:cursor-not-allowed disabled:opacity-50" ,
592- layout === "aside" ? "size-10" : "h-10 w-11" ,
593- ) }
587+ className = "flex h-10 shrink-0 items-center justify-center px-3.5 py-2.5 disabled:cursor-not-allowed disabled:opacity-50"
594588 aria-label = { t ( "product.increaseQuantity" ) }
595589 disabled = { isOptimistic || isQuantityUpdating }
596590 name = "increase-quantity"
597591 onMouseDown = { ( event ) => event . preventDefault ( ) }
598592 onClick = { ( ) => stepQuantity ( 1 ) }
599593 >
600- < span className = "translate-y-px" > +</ span >
594+ < span className = "flex size-4 items-center justify-center leading-none" >
595+ +
596+ </ span >
601597 </ button >
602598 </ fieldset >
603599 { quantityMessage && (
0 commit comments