@cimplify/sdk 0.44.8 → 0.44.11

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/react.js CHANGED
@@ -6448,113 +6448,161 @@ function CartLineItemRow({
6448
6448
  const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
6449
6449
  const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
6450
6450
  const isOptimistic = item.isOptimistic === true;
6451
+ const lineTotal = chunkV2O5AO7I_js.parsePrice(unitPrice) * item.quantity;
6452
+ const imageUrl = item.product.image_url;
6453
+ const variantLabel = item.variant ? chunkBGCEKFLA_js.getVariantDisplayName(item.variant, item.product.name) : null;
6451
6454
  return /* @__PURE__ */ jsxRuntime.jsxs(
6452
6455
  "div",
6453
6456
  {
6454
6457
  "data-cimplify-cart-item": true,
6455
6458
  "data-optimistic": isOptimistic ? "true" : void 0,
6456
6459
  className: cn(
6457
- "flex items-start justify-between gap-4 py-4 border-b border-border last:border-b-0",
6460
+ "group relative flex gap-3 py-4 border-b border-border last:border-b-0 transition-opacity",
6461
+ isOptimistic && "opacity-60",
6458
6462
  classNames?.item
6459
6463
  ),
6460
6464
  children: [
6461
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-item-info": true, className: "flex-1 min-w-0 space-y-1", children: [
6462
- /* @__PURE__ */ jsxRuntime.jsx(
6463
- "span",
6465
+ /* @__PURE__ */ jsxRuntime.jsx(
6466
+ "div",
6467
+ {
6468
+ "data-cimplify-cart-item-image": true,
6469
+ className: "relative w-20 h-20 shrink-0 rounded-md overflow-hidden bg-muted",
6470
+ children: imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(
6471
+ "img",
6472
+ {
6473
+ src: imageUrl,
6474
+ alt: "",
6475
+ className: "w-full h-full object-cover",
6476
+ loading: "lazy"
6477
+ }
6478
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full grid place-items-center text-muted-foreground/40", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z" }) }) })
6479
+ }
6480
+ ),
6481
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-item-info": true, className: "flex-1 min-w-0 flex flex-col", children: [
6482
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
6483
+ /* @__PURE__ */ jsxRuntime.jsx(
6484
+ "h3",
6485
+ {
6486
+ "data-cimplify-cart-item-name": true,
6487
+ className: cn("text-sm font-medium leading-tight m-0 truncate", classNames?.itemName),
6488
+ children: item.product.name
6489
+ }
6490
+ ),
6491
+ /* @__PURE__ */ jsxRuntime.jsx(
6492
+ "button",
6493
+ {
6494
+ type: "button",
6495
+ onClick: () => onRemove(item.id),
6496
+ "data-cimplify-cart-item-remove": true,
6497
+ className: cn(
6498
+ "shrink-0 -mr-1 -mt-1 grid place-items-center w-7 h-7 rounded-full text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors",
6499
+ classNames?.removeButton
6500
+ ),
6501
+ "aria-label": `Remove ${item.product.name}`,
6502
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
6503
+ }
6504
+ )
6505
+ ] }),
6506
+ (variantLabel || item.addOnOptions && item.addOnOptions.length > 0 || hasComposite || hasBundle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-item-pills": true, className: "flex flex-wrap gap-1.5 mt-1.5", children: [
6507
+ variantLabel && /* @__PURE__ */ jsxRuntime.jsx(
6508
+ "span",
6509
+ {
6510
+ "data-cimplify-cart-item-variant": true,
6511
+ className: "inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-[11px] font-medium text-foreground",
6512
+ children: variantLabel
6513
+ }
6514
+ ),
6515
+ item.addOnOptions?.map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
6516
+ "span",
6517
+ {
6518
+ "data-cimplify-cart-item-addon": true,
6519
+ className: "inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-[11px] font-medium text-muted-foreground",
6520
+ children: [
6521
+ "+ ",
6522
+ opt.name
6523
+ ]
6524
+ },
6525
+ opt.id
6526
+ )),
6527
+ (hasComposite || hasBundle) && /* @__PURE__ */ jsxRuntime.jsx(
6528
+ "span",
6529
+ {
6530
+ "data-cimplify-cart-item-badge": true,
6531
+ className: "inline-flex items-center px-2 py-0.5 rounded-full bg-primary/10 text-[11px] font-semibold uppercase tracking-wider text-primary",
6532
+ children: hasComposite ? "Custom" : "Bundle"
6533
+ }
6534
+ )
6535
+ ] }),
6536
+ item.specialInstructions && /* @__PURE__ */ jsxRuntime.jsxs(
6537
+ "p",
6464
6538
  {
6465
- "data-cimplify-cart-item-name": true,
6466
- className: cn("block font-medium", classNames?.itemName),
6467
- children: item.product.name
6539
+ "data-cimplify-cart-item-instructions": true,
6540
+ className: "mt-1.5 text-xs italic text-muted-foreground line-clamp-2",
6541
+ children: [
6542
+ "\\u201C",
6543
+ item.specialInstructions,
6544
+ "\\u201D"
6545
+ ]
6468
6546
  }
6469
6547
  ),
