@cimplify/sdk 0.44.8 → 0.44.10
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/mock/cli.mjs +100 -5
- package/dist/mock/library.d.mts +2 -2
- package/dist/mock/library.d.ts +2 -2
- package/dist/mock/library.js +100 -5
- package/dist/mock/library.mjs +100 -5
- package/dist/mock/msw.d.mts +1 -1
- package/dist/mock/msw.d.ts +1 -1
- package/dist/mock/msw.js +100 -5
- package/dist/mock/msw.mjs +100 -5
- package/dist/react.d.mts +8 -4
- package/dist/react.d.ts +8 -4
- package/dist/react.js +327 -181
- package/dist/react.mjs +327 -181
- package/dist/{server-DD-Cd1Ob.d.mts → server-CUbuQxOV.d.mts} +32 -0
- package/dist/{server-DD-Cd1Ob.d.ts → server-CUbuQxOV.d.ts} +32 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/registry/cart-summary.json +1 -1
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
|
-
"
|
|
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.
|
|
6462
|
-
|
|
6463
|
-
|
|
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-
|
|
6466
|
-
className:
|
|
6467
|
-
children:
|
|
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.
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
6496
|
-
"
|
|
6497
|
-
" Instant digital delivery"
|
|
6498
|
-
] })
|
|
6499
|
-
item.bundleResolved
|
|
6500
|
-
|
|
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
|
-
|
|
6526
|
-
|
|
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
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
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
|
);
|
|
@@ -10689,42 +10737,65 @@ function DefaultCartLayout({
|
|
|
10689
10737
|
className
|
|
10690
10738
|
}) {
|
|
10691
10739
|
if (cart.isEmpty) {
|
|
10692
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("text-center py-
|
|
10693
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10740
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("max-w-md mx-auto text-center py-24", className), children: [
|
|
10741
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-24 h-24 mx-auto mb-6", children: [
|
|
10742
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-muted" }),
|
|
10743
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10744
|
+
"svg",
|
|
10745
|
+
{
|
|
10746
|
+
className: "relative w-12 h-12 m-auto top-1/2 -translate-y-1/2 text-muted-foreground/60",
|
|
10747
|
+
fill: "none",
|
|
10748
|
+
stroke: "currentColor",
|
|
10749
|
+
strokeWidth: "1.5",
|
|
10750
|
+
viewBox: "0 0 24 24",
|
|
10751
|
+
"aria-hidden": true,
|
|
10752
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l-1 12H6L5 9z" })
|
|
10753
|
+
}
|
|
10754
|
+
)
|
|
10755
|
+
] }),
|
|
10756
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold tracking-tight m-0", children: "Your cart is empty" }),
|
|
10757
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-2", children: "Browse the shop and add something you'll love." }),
|
|
10758
|
+
onContinueShopping && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10697
10759
|
"button",
|
|
10698
10760
|
{
|
|
10761
|
+
type: "button",
|
|
10699
10762
|
onClick: onContinueShopping,
|
|
10700
|
-
className: "text-sm font-
|
|
10701
|
-
children:
|
|
10763
|
+
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",
|
|
10764
|
+
children: [
|
|
10765
|
+
"Shop now",
|
|
10766
|
+
/* @__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" }) })
|
|
10767
|
+
]
|
|
10702
10768
|
}
|
|
10703
10769
|
)
|
|
10704
10770
|
] });
|
|
10705
10771
|
}
|
|
10706
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("space-y-
|
|
10707
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
10708
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10709
|
-
|
|
10772
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-layout": "default", className: cn("space-y-8", className), children: [
|
|
10773
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex items-baseline justify-between gap-4", children: [
|
|
10774
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl sm:text-4xl font-bold tracking-tight m-0", children: "Cart" }),
|
|
10775
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground tabular-nums", children: [
|
|
10710
10776
|
cart.itemCount,
|
|
10711
10777
|
" ",
|
|
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
|
-
)
|
|
10778
|
+
cart.itemCount === 1 ? "item" : "items"
|
|
10779
|
+
] })
|
|
10723
10780
|
] }),
|
|
10724
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid lg:grid-cols-[
|
|
10725
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10726
|
-
|
|
10727
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10781
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid lg:grid-cols-[1fr_360px] gap-10", children: [
|
|
10782
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10783
|
+
/* @__PURE__ */ jsxRuntime.jsx(CartSummary, {}),
|
|
10784
|
+
onContinueShopping && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10785
|
+
"button",
|
|
10786
|
+
{
|
|
10787
|
+
type: "button",
|
|
10788
|
+
onClick: onContinueShopping,
|
|
10789
|
+
className: "mt-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",
|
|
10790
|
+
children: [
|
|
10791
|
+
/* @__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" }) }),
|
|
10792
|
+
"Continue shopping"
|
|
10793
|
+
]
|
|
10794
|
+
}
|
|
10795
|
+
)
|
|
10796
|
+
] }),
|
|
10797
|
+
/* @__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: [
|
|
10798
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold uppercase tracking-[0.16em] text-muted-foreground m-0", children: "Summary" }),
|
|
10728
10799
|
showDiscount && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10729
10800
|
DiscountInput,
|
|
10730
10801
|
{
|
|
@@ -10733,28 +10804,34 @@ function DefaultCartLayout({
|
|
|
10733
10804
|
onClear: onDiscountClear
|
|
10734
10805
|
}
|
|
10735
10806
|
),
|
|
10736
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
10737
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
10738
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
10739
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.subtotal })
|
|
10807
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "space-y-2 text-sm", children: [
|
|
10808
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between", children: [
|
|
10809
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: "Subtotal" }),
|
|
10810
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.subtotal }) })
|
|
10740
10811
|
] }),
|
|
10741
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
10742
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
10743
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.tax })
|
|
10812
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between", children: [
|
|
10813
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: "Tax" }),
|
|
10814
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.tax }) })
|
|
10744
10815
|
] }),
|
|
10745
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between
|
|
10746
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
10747
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.total })
|
|
10816
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between pt-3 mt-1 border-t border-border", children: [
|
|
10817
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "font-semibold", children: "Total" }),
|
|
10818
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "m-0 text-lg font-bold tabular-nums", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.total }) })
|
|
10748
10819
|
] })
|
|
10749
10820
|
] }),
|
|
10821
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-muted-foreground", children: "Shipping calculated at checkout." }),
|
|
10750
10822
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10751
10823
|
"button",
|
|
10752
10824
|
{
|
|
10825
|
+
type: "button",
|
|
10753
10826
|
onClick: onCheckout,
|
|
10754
|
-
className: "w-full h-12 bg-foreground text-background font-
|
|
10827
|
+
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
10828
|
children: checkoutLabel
|
|
10756
10829
|
}
|
|
10757
|
-
)
|
|
10830
|
+
),
|
|
10831
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-1.5 text-[10px] text-muted-foreground/70 uppercase tracking-wider", children: [
|
|
10832
|
+
/* @__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" }) }),
|
|
10833
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Secure checkout" })
|
|
10834
|
+
] })
|
|
10758
10835
|
] }) })
|
|
10759
10836
|
] })
|
|
10760
10837
|
] });
|
|
@@ -10851,28 +10928,52 @@ function useCartDrawer() {
|
|
|
10851
10928
|
function CartDrawerProvider({ children, openOnAdd = true }) {
|
|
10852
10929
|
const [isOpen, setIsOpen] = React10.useState(false);
|
|
10853
10930
|
const cart = useCart();
|
|
10854
|
-
const
|
|
10931
|
+
const lastPendingRef = React10.useRef(0);
|
|
10855
10932
|
const open = React10.useCallback(() => setIsOpen(true), []);
|
|
10856
10933
|
const close = React10.useCallback(() => setIsOpen(false), []);
|
|
10857
10934
|
const toggle = React10.useCallback(() => setIsOpen((v) => !v), []);
|
|
10858
10935
|
React10.useEffect(() => {
|
|
10859
10936
|
if (!openOnAdd) return;
|
|
10860
|
-
if (cart.pendingOpCount >
|
|
10937
|
+
if (cart.pendingOpCount > lastPendingRef.current && cart.pendingOpCount > 0) {
|
|
10861
10938
|
setIsOpen(true);
|
|
10862
10939
|
}
|
|
10863
|
-
|
|
10864
|
-
}, [cart.pendingOpCount,
|
|
10940
|
+
lastPendingRef.current = cart.pendingOpCount;
|
|
10941
|
+
}, [cart.pendingOpCount, openOnAdd]);
|
|
10865
10942
|
const value = React10.useMemo(() => ({ isOpen, open, close, toggle }), [isOpen, open, close, toggle]);
|
|
10866
10943
|
return /* @__PURE__ */ jsxRuntime.jsx(CartDrawerContext.Provider, { value, children });
|
|
10867
10944
|
}
|
|
10945
|
+
function useAnimatedNumber(target, durationMs = 250) {
|
|
10946
|
+
const [value, setValue] = React10.useState(target);
|
|
10947
|
+
const fromRef = React10.useRef(target);
|
|
10948
|
+
const startRef = React10.useRef(null);
|
|
10949
|
+
React10.useEffect(() => {
|
|
10950
|
+
fromRef.current = value;
|
|
10951
|
+
startRef.current = null;
|
|
10952
|
+
let raf = 0;
|
|
10953
|
+
const tick = (t) => {
|
|
10954
|
+
if (startRef.current == null) startRef.current = t;
|
|
10955
|
+
const p = Math.min(1, (t - startRef.current) / durationMs);
|
|
10956
|
+
const eased = 1 - Math.pow(1 - p, 3);
|
|
10957
|
+
setValue(fromRef.current + (target - fromRef.current) * eased);
|
|
10958
|
+
if (p < 1) raf = requestAnimationFrame(tick);
|
|
10959
|
+
};
|
|
10960
|
+
raf = requestAnimationFrame(tick);
|
|
10961
|
+
return () => cancelAnimationFrame(raf);
|
|
10962
|
+
}, [target, durationMs]);
|
|
10963
|
+
return value;
|
|
10964
|
+
}
|
|
10868
10965
|
function CartDrawer({
|
|
10869
10966
|
onCheckout,
|
|
10870
10967
|
onContinueShopping,
|
|
10871
|
-
|
|
10968
|
+
onShop,
|
|
10969
|
+
title = "Cart",
|
|
10970
|
+
freeShippingThreshold = 0,
|
|
10872
10971
|
className
|
|
10873
10972
|
}) {
|
|
10874
10973
|
const { isOpen, close } = useCartDrawer();
|
|
10875
10974
|
const cart = useCart();
|
|
10975
|
+
const subtotalNum = chunkV2O5AO7I_js.parsePrice(cart.subtotal);
|
|
10976
|
+
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
10876
10977
|
React10.useEffect(() => {
|
|
10877
10978
|
if (!isOpen) return;
|
|
10878
10979
|
const original = document.body.style.overflow;
|
|
@@ -10891,11 +10992,17 @@ function CartDrawer({
|
|
|
10891
10992
|
onCheckout?.();
|
|
10892
10993
|
};
|
|
10893
10994
|
const handleContinue = () => {
|
|
10894
|
-
|
|
10895
|
-
onContinueShopping();
|
|
10896
|
-
}
|
|
10995
|
+
onContinueShopping?.();
|
|
10897
10996
|
close();
|
|
10898
10997
|
};
|
|
10998
|
+
const handleShop = () => {
|
|
10999
|
+
onShop?.();
|
|
11000
|
+
close();
|
|
11001
|
+
};
|
|
11002
|
+
const showShippingBar = freeShippingThreshold > 0 && !cart.isEmpty;
|
|
11003
|
+
const remainingForShipping = Math.max(0, freeShippingThreshold - subtotalNum);
|
|
11004
|
+
const shippingProgress = freeShippingThreshold > 0 ? Math.min(100, subtotalNum / freeShippingThreshold * 100) : 0;
|
|
11005
|
+
const shippingUnlocked = subtotalNum >= freeShippingThreshold && freeShippingThreshold > 0;
|
|
10899
11006
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10900
11007
|
"div",
|
|
10901
11008
|
{
|
|
@@ -10912,7 +11019,7 @@ function CartDrawer({
|
|
|
10912
11019
|
{
|
|
10913
11020
|
onClick: close,
|
|
10914
11021
|
className: cn(
|
|
10915
|
-
"absolute inset-0 bg-foreground/40 backdrop-blur-sm transition-opacity duration-
|
|
11022
|
+
"absolute inset-0 bg-foreground/40 backdrop-blur-sm transition-opacity duration-300",
|
|
10916
11023
|
isOpen ? "opacity-100" : "opacity-0"
|
|
10917
11024
|
)
|
|
10918
11025
|
}
|
|
@@ -10924,20 +11031,21 @@ function CartDrawer({
|
|
|
10924
11031
|
"aria-modal": "true",
|
|
10925
11032
|
"aria-label": title,
|
|
10926
11033
|
className: cn(
|
|
10927
|
-
"absolute top-0 right-0 h-full w-full sm:max-w-
|
|
11034
|
+
"absolute top-0 right-0 h-full w-full sm:max-w-[480px] bg-background shadow-2xl flex flex-col",
|
|
11035
|
+
"transition-transform duration-300",
|
|
10928
11036
|
isOpen ? "translate-x-0" : "translate-x-full",
|
|
11037
|
+
// ease-out cubic-bezier for a "pull" feel
|
|
11038
|
+
"[transition-timing-function:cubic-bezier(0.16,1,0.3,1)]",
|
|
10929
11039
|
className
|
|
10930
11040
|
),
|
|
10931
11041
|
children: [
|
|
10932
|
-
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex items-center justify-between gap-4 px-6 py-
|
|
10933
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
10934
|
-
title,
|
|
10935
|
-
cart.itemCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "
|
|
10936
|
-
"(",
|
|
11042
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "relative flex items-center justify-between gap-4 px-6 py-5 shrink-0", children: [
|
|
11043
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2", children: [
|
|
11044
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold tracking-tight m-0", children: title }),
|
|
11045
|
+
cart.itemCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground tabular-nums", children: [
|
|
10937
11046
|
cart.itemCount,
|
|
10938
11047
|
" ",
|
|
10939
|
-
cart.itemCount === 1 ? "item" : "items"
|
|
10940
|
-
")"
|
|
11048
|
+
cart.itemCount === 1 ? "item" : "items"
|
|
10941
11049
|
] })
|
|
10942
11050
|
] }),
|
|
10943
11051
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10946,52 +11054,55 @@ function CartDrawer({
|
|
|
10946
11054
|
type: "button",
|
|
10947
11055
|
onClick: close,
|
|
10948
11056
|
"aria-label": "Close cart",
|
|
10949
|
-
className: "grid place-items-center w-
|
|
10950
|
-
children: "
|
|
11057
|
+
className: "grid place-items-center w-9 h-9 rounded-full hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",
|
|
11058
|
+
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
11059
|
}
|
|
10952
11060
|
)
|
|
10953
11061
|
] }),
|
|
10954
|
-
/* @__PURE__ */ jsxRuntime.
|
|
11062
|
+
showShippingBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-shipping-bar": true, className: "px-6 pb-4 shrink-0", children: [
|
|
11063
|
+
/* @__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: [
|
|
11064
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: remainingForShipping, className: "font-semibold text-foreground" }),
|
|
11065
|
+
" away from free shipping"
|
|
11066
|
+
] }) }),
|
|
11067
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11068
|
+
"div",
|
|
11069
|
+
{
|
|
11070
|
+
className: "h-full bg-primary transition-[width] duration-500 ease-out",
|
|
11071
|
+
style: { width: `${shippingProgress}%` }
|
|
11072
|
+
}
|
|
11073
|
+
) })
|
|
11074
|
+
] }),
|
|
11075
|
+
/* @__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, {}) }),
|
|
11076
|
+
!cart.isEmpty && /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "border-t border-border px-6 py-5 shrink-0 space-y-3 bg-background", children: [
|
|
11077
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between", children: [
|
|
11078
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Subtotal" }),
|
|
11079
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: animatedSubtotal, className: "text-lg font-bold tabular-nums" })
|
|
11080
|
+
] }),
|
|
11081
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-muted-foreground", children: "Tax and shipping calculated at checkout." }),
|
|
11082
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11083
|
+
"button",
|
|
11084
|
+
{
|
|
11085
|
+
type: "button",
|
|
11086
|
+
onClick: handleCheckout,
|
|
11087
|
+
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",
|
|
11088
|
+
children: [
|
|
11089
|
+
"Checkout \u2014 ",
|
|
11090
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: cart.subtotal, className: "tabular-nums" })
|
|
11091
|
+
]
|
|
11092
|
+
}
|
|
11093
|
+
),
|
|
10955
11094
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10956
|
-
"
|
|
11095
|
+
"button",
|
|
10957
11096
|
{
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
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" })
|
|
11097
|
+
type: "button",
|
|
11098
|
+
onClick: handleContinue,
|
|
11099
|
+
className: "w-full text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",
|
|
11100
|
+
children: "Continue shopping"
|
|
10965
11101
|
}
|
|
10966
11102
|
),
|
|
10967
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10968
|
-
|
|
10969
|
-
|
|
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
|
-
)
|
|
11103
|
+
/* @__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: [
|
|
11104
|
+
/* @__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" }) }),
|
|
11105
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Secure checkout" })
|
|
10995
11106
|
] })
|
|
10996
11107
|
] })
|
|
10997
11108
|
]
|
|
@@ -11001,6 +11112,41 @@ function CartDrawer({
|
|
|
11001
11112
|
}
|
|
11002
11113
|
);
|
|
11003
11114
|
}
|
|
11115
|
+
function EmptyState({ onShop }) {
|
|
11116
|
+
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: [
|
|
11117
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-20 h-20 mx-auto", children: [
|
|
11118
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-muted" }),
|
|
11119
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11120
|
+
"svg",
|
|
11121
|
+
{
|
|
11122
|
+
className: "relative w-10 h-10 m-auto top-1/2 -translate-y-1/2 text-muted-foreground/60",
|
|
11123
|
+
fill: "none",
|
|
11124
|
+
stroke: "currentColor",
|
|
11125
|
+
strokeWidth: "1.5",
|
|
11126
|
+
viewBox: "0 0 24 24",
|
|
11127
|
+
"aria-hidden": true,
|
|
11128
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l-1 12H6L5 9z" })
|
|
11129
|
+
}
|
|
11130
|
+
)
|
|
11131
|
+
] }),
|
|
11132
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11133
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base font-semibold m-0", children: "Your cart is empty" }),
|
|
11134
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Discover something you'll love." })
|
|
11135
|
+
] }),
|
|
11136
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11137
|
+
"button",
|
|
11138
|
+
{
|
|
11139
|
+
type: "button",
|
|
11140
|
+
onClick: onShop,
|
|
11141
|
+
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",
|
|
11142
|
+
children: [
|
|
11143
|
+
"Shop now",
|
|
11144
|
+
/* @__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" }) })
|
|
11145
|
+
]
|
|
11146
|
+
}
|
|
11147
|
+
)
|
|
11148
|
+
] }) });
|
|
11149
|
+
}
|
|
11004
11150
|
function CheckoutPage({
|
|
11005
11151
|
title = "Checkout",
|
|
11006
11152
|
onComplete,
|