6470
- item.variant && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-item-variant": true, className: "block text-xs text-muted-foreground", children: chunkBGCEKFLA_js.getVariantDisplayName(item.variant, item.product.name) }),
6471
- item.addOnOptions && item.addOnOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-cart-item-addons": true, className: "block text-xs text-muted-foreground", children: [
6472
- "+ ",
6473
- item.addOnOptions.map((opt) => opt.name).join(", ")
6474
- ] }),
6475
- (hasComposite || hasBundle) && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-item-badge": true, children: hasComposite ? "Custom" : "Bundle" }),
6476
- item.specialInstructions && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-item-instructions": true, className: "text-xs text-muted-foreground", children: item.specialInstructions }),
6477
- item.customerInputs && item.customerInputs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-customer-inputs": true, className: classNames?.customerInputs, children: item.customerInputs.map((input) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-input": true, children: [
6478
- /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-input-label": true, children: input.field_name }),
6479
- /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-input-value": true, children: input.field_type === chunkBGCEKFLA_js.INPUT_FIELD_TYPE.File || input.field_type === chunkBGCEKFLA_js.INPUT_FIELD_TYPE.Image ? String(input.value).split("/").pop() || "Uploaded file" : String(input.value) })
6548
+ item.customerInputs && item.customerInputs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("dl", { "data-cimplify-cart-customer-inputs": true, className: cn("mt-1.5 text-xs space-y-0.5", classNames?.customerInputs), children: item.customerInputs.map((input) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-input": true, className: "flex gap-1.5", children: [
6549
+ /* @__PURE__ */ jsxRuntime.jsxs("dt", { "data-cimplify-cart-input-label": true, className: "text-muted-foreground", children: [
6550
+ input.field_name,
6551
+ ":"
6552
+ ] }),
6553
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { "data-cimplify-cart-input-value": true, className: "text-foreground m-0 truncate", children: input.field_type === chunkBGCEKFLA_js.INPUT_FIELD_TYPE.File || input.field_type === chunkBGCEKFLA_js.INPUT_FIELD_TYPE.Image ? String(input.value).split("/").pop() || "Uploaded file" : String(input.value) })
6480
6554
  ] }, input.field_id)) }),
6481
- (item.lineType === "service" || item.product.type === "service") && item.scheduledStart && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-info": true, className: classNames?.serviceInfo, children: [
6555
+ (item.lineType === "service" || item.product.type === "service") && item.scheduledStart && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-info": true, className: cn("mt-1.5 flex items-center gap-1.5 text-xs text-muted-foreground", classNames?.serviceInfo), children: [
6556
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }),
6482
6557
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6483
- "\u{1F4C5}",
6558
+ new Date(item.scheduledStart).toLocaleDateString(void 0, { month: "short", day: "numeric" }),
6559
+ " at",
6484
6560
  " ",
6485
- new Date(item.scheduledStart).toLocaleDateString(),
6486
- " at ",
6487
6561
  new Date(item.scheduledStart).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
6488
6562
  ] }),
6489
- item.confirmationCode && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6490
- "Confirmation: ",
6491
- item.confirmationCode
6492
- ] }),
6493
- item.serviceStatus && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-status": item.serviceStatus, children: item.serviceStatus })
6563
+ item.serviceStatus && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-status": item.serviceStatus, className: "ml-auto px-1.5 py-0.5 rounded-full bg-muted text-[10px] uppercase tracking-wider", children: item.serviceStatus })
6494
6564
  ] }),
6495
- (item.lineType === "digital" || item.product.type === "digital") && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-digital-info": true, className: classNames?.digitalInfo, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6496
- "\u26A1",
6497
- " Instant digital delivery"
6498
- ] }) }),
6499
- item.bundleResolved && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-bundle-breakdown": true, className: classNames?.bundleBreakdown, children: item.bundleResolved.selections.map((sel) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-product-type": sel.product_type, children: [
6500
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6501
- sel.quantity,
6502
- "\xD7 ",
6503
- sel.product_name
6504
- ] }),
6505
- sel.product_type === "service" && sel.scheduling?.scheduled_start && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6506
- " \u2014 ",
6507
- new Date(sel.scheduling.scheduled_start).toLocaleDateString()
6508
- ] }),
6509
- sel.product_type === "digital" && /* @__PURE__ */ jsxRuntime.jsx("span", { children: " \u2014 Digital" })
6510
- ] }, sel.component_id)) }),
6511
- item.compositeResolved && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-composite-breakdown": true, className: classNames?.compositeBreakdown, children: item.compositeResolved.selections.map((sel) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-product-type": sel.product_type, children: [
6512
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6513
- sel.quantity,
6514
- "\xD7 ",
6515
- sel.component_name
6516
- ] }),
6517
- sel.product_type === "service" && sel.scheduling?.scheduled_start && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6518
- " \u2014 ",
6519
- new Date(sel.scheduling.scheduled_start).toLocaleDateString()
6520
- ] })
6521
- ] }, sel.component_id)) }),
6522
- /* @__PURE__ */ jsxRuntime.jsx(
6523
- Price,
6565
+ (item.lineType === "digital" || item.product.type === "digital") && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-digital-info": true, className: cn("mt-1.5 flex items-center gap-1 text-xs text-muted-foreground", classNames?.digitalInfo), children: [
6566
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }),
6567
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Instant digital delivery" })
6568
+ ] }),
6569
+ (item.bundleResolved || item.compositeResolved) && /* @__PURE__ */ jsxRuntime.jsx(
6570
+ "ul",
6524
6571
  {
6525
- amount: unitPrice,
6526
- className: cn("block pt-1 text-sm font-semibold", classNames?.itemPrice)
6572
+ "data-cimplify-cart-composite-breakdown": item.compositeResolved ? "" : void 0,
6573
+ "data-cimplify-cart-bundle-breakdown": item.bundleResolved ? "" : void 0,
6574
+ className: cn("mt-1.5 pl-3 border-l border-border space-y-0.5 text-xs text-muted-foreground", item.compositeResolved ? classNames?.compositeBreakdown : classNames?.bundleBreakdown),
6575
+ children: (item.bundleResolved?.selections ?? item.compositeResolved?.selections ?? []).map((sel) => {
6576
+ const name = sel.product_name ?? sel.component_name ?? "";
6577
+ const compId = sel.component_id ?? `${name}-${sel.quantity}`;
6578
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { "data-product-type": sel.product_type, className: "flex items-baseline gap-1.5 m-0", children: [
6579
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium text-foreground/80", children: [
6580
+ sel.quantity,
6581
+ "\\u00D7"
6582
+ ] }),
6583
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: name })
6584
+ ] }, compId);
6585
+ })
6527
6586
  }
6528
- )
6529
- ] }),
6530
- /* @__PURE__ */ jsxRuntime.jsxs(
6531
- "div",
6532
- {
6533
- "data-cimplify-cart-item-controls": true,
6534
- className: cn("flex flex-col items-end gap-2 shrink-0", classNames?.quantity),
6535
- children: [
6536
- /* @__PURE__ */ jsxRuntime.jsx(
6537
- QuantitySelector,
6538
- {
6539
- value: item.quantity,
6540
- onChange: (qty) => onQuantityChange(item.id, qty),
6541
- min: 0
6542
- }
6543
- ),
6544
- /* @__PURE__ */ jsxRuntime.jsx(
6545
- "button",
6546
- {
6547
- type: "button",
6548
- onClick: () => onRemove(item.id),
6549
- "data-cimplify-cart-item-remove": true,
6550
- className: cn("text-xs text-muted-foreground hover:text-foreground hover:underline transition-colors", classNames?.removeButton),
6551
- "aria-label": `Remove ${item.product.name}`,
6552
- children: "Remove"
6553
- }
6554
- )
6555
- ]
6556
- }
6557
- )
6587
+ ),
6588
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-center justify-between gap-3", children: [
6589
+ /* @__PURE__ */ jsxRuntime.jsx(
6590
+ Price,
6591
+ {
6592
+ amount: lineTotal,
6593
+ className: cn("text-sm font-semibold tabular-nums", classNames?.itemPrice)
6594
+ }
6595
+ ),
6596
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-item-controls": true, className: classNames?.quantity, children: /* @__PURE__ */ jsxRuntime.jsx(
6597
+ QuantitySelector,
6598
+ {
6599
+ value: item.quantity,
6600
+ onChange: (qty) => onQuantityChange(item.id, qty),
6601
+ min: 0
6602
+ }
6603
+ ) })
6604
+ ] })
6605
+ ] })
6558
6606
  ]
6559
6607
  }
6560
6608
  );
@@ -6565,6 +6613,8 @@ function CartSummary({
6565
6613
  onItemRemove,
6566
6614
  onQuantityChange,
6567
6615
  emptyMessage = "Your cart is empty",
6616
+ showTotals = true,
6617
+ showCheckoutButton,
6568
6618
  className,
6569
6619
  classNames
6570
6620
  }) {
@@ -6615,45 +6665,55 @@ function CartSummary({
6615
6665
  },
6616
6666
  item.id
6617
6667
  )) }),
6618
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-totals": true, className: classNames?.totals, children: [
6619
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-subtotal": true, className: classNames?.subtotal, children: [
6620
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6621
- "Subtotal (",
6622
- itemCount,
6623
- " ",
6624
- itemCount === 1 ? "item" : "items",
6625
- ")"
6626
- ] }),
6627
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal })
6628
- ] }),
6629
- totalDiscounts != null && chunkV2O5AO7I_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: classNames?.discount, children: [
6630
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
6631
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: totalDiscounts, prefix: "-" })
6632
- ] }),
6633
- deliveryFee != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-delivery-fee": true, className: classNames?.deliveryFee, children: [
6634
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
6635
- chunkV2O5AO7I_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Free delivery" })
6636
- ] }),
6637
- serviceCharge != null && chunkV2O5AO7I_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: classNames?.serviceCharge, children: [
6638
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
6639
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: serviceCharge })
6640
- ] }),
6641
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-tax": true, className: classNames?.tax, children: [
6642
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
6643
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: tax })
6644
- ] }),
6645
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-total": true, className: classNames?.total, children: [
6646
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Total" }),
6647
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: total })
6648
- ] })
6649
- ] }),
6650
- onCheckout && /* @__PURE__ */ jsxRuntime.jsx(
6668
+ showTotals && /* @__PURE__ */ jsxRuntime.jsxs(
6669
+ "div",
6670
+ {
6671
+ "data-cimplify-cart-totals": true,
6672
+ className: cn("mt-6 pt-4 border-t border-border space-y-2 text-sm", classNames?.totals),
6673
+ children: [
6674
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-subtotal": true, className: cn("flex items-baseline justify-between", classNames?.subtotal), children: [
6675
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
6676
+ "Subtotal (",
6677
+ itemCount,
6678
+ " ",
6679
+ itemCount === 1 ? "item" : "items",
6680
+ ")"
6681
+ ] }),
6682
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal, className: "tabular-nums" })
6683
+ ] }),
6684
+ totalDiscounts != null && chunkV2O5AO7I_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: cn("flex items-baseline justify-between", classNames?.discount), children: [
6685
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Discount" }),
6686
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: totalDiscounts, prefix: "-", className: "tabular-nums text-primary" })
6687
+ ] }),
6688
+ deliveryFee != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-delivery-fee": true, className: cn("flex items-baseline justify-between", classNames?.deliveryFee), children: [
6689
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
6690
+ chunkV2O5AO7I_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee, className: "tabular-nums" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "Free" })
6691
+ ] }),
6692
+ serviceCharge != null && chunkV2O5AO7I_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: cn("flex items-baseline justify-between", classNames?.serviceCharge), children: [
6693
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Service charge" }),
6694
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: serviceCharge, className: "tabular-nums" })
6695
+ ] }),
6696
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-tax": true, className: cn("flex items-baseline justify-between", classNames?.tax), children: [
6697
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Tax" }),
6698
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: tax, className: "tabular-nums" })
6699
+ ] }),
6700
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-total": true, className: cn("flex items-baseline justify-between pt-3 mt-1 border-t border-border", classNames?.total), children: [
6701
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Total" }),
6702
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: total, className: "text-base font-bold tabular-nums" })
6703
+ ] })
6704
+ ]
6705
+ }
6706
+ ),
6707
+ (showCheckoutButton ?? Boolean(onCheckout)) && onCheckout && /* @__PURE__ */ jsxRuntime.jsx(
6651
6708
  "button",
6652
6709
  {
6653
6710
  type: "button",
6654
6711
  onClick: onCheckout,
6655
6712
  "data-cimplify-cart-checkout": true,
6656
- className: classNames?.checkout,
6713
+ className: cn(
6714
+ "mt-4 w-full h-12 rounded-full bg-foreground text-background font-semibold text-sm hover:bg-foreground/90 active:scale-[0.99] transition-all",
6715
+ classNames?.checkout
6716
+ ),
6657
6717
  children: "Proceed to Checkout"
6658
6718
  }
6659
6719
  )
@@ -10689,42 +10749,65 @@ function DefaultCartLayout({
10689
10749
  className
10690
10750
  }) {
10691
10751
  if (cart.isEmpty) {
10692
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("text-center py-20", className), children: [
10693
- /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-16 h-16 mx-auto text-muted-foreground/30", fill: "none", stroke: "currentColor", strokeWidth: "1", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" }) }),
10694
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-medium mt-4", children: "Your cart is empty" }),
10695
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Add some items to get started" }),
10696
- onContinueShopping && /* @__PURE__ */ jsxRuntime.jsx(
10752
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("max-w-md mx-auto text-center py-24", className), children: [
10753
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-24 h-24 mx-auto mb-6", children: [
10754
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-muted" }),
10755
+ /* @__PURE__ */ jsxRuntime.jsx(
10756
+ "svg",
10757
+ {
10758
+ className: "relative w-12 h-12 m-auto top-1/2 -translate-y-1/2 text-muted-foreground/60",
10759
+ fill: "none",
10760
+ stroke: "currentColor",
10761
+ strokeWidth: "1.5",
10762
+ viewBox: "0 0 24 24",
10763
+ "aria-hidden": true,
10764
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l-1 12H6L5 9z" })
10765
+ }
10766
+ )
10767
+ ] }),
10768
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold tracking-tight m-0", children: "Your cart is empty" }),
10769
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-2", children: "Browse the shop and add something you'll love." }),
10770
+ onContinueShopping && /* @__PURE__ */ jsxRuntime.jsxs(
10697
10771
  "button",
10698
10772
  {
10773
+ type: "button",
10699
10774
  onClick: onContinueShopping,
10700
- className: "text-sm font-medium text-primary mt-4 hover:underline",
10701
- children: "Continue shopping"
10775
+ className: "mt-6 inline-flex items-center gap-1.5 h-11 px-6 rounded-full bg-foreground text-background text-sm font-semibold hover:bg-foreground/90 active:scale-[0.99] transition-all",
10776
+ children: [
10777
+ "Shop now",
10778
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2.5", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14 5l7 7m0 0l-7 7m7-7H3" }) })
10779
+ ]
10702
10780
  }
10703
10781
  )
10704
10782
  ] });
10705
10783
  }
10706
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("space-y-6", className), children: [
10707
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
10708
- /* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "text-2xl font-bold tracking-tight", children: [
10709
- "Your Cart (",
10784
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("space-y-8", className), children: [
10785
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex items-baseline justify-between gap-4", children: [
10786
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl sm:text-4xl font-bold tracking-tight m-0", children: "Cart" }),
10787
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground tabular-nums", children: [
10710
10788
  cart.itemCount,
10711
10789
  " ",
10712
- cart.itemCount === 1 ? "item" : "items",
10713
- ")"
10714
- ] }),
10715
- onContinueShopping && /* @__PURE__ */ jsxRuntime.jsx(
10716
- "button",
10717
- {
10718
- onClick: onContinueShopping,
10719
- className: "text-sm text-muted-foreground hover:text-foreground transition-colors",
10720
- children: "Continue shopping"
10721
- }
10722
- )
10790
+ cart.itemCount === 1 ? "item" : "items"
10791
+ ] })
10723
10792
  ] }),
10724
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid lg:grid-cols-[1fr_380px] gap-8", children: [
10725
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(CartSummary, {}) }),
10726
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:sticky lg:top-6 h-fit space-y-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-border rounded-[14px] p-6 space-y-4", children: [
10727
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold", children: "Order Summary" }),
10793
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid lg:grid-cols-[1fr_360px] gap-10", children: [
10794
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10795
+ /* @__PURE__ */ jsxRuntime.jsx(CartSummary, { showTotals: false, showCheckoutButton: false }),
10796
+ onContinueShopping && /* @__PURE__ */ jsxRuntime.jsxs(
10797
+ "button",
10798
+ {
10799
+ type: "button",
10800
+ onClick: onContinueShopping,
10801
+ className: "mt-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",
10802
+ children: [
10803
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2.5", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }),
10804
+ "Continue shopping"
10805
+ ]
10806
+ }
10807
+ )
10808
+ ] }),
10809
+ /* @__PURE__ */ jsxRuntime.jsx("aside", { className: "lg:sticky lg:top-6 h-fit", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl bg-muted/40 p-6 space-y-5", children: [
10810
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold uppercase tracking-[0.16em] text-muted-foreground m-0", children: "Summary" }),
10728
10811
  showDiscount && /* @__PURE__ */ jsxRuntime.jsx(
10729
10812
  DiscountInput,
10730
10813
  {
@@ -10733,28 +10816,34 @@ function DefaultCartLayout({
10733
10816
  onClear: onDiscountClear
10734
10817
  }
10735
10818
  ),
10736
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 text-sm", children: [
10737
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
10738
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Subtotal" }),
10739
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.subtotal })
10819
+ /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "space-y-2 text-sm", children: [
10820
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between", children: [
10821
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: "Subtotal" }),
10822
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.subtotal }) })
10740
10823
  ] }),
10741
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
10742
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Tax" }),
10743
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.tax })
10824
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between", children: [
10825
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: "Tax" }),
10826
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.tax }) })
10744
10827
  ] }),
10745
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between font-semibold text-base pt-2 border-t border-border", children: [
10746
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Total" }),
10747
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.total })
10828
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between pt-3 mt-1 border-t border-border", children: [
10829
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "font-semibold", children: "Total" }),
10830
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 text-lg font-bold tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.total }) })
10748
10831
  ] })
10749
10832
  ] }),
10833
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-muted-foreground", children: "Shipping calculated at checkout." }),
10750
10834
  /* @__PURE__ */ jsxRuntime.jsx(
10751
10835
  "button",
10752
10836
  {
10837
+ type: "button",
10753
10838
  onClick: onCheckout,
10754
- className: "w-full h-12 bg-foreground text-background font-medium text-sm rounded-lg hover:bg-foreground/90 transition-colors",
10839
+ className: "w-full h-12 rounded-full bg-foreground text-background font-semibold text-sm hover:bg-foreground/90 active:scale-[0.99] transition-all",
10755
10840
  children: checkoutLabel
10756
10841
  }
10757
- )
10842
+ ),
10843
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-1.5 text-[10px] text-muted-foreground/70 uppercase tracking-wider", children: [
10844
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }),
10845
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Secure checkout" })
10846
+ ] })
10758
10847
  ] }) })
10759
10848
  ] })
10760
10849
  ] });
@@ -10851,28 +10940,52 @@ function useCartDrawer() {
10851
10940
  function CartDrawerProvider({ children, openOnAdd = true }) {
10852
10941
  const [isOpen, setIsOpen] = React10.useState(false);
10853
10942
  const cart = useCart();
10854
- const [lastPending, setLastPending] = React10.useState(0);
10943
+ const lastPendingRef = React10.useRef(0);
10855
10944
  const open = React10.useCallback(() => setIsOpen(true), []);
10856
10945
  const close = React10.useCallback(() => setIsOpen(false), []);
10857
10946
  const toggle = React10.useCallback(() => setIsOpen((v) => !v), []);
10858
10947
  React10.useEffect(() => {
10859
10948
  if (!openOnAdd) return;
10860
- if (cart.pendingOpCount > lastPending && cart.pendingOpCount > 0) {
10949
+ if (cart.pendingOpCount > lastPendingRef.current && cart.pendingOpCount > 0) {
10861
10950
  setIsOpen(true);
10862
10951
  }
10863
- setLastPending(cart.pendingOpCount);
10864
- }, [cart.pendingOpCount, lastPending, openOnAdd]);
10952
+ lastPendingRef.current = cart.pendingOpCount;
10953
+ }, [cart.pendingOpCount, openOnAdd]);
10865
10954
  const value = React10.useMemo(() => ({ isOpen, open, close, toggle }), [isOpen, open, close, toggle]);
10866
10955
  return /* @__PURE__ */ jsxRuntime.jsx(CartDrawerContext.Provider, { value, children });
10867
10956
  }
10957
+ function useAnimatedNumber(target, durationMs = 250) {
10958
+ const [value, setValue] = React10.useState(target);
10959
+ const fromRef = React10.useRef(target);
10960
+ const startRef = React10.useRef(null);
10961
+ React10.useEffect(() => {
10962
+ fromRef.current = value;
10963
+ startRef.current = null;
10964
+ let raf = 0;
10965
+ const tick = (t) => {
10966
+ if (startRef.current == null) startRef.current = t;
10967
+ const p = Math.min(1, (t - startRef.current) / durationMs);
10968
+ const eased = 1 - Math.pow(1 - p, 3);
10969
+ setValue(fromRef.current + (target - fromRef.current) * eased);
10970
+ if (p < 1) raf = requestAnimationFrame(tick);
10971
+ };
10972
+ raf = requestAnimationFrame(tick);
10973
+ return () => cancelAnimationFrame(raf);
10974
+ }, [target, durationMs]);
10975
+ return value;
10976
+ }
10868
10977
  function CartDrawer({
10869
10978
  onCheckout,
10870
10979
  onContinueShopping,
10871
- title = "Your cart",
10980
+ onShop,
10981
+ title = "Cart",
10982
+ freeShippingThreshold = 0,
10872
10983
  className
10873
10984
  }) {
10874
10985
  const { isOpen, close } = useCartDrawer();
10875
10986
  const cart = useCart();
10987
+ const subtotalNum = chunkV2O5AO7I_js.parsePrice(cart.subtotal);
10988
+ const animatedSubtotal = useAnimatedNumber(subtotalNum);
10876
10989
  React10.useEffect(() => {
10877
10990
  if (!isOpen) return;
10878
10991
  const original = document.body.style.overflow;
@@ -10891,11 +11004,17 @@ function CartDrawer({
10891
11004
  onCheckout?.();
10892
11005
  };
10893
11006
  const handleContinue = () => {
10894
- if (onContinueShopping) {
10895
- onContinueShopping();
10896
- }
11007
+ onContinueShopping?.();
11008
+ close();
11009
+ };
11010
+ const handleShop = () => {
11011
+ onShop?.();
10897
11012
  close();
10898
11013
  };
11014
+ const showShippingBar = freeShippingThreshold > 0 && !cart.isEmpty;
11015
+ const remainingForShipping = Math.max(0, freeShippingThreshold - subtotalNum);
11016
+ const shippingProgress = freeShippingThreshold > 0 ? Math.min(100, subtotalNum / freeShippingThreshold * 100) : 0;
11017
+ const shippingUnlocked = subtotalNum >= freeShippingThreshold && freeShippingThreshold > 0;
10899
11018
  return /* @__PURE__ */ jsxRuntime.jsxs(
10900
11019
  "div",
10901
11020
  {
@@ -10912,7 +11031,7 @@ function CartDrawer({
10912
11031
  {
10913
11032
  onClick: close,
10914
11033
  className: cn(
10915
- "absolute inset-0 bg-foreground/40 backdrop-blur-sm transition-opacity duration-200",
11034
+ "absolute inset-0 bg-foreground/40 backdrop-blur-sm transition-opacity duration-300",
10916
11035
  isOpen ? "opacity-100" : "opacity-0"
10917
11036
  )
10918
11037
  }
@@ -10924,20 +11043,21 @@ function CartDrawer({
10924
11043
  "aria-modal": "true",
10925
11044
  "aria-label": title,
10926
11045
  className: cn(
10927
- "absolute top-0 right-0 h-full w-full sm:max-w-md bg-background shadow-2xl flex flex-col transition-transform duration-300 ease-out",
11046
+ "absolute top-0 right-0 h-full w-full sm:max-w-[480px] bg-background shadow-2xl flex flex-col",
11047
+ "transition-transform duration-300",
10928
11048
  isOpen ? "translate-x-0" : "translate-x-full",
11049
+ // ease-out cubic-bezier for a "pull" feel
11050
+ "[transition-timing-function:cubic-bezier(0.16,1,0.3,1)]",
10929
11051
  className
10930
11052
  ),
10931
11053
  children: [
10932
- /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex items-center justify-between gap-4 px-6 py-4 border-b border-border shrink-0", children: [
10933
- /* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "text-base font-semibold tracking-tight m-0", children: [
10934
- title,
10935
- cart.itemCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-2 text-muted-foreground font-normal", children: [
10936
- "(",
11054
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "relative flex items-center justify-between gap-4 px-6 py-5 shrink-0", children: [
11055
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2", children: [
11056
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold tracking-tight m-0", children: title }),
11057
+ cart.itemCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground tabular-nums", children: [
10937
11058
  cart.itemCount,
10938
11059
  " ",
10939
- cart.itemCount === 1 ? "item" : "items",
10940
- ")"
11060
+ cart.itemCount === 1 ? "item" : "items"
10941
11061
  ] })
10942
11062
  ] }),
10943
11063
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -10946,52 +11066,55 @@ function CartDrawer({
10946
11066
  type: "button",
10947
11067
  onClick: close,
10948
11068
  "aria-label": "Close cart",
10949
- className: "grid place-items-center w-8 h-8 rounded-full hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",
10950
- children: "\u2715"
11069
+ className: "grid place-items-center w-9 h-9 rounded-full hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",
11070
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
10951
11071
  }
10952
11072
  )
10953
11073
  ] }),
10954
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto px-6 py-2", children: cart.isEmpty ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full grid place-items-center text-center py-20", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
11074
+ showShippingBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-shipping-bar": true, className: "px-6 pb-4 shrink-0", children: [
11075
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline justify-between gap-2 mb-1.5 text-xs", children: shippingUnlocked ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "\u2713 Free shipping unlocked" }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
11076
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: remainingForShipping, className: "font-semibold text-foreground" }),
11077
+ " away from free shipping"
11078
+ ] }) }),
11079
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
11080
+ "div",
11081
+ {
11082
+ className: "h-full bg-primary transition-[width] duration-500 ease-out",
11083
+ style: { width: `${shippingProgress}%` }
11084
+ }
11085
+ ) })
11086
+ ] }),
11087
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto px-6", children: cart.isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { onShop: handleShop }) : /* @__PURE__ */ jsxRuntime.jsx(CartSummary, { showTotals: false, showCheckoutButton: false }) }),
11088
+ !cart.isEmpty && /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "border-t border-border px-6 py-5 shrink-0 space-y-3 bg-background", children: [
11089
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between", children: [
11090
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Subtotal" }),
11091
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: animatedSubtotal, className: "text-lg font-bold tabular-nums" })
11092
+ ] }),
11093
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-muted-foreground", children: "Tax and shipping calculated at checkout." }),
11094
+ /* @__PURE__ */ jsxRuntime.jsxs(
11095
+ "button",
11096
+ {
11097
+ type: "button",
11098
+ onClick: handleCheckout,
11099
+ className: "w-full h-12 rounded-full bg-foreground text-background font-semibold text-sm hover:bg-foreground/90 active:scale-[0.99] transition-all",
11100
+ children: [
11101
+ "Checkout \u2014 ",
11102
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.subtotal, className: "tabular-nums" })
11103
+ ]
11104
+ }
11105
+ ),
10955
11106
  /* @__PURE__ */ jsxRuntime.jsx(
10956
- "svg",
11107
+ "button",
10957
11108
  {
10958
- className: "w-12 h-12 mx-auto text-muted-foreground/30",
10959
- fill: "none",
10960
- stroke: "currentColor",
10961
- strokeWidth: "1",
10962
- viewBox: "0 0 24 24",
10963
- "aria-hidden": true,
10964
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z" })
11109
+ type: "button",
11110
+ onClick: handleContinue,
11111
+ className: "w-full text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",
11112
+ children: "Continue shopping"
10965
11113
  }
10966
11114
  ),
10967
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium mt-3 mb-1", children: "Your cart is empty" }),
10968
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Add some items to get started" })
10969
- ] }) }) : /* @__PURE__ */ jsxRuntime.jsx(CartSummary, {}) }),
10970
- !cart.isEmpty && /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "border-t border-border px-6 py-4 space-y-3 shrink-0", children: [
10971
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between text-sm", children: [
10972
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Subtotal" }),
10973
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.subtotal, className: "font-semibold text-base" })
10974
- ] }),
10975
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Tax and delivery calculated at checkout." }),
10976
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-1", children: [
10977
- /* @__PURE__ */ jsxRuntime.jsx(
10978
- "button",
10979
- {
10980
- type: "button",
10981
- onClick: handleCheckout,
10982
- className: "w-full h-11 rounded-md bg-foreground text-background font-medium text-sm hover:bg-foreground/90 transition-colors",
10983
- children: "Checkout"
10984
- }
10985
- ),
10986
- /* @__PURE__ */ jsxRuntime.jsx(
10987
- "button",
10988
- {
10989
- type: "button",
10990
- onClick: handleContinue,
10991
- className: "w-full h-10 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",
10992
- children: "Continue shopping"
10993
- }
10994
- )
11115
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-1.5 text-[10px] text-muted-foreground/70 uppercase tracking-wider pt-1", children: [
11116
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }),
11117
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Secure checkout" })
10995
11118
  ] })
10996
11119
  ] })
10997
11120
  ]
@@ -11001,6 +11124,41 @@ function CartDrawer({
11001
11124
  }
11002
11125
  );
11003
11126
  }
11127
+ function EmptyState({ onShop }) {
11128
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-empty": true, className: "h-full grid place-items-center text-center py-16", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5 max-w-[260px]", children: [
11129
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-20 h-20 mx-auto", children: [
11130
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-muted" }),
11131
+ /* @__PURE__ */ jsxRuntime.jsx(
11132
+ "svg",
11133
+ {
11134
+ className: "relative w-10 h-10 m-auto top-1/2 -translate-y-1/2 text-muted-foreground/60",
11135
+ fill: "none",
11136
+ stroke: "currentColor",
11137
+ strokeWidth: "1.5",
11138
+ viewBox: "0 0 24 24",
11139
+ "aria-hidden": true,
11140
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l-1 12H6L5 9z" })
11141
+ }
11142
+ )
11143
+ ] }),
11144
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
11145
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base font-semibold m-0", children: "Your cart is empty" }),
11146
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Discover something you'll love." })
11147
+ ] }),
11148
+ /* @__PURE__ */ jsxRuntime.jsxs(
11149
+ "button",
11150
+ {
11151
+ type: "button",
11152
+ onClick: onShop,
11153
+ className: "inline-flex items-center gap-1.5 h-11 px-6 rounded-full bg-foreground text-background text-sm font-semibold hover:bg-foreground/90 active:scale-[0.99] transition-all",
11154
+ children: [
11155
+ "Shop now",
11156
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2.5", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14 5l7 7m0 0l-7 7m7-7H3" }) })
11157
+ ]
11158
+ }
11159
+ )
11160
+ ] }) });
11161
+ }
11004
11162
  function CheckoutPage({
11005
11163
  title = "Checkout",
11006
11164
  onComplete,