@instockng/storefront-ui 1.0.83 → 1.0.85
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/index102.mjs +2 -34
- package/dist/index103.mjs +31 -40
- package/dist/index104.mjs +43 -2
- package/dist/index14.mjs +54 -54
- package/dist/index144.mjs +1 -1
- package/dist/index146.mjs +1 -1
- package/dist/index147.mjs +2 -2
- package/dist/index151.mjs +2 -2
- package/dist/index154.mjs +4 -4
- package/dist/index155.mjs +5 -5
- package/dist/index16.mjs +131 -131
- package/dist/index160.mjs +1 -1
- package/dist/index161.mjs +1 -1
- package/dist/index162.mjs +1 -1
- package/dist/index163.mjs +1 -1
- package/dist/index164.mjs +1 -1
- package/dist/index166.mjs +1 -1
- package/dist/index167.mjs +1 -1
- package/dist/index169.mjs +2 -2
- package/dist/index170.mjs +1 -1
- package/dist/index175.mjs +2 -2
- package/dist/index177.mjs +1 -1
- package/dist/index179.mjs +2 -2
- package/dist/index180.mjs +5 -5
- package/dist/index183.mjs +1 -1
- package/dist/index186.mjs +1 -1
- package/dist/index189.mjs +1 -1
- package/dist/index190.mjs +1 -1
- package/dist/index194.mjs +1 -1
- package/dist/index196.mjs +1 -1
- package/dist/index200.mjs +1 -1
- package/dist/index202.mjs +1 -1
- package/dist/index211.mjs +2 -2
- package/dist/index215.mjs +2 -31
- package/dist/index216.mjs +2 -11
- package/dist/index217.mjs +2 -4
- package/dist/index218.mjs +2 -4
- package/dist/index219.mjs +2 -13
- package/dist/index220.mjs +2 -7
- package/dist/index221.mjs +107 -11
- package/dist/index222.mjs +2 -5
- package/dist/index223.mjs +2 -33
- package/dist/index224.mjs +2 -31
- package/dist/index225.mjs +2 -28
- package/dist/index226.mjs +241 -58
- package/dist/index227.mjs +2 -2
- package/dist/index228.mjs +33 -2
- package/dist/index229.mjs +65 -2
- package/dist/index230.mjs +25 -2
- package/dist/index231.mjs +2 -2
- package/dist/index233.mjs +37 -2
- package/dist/index234.mjs +2 -2
- package/dist/index235.mjs +2 -108
- package/dist/index236.mjs +2 -2
- package/dist/index238.mjs +2 -244
- package/dist/index239.mjs +2 -2
- package/dist/index240.mjs +2 -33
- package/dist/index241.mjs +2 -65
- package/dist/index242.mjs +13 -25
- package/dist/index243.mjs +7 -2
- package/dist/index244.mjs +31 -2
- package/dist/index245.mjs +10 -36
- package/dist/index246.mjs +4 -2
- package/dist/index247.mjs +4 -2
- package/dist/index248.mjs +2 -2
- package/dist/index249.mjs +4 -2
- package/dist/index250.mjs +12 -2
- package/dist/index251.mjs +5 -2
- package/dist/index252.mjs +33 -2
- package/dist/index253.mjs +31 -2
- package/dist/index254.mjs +28 -2
- package/dist/index255.mjs +61 -4
- package/dist/index258.mjs +2 -3
- package/dist/index259.mjs +2 -2
- package/dist/index260.mjs +18 -2
- package/dist/index261.mjs +46 -16
- package/dist/index262.mjs +2 -13
- package/dist/index263.mjs +2 -6
- package/dist/index264.mjs +2 -30
- package/dist/index266.mjs +91 -2
- package/dist/index267.mjs +2 -2
- package/dist/index268.mjs +3 -2
- package/dist/index269.mjs +2 -2
- package/dist/index270.mjs +2 -91
- package/dist/index271.mjs +17 -2
- package/dist/index272.mjs +12 -17
- package/dist/index273.mjs +6 -47
- package/dist/index274.mjs +30 -2
- package/dist/index275.mjs +2 -2
- package/dist/index277.mjs +2 -2
- package/dist/index36.mjs +1 -1
- package/dist/index37.mjs +1 -1
- package/dist/index38.mjs +1 -1
- package/dist/index39.mjs +1 -1
- package/dist/index40.mjs +1 -1
- package/dist/index41.mjs +2 -2
- package/dist/index43.mjs +2 -2
- package/dist/index46.mjs +3 -3
- package/dist/index56.mjs +2 -2
- package/dist/index57.mjs +1 -1
- package/dist/index58.mjs +1 -1
- package/dist/index59.mjs +1 -1
- package/dist/index60.mjs +1 -1
- package/dist/index61.mjs +1 -1
- package/dist/index62.mjs +1 -1
- package/dist/index63.mjs +1 -1
- package/dist/index64.mjs +1 -1
- package/dist/index65.mjs +1 -1
- package/dist/index66.mjs +1 -1
- package/dist/index67.mjs +1 -1
- package/dist/index68.mjs +1 -1
- package/dist/index69.mjs +1 -1
- package/dist/index70.mjs +23 -4
- package/dist/index71.mjs +150 -21
- package/dist/index72.mjs +2 -153
- package/dist/index74.mjs +75 -2
- package/dist/index75.mjs +14 -74
- package/dist/index76.mjs +62 -14
- package/dist/index77.mjs +4 -62
- package/dist/index83.mjs +1 -1
- package/package.json +2 -2
- package/src/components/Checkout.stories.tsx +6 -5
- package/src/components/Checkout.tsx +1 -1
- package/src/components/ShoppingCart.tsx +2 -2
- package/src/test-utils/MockCartProvider.tsx +0 -1
package/dist/index102.mjs
CHANGED
|
@@ -1,37 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var
|
|
3
|
-
let r = `${i}=${t}`;
|
|
4
|
-
if (i.startsWith("__Secure-") && !e.secure)
|
|
5
|
-
throw new Error("__Secure- Cookie must have Secure attributes");
|
|
6
|
-
if (i.startsWith("__Host-")) {
|
|
7
|
-
if (!e.secure)
|
|
8
|
-
throw new Error("__Host- Cookie must have Secure attributes");
|
|
9
|
-
if (e.path !== "/")
|
|
10
|
-
throw new Error('__Host- Cookie must have Path attributes with "/"');
|
|
11
|
-
if (e.domain)
|
|
12
|
-
throw new Error("__Host- Cookie must not have Domain attributes");
|
|
13
|
-
}
|
|
14
|
-
if (e && typeof e.maxAge == "number" && e.maxAge >= 0) {
|
|
15
|
-
if (e.maxAge > 3456e4)
|
|
16
|
-
throw new Error(
|
|
17
|
-
"Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration."
|
|
18
|
-
);
|
|
19
|
-
r += `; Max-Age=${e.maxAge | 0}`;
|
|
20
|
-
}
|
|
21
|
-
if (e.domain && e.prefix !== "host" && (r += `; Domain=${e.domain}`), e.path && (r += `; Path=${e.path}`), e.expires) {
|
|
22
|
-
if (e.expires.getTime() - Date.now() > 3456e7)
|
|
23
|
-
throw new Error(
|
|
24
|
-
"Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future."
|
|
25
|
-
);
|
|
26
|
-
r += `; Expires=${e.expires.toUTCString()}`;
|
|
27
|
-
}
|
|
28
|
-
if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite && (r += `; SameSite=${e.sameSite.charAt(0).toUpperCase() + e.sameSite.slice(1)}`), e.priority && (r += `; Priority=${e.priority.charAt(0).toUpperCase() + e.priority.slice(1)}`), e.partitioned) {
|
|
29
|
-
if (!e.secure)
|
|
30
|
-
throw new Error("Partitioned Cookie must have Secure attributes");
|
|
31
|
-
r += "; Partitioned";
|
|
32
|
-
}
|
|
33
|
-
return r;
|
|
34
|
-
}, s = (i, t, e) => (t = encodeURIComponent(t), a(i, t, e));
|
|
2
|
+
var o = { exports: {} };
|
|
35
3
|
export {
|
|
36
|
-
|
|
4
|
+
o as __module
|
|
37
5
|
};
|
package/dist/index103.mjs
CHANGED
|
@@ -1,46 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var a = (i, t, e = {}) => {
|
|
3
|
+
let r = `${i}=${t}`;
|
|
4
|
+
if (i.startsWith("__Secure-") && !e.secure)
|
|
5
|
+
throw new Error("__Secure- Cookie must have Secure attributes");
|
|
6
|
+
if (i.startsWith("__Host-")) {
|
|
7
|
+
if (!e.secure)
|
|
8
|
+
throw new Error("__Host- Cookie must have Secure attributes");
|
|
9
|
+
if (e.path !== "/")
|
|
10
|
+
throw new Error('__Host- Cookie must have Path attributes with "/"');
|
|
11
|
+
if (e.domain)
|
|
12
|
+
throw new Error("__Host- Cookie must not have Domain attributes");
|
|
6
13
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
case "ws":
|
|
21
|
-
return e.replace(/^http/, "ws");
|
|
22
|
-
case "http":
|
|
23
|
-
return e.replace(/^ws/, "http");
|
|
14
|
+
if (e && typeof e.maxAge == "number" && e.maxAge >= 0) {
|
|
15
|
+
if (e.maxAge > 3456e4)
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration."
|
|
18
|
+
);
|
|
19
|
+
r += `; Max-Age=${e.maxAge | 0}`;
|
|
20
|
+
}
|
|
21
|
+
if (e.domain && e.prefix !== "host" && (r += `; Domain=${e.domain}`), e.path && (r += `; Path=${e.path}`), e.expires) {
|
|
22
|
+
if (e.expires.getTime() - Date.now() > 3456e7)
|
|
23
|
+
throw new Error(
|
|
24
|
+
"Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future."
|
|
25
|
+
);
|
|
26
|
+
r += `; Expires=${e.expires.toUTCString()}`;
|
|
24
27
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function o(e, r) {
|
|
30
|
-
if (!a(e) && !a(r))
|
|
31
|
-
return r;
|
|
32
|
-
const n = { ...e };
|
|
33
|
-
for (const t in r) {
|
|
34
|
-
const c = r[t];
|
|
35
|
-
a(n[t]) && a(c) ? n[t] = o(n[t], c) : n[t] = c;
|
|
28
|
+
if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite && (r += `; SameSite=${e.sameSite.charAt(0).toUpperCase() + e.sameSite.slice(1)}`), e.priority && (r += `; Priority=${e.priority.charAt(0).toUpperCase() + e.priority.slice(1)}`), e.partitioned) {
|
|
29
|
+
if (!e.secure)
|
|
30
|
+
throw new Error("Partitioned Cookie must have Secure attributes");
|
|
31
|
+
r += "; Partitioned";
|
|
36
32
|
}
|
|
37
|
-
return
|
|
38
|
-
}
|
|
33
|
+
return r;
|
|
34
|
+
}, s = (i, t, e) => (t = encodeURIComponent(t), a(i, t, e));
|
|
39
35
|
export {
|
|
40
|
-
|
|
41
|
-
o as deepMerge,
|
|
42
|
-
s as mergePath,
|
|
43
|
-
l as removeIndexString,
|
|
44
|
-
p as replaceUrlParam,
|
|
45
|
-
i as replaceUrlProtocol
|
|
36
|
+
s as serialize
|
|
46
37
|
};
|
package/dist/index104.mjs
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var
|
|
2
|
+
var s = (e, r) => (e = e.replace(/\/+$/, ""), e = e + "/", r = r.replace(/^\/+/, ""), e + r), p = (e, r) => {
|
|
3
|
+
for (const [n, t] of Object.entries(r)) {
|
|
4
|
+
const c = new RegExp("/:" + n + "(?:{[^/]+})?\\??");
|
|
5
|
+
e = e.replace(c, t ? `/${t}` : "");
|
|
6
|
+
}
|
|
7
|
+
return e;
|
|
8
|
+
}, f = (e) => {
|
|
9
|
+
const r = new URLSearchParams();
|
|
10
|
+
for (const [n, t] of Object.entries(e))
|
|
11
|
+
if (t !== void 0)
|
|
12
|
+
if (Array.isArray(t))
|
|
13
|
+
for (const c of t)
|
|
14
|
+
r.append(n, c);
|
|
15
|
+
else
|
|
16
|
+
r.set(n, t);
|
|
17
|
+
return r;
|
|
18
|
+
}, i = (e, r) => {
|
|
19
|
+
switch (r) {
|
|
20
|
+
case "ws":
|
|
21
|
+
return e.replace(/^http/, "ws");
|
|
22
|
+
case "http":
|
|
23
|
+
return e.replace(/^ws/, "http");
|
|
24
|
+
}
|
|
25
|
+
}, l = (e) => /^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e) ? e.replace(/\/index(?=\?|$)/, "/") : e.replace(/\/index(?=\?|$)/, "");
|
|
26
|
+
function a(e) {
|
|
27
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
28
|
+
}
|
|
29
|
+
function o(e, r) {
|
|
30
|
+
if (!a(e) && !a(r))
|
|
31
|
+
return r;
|
|
32
|
+
const n = { ...e };
|
|
33
|
+
for (const t in r) {
|
|
34
|
+
const c = r[t];
|
|
35
|
+
a(n[t]) && a(c) ? n[t] = o(n[t], c) : n[t] = c;
|
|
36
|
+
}
|
|
37
|
+
return n;
|
|
38
|
+
}
|
|
3
39
|
export {
|
|
4
|
-
|
|
40
|
+
f as buildSearchParams,
|
|
41
|
+
o as deepMerge,
|
|
42
|
+
s as mergePath,
|
|
43
|
+
l as removeIndexString,
|
|
44
|
+
p as replaceUrlParam,
|
|
45
|
+
i as replaceUrlProtocol
|
|
5
46
|
};
|
package/dist/index14.mjs
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as a, Fragment as
|
|
2
|
+
import { jsxs as a, Fragment as E, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useState as $, useEffect as A } from "react";
|
|
4
4
|
import { useCart as G } from "./index3.mjs";
|
|
5
5
|
import { CartItem as J } from "./index13.mjs";
|
|
6
6
|
import { DiscountCodeInput as K } from "./index15.mjs";
|
|
7
7
|
import { Checkout as O } from "./index16.mjs";
|
|
8
8
|
import { RecommendedProducts as Q } from "./index11.mjs";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { X as
|
|
9
|
+
import { Button as F } from "./index17.mjs";
|
|
10
|
+
import { X as U, Loader2 as V, Package as f } from "lucide-react";
|
|
11
11
|
import { cn as c, formatCurrency as d } from "./index23.mjs";
|
|
12
|
-
import { useHideBodyOverflow as
|
|
13
|
-
function
|
|
14
|
-
isOpen:
|
|
15
|
-
onClose:
|
|
12
|
+
import { useHideBodyOverflow as W } from "./index45.mjs";
|
|
13
|
+
function oe({
|
|
14
|
+
isOpen: s,
|
|
15
|
+
onClose: i,
|
|
16
16
|
onCheckout: m,
|
|
17
17
|
onContinueShopping: h,
|
|
18
|
-
onPurchaseSuccess:
|
|
19
|
-
className:
|
|
20
|
-
showDiscountCode:
|
|
21
|
-
showContinueShopping:
|
|
22
|
-
checkoutButtonText:
|
|
23
|
-
continueShoppingText:
|
|
24
|
-
checkoutButtonClassName:
|
|
18
|
+
onPurchaseSuccess: p,
|
|
19
|
+
className: R,
|
|
20
|
+
showDiscountCode: I = !0,
|
|
21
|
+
showContinueShopping: L = !0,
|
|
22
|
+
checkoutButtonText: z = "Complete Purchase",
|
|
23
|
+
continueShoppingText: Y = "Continue Shopping",
|
|
24
|
+
checkoutButtonClassName: T,
|
|
25
25
|
continueShoppingButtonClassName: B,
|
|
26
26
|
disableCheckout: D = !1,
|
|
27
27
|
emptyMessage: M = "Your cart is empty"
|
|
28
28
|
}) {
|
|
29
|
-
var x, y, N,
|
|
30
|
-
const { cart: t, isLoading: l, error: o, trackCheckoutInitiated:
|
|
31
|
-
|
|
29
|
+
var x, y, b, N, v, w;
|
|
30
|
+
const { cart: t, isLoading: l, error: o, trackCheckoutInitiated: S } = G(), [q, u] = $(!1);
|
|
31
|
+
W(s), A(() => {
|
|
32
32
|
const r = (n) => {
|
|
33
|
-
n.key === "Escape" &&
|
|
33
|
+
n.key === "Escape" && s && i();
|
|
34
34
|
};
|
|
35
35
|
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
36
|
-
}, [
|
|
37
|
-
const
|
|
38
|
-
|
|
36
|
+
}, [s, i]);
|
|
37
|
+
const H = ((x = t == null ? void 0 : t.pricing) == null ? void 0 : x.subtotal) || 0, g = ((y = t == null ? void 0 : t.pricing.discount) == null ? void 0 : y.amount) || 0, P = () => {
|
|
38
|
+
S(), u(!0), m == null || m();
|
|
39
39
|
}, X = () => {
|
|
40
|
-
h == null || h(),
|
|
40
|
+
h == null || h(), i();
|
|
41
41
|
};
|
|
42
|
-
return /* @__PURE__ */ a(
|
|
42
|
+
return /* @__PURE__ */ a(E, { children: [
|
|
43
43
|
/* @__PURE__ */ e(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
className: c(
|
|
47
47
|
"fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",
|
|
48
|
-
|
|
48
|
+
s ? "opacity-100" : "pointer-events-none opacity-0"
|
|
49
49
|
),
|
|
50
|
-
onClick:
|
|
50
|
+
onClick: i,
|
|
51
51
|
"aria-hidden": "true"
|
|
52
52
|
}
|
|
53
53
|
),
|
|
@@ -56,32 +56,32 @@ function de({
|
|
|
56
56
|
{
|
|
57
57
|
className: c(
|
|
58
58
|
"fixed right-0 top-0 z-50 h-full w-full bg-white shadow-2xl transition-transform duration-300 ease-in-out sm:w-[480px]",
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
s ? "translate-x-0" : "translate-x-full",
|
|
60
|
+
R
|
|
61
61
|
),
|
|
62
62
|
children: /* @__PURE__ */ a("div", { className: "flex h-full flex-col", children: [
|
|
63
63
|
/* @__PURE__ */ e("div", { className: "border-b border-gray-300 px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
64
64
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
65
|
-
/* @__PURE__ */ e("div", { className: "bg-accent-500 text-white px-2 py-1 rounded-full text-sm aspect-square flex items-center justify-center w-8 h-8", children: (
|
|
65
|
+
/* @__PURE__ */ e("div", { className: "bg-accent-500 text-white px-2 py-1 rounded-full text-sm aspect-square flex items-center justify-center w-8 h-8", children: (b = t == null ? void 0 : t.items) == null ? void 0 : b.length }),
|
|
66
66
|
/* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Your Cart" })
|
|
67
67
|
] }),
|
|
68
68
|
/* @__PURE__ */ e(
|
|
69
69
|
"button",
|
|
70
70
|
{
|
|
71
|
-
onClick:
|
|
71
|
+
onClick: i,
|
|
72
72
|
className: "rounded-full p-2 transition-colors hover:bg-gray-100",
|
|
73
73
|
"aria-label": "Close cart",
|
|
74
|
-
children: /* @__PURE__ */ e(
|
|
74
|
+
children: /* @__PURE__ */ e(U, { className: "h-6 w-6" })
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] }) }),
|
|
78
|
-
!l && !o && t && t.items && t.items.length > 0 && /* @__PURE__ */ e("div", { className: "bg-gray-50 px-4 py-3 border-b border-gray-200", children: (() => {
|
|
79
|
-
var
|
|
80
|
-
const n = ((
|
|
78
|
+
!l && !o && t && t.items && t.items.length > 0 && ((N = t.brand) == null ? void 0 : N.freeShippingThreshold) && /* @__PURE__ */ e("div", { className: "bg-gray-50 px-4 py-3 border-b border-gray-200", children: (() => {
|
|
79
|
+
var j;
|
|
80
|
+
const r = t.brand.freeShippingThreshold, n = ((j = t.pricing) == null ? void 0 : j.subtotal) || 0, k = Math.max(0, r - n), Z = Math.min(100, n / r * 100), C = k <= 0;
|
|
81
81
|
return /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
82
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-bold text-center", children:
|
|
82
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-bold text-center", children: C ? /* @__PURE__ */ e("span", { className: "text-green-600", children: "You've unlocked FREE delivery! 🎉" }) : /* @__PURE__ */ a("span", { children: [
|
|
83
83
|
"You're ",
|
|
84
|
-
/* @__PURE__ */ e("span", { className: "text-red-500", children: d(
|
|
84
|
+
/* @__PURE__ */ e("span", { className: "text-red-500", children: d(k) }),
|
|
85
85
|
" away from FREE delivery"
|
|
86
86
|
] }) }),
|
|
87
87
|
/* @__PURE__ */ e("div", { className: "h-2 w-full bg-gray-200 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
|
|
@@ -89,7 +89,7 @@ function de({
|
|
|
89
89
|
{
|
|
90
90
|
className: c(
|
|
91
91
|
"h-full transition-all duration-500 ease-out",
|
|
92
|
-
|
|
92
|
+
C ? "bg-green-500" : "bg-red-500"
|
|
93
93
|
),
|
|
94
94
|
style: { width: `${Z}%` }
|
|
95
95
|
}
|
|
@@ -97,18 +97,18 @@ function de({
|
|
|
97
97
|
] });
|
|
98
98
|
})() }),
|
|
99
99
|
l && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
100
|
-
/* @__PURE__ */ e(
|
|
100
|
+
/* @__PURE__ */ e(V, { className: "mx-auto mb-4 h-12 w-12 animate-spin text-accent-500" }),
|
|
101
101
|
/* @__PURE__ */ e("p", { className: "text-gray-600", children: "Loading cart..." })
|
|
102
102
|
] }) }),
|
|
103
103
|
o && !l && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
104
|
-
/* @__PURE__ */ e(
|
|
104
|
+
/* @__PURE__ */ e(f, { className: "mx-auto mb-4 h-12 w-12 text-red-600" }),
|
|
105
105
|
/* @__PURE__ */ e("p", { className: "text-red-600", children: "Failed to load cart. Please try again." })
|
|
106
106
|
] }) }),
|
|
107
107
|
!l && !o && (!t || !t.items || t.items.length === 0) && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
108
|
-
/* @__PURE__ */ e(
|
|
108
|
+
/* @__PURE__ */ e(f, { className: "mx-auto mb-4 h-12 w-12 text-gray-400" }),
|
|
109
109
|
/* @__PURE__ */ e("p", { className: "text-gray-600", children: M })
|
|
110
110
|
] }) }),
|
|
111
|
-
!l && !o && t && t.items && t.items.length > 0 && /* @__PURE__ */ a(
|
|
111
|
+
!l && !o && t && t.items && t.items.length > 0 && /* @__PURE__ */ a(E, { children: [
|
|
112
112
|
/* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", children: [
|
|
113
113
|
/* @__PURE__ */ e("div", { className: "space-y-4 p-4", children: t.items.map((r, n) => /* @__PURE__ */ a("div", { children: [
|
|
114
114
|
/* @__PURE__ */ e(
|
|
@@ -119,7 +119,7 @@ function de({
|
|
|
119
119
|
),
|
|
120
120
|
/* @__PURE__ */ e("hr", { className: "border-gray-200 mt-2" })
|
|
121
121
|
] }, r.id)) }),
|
|
122
|
-
|
|
122
|
+
I && /* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ e(K, {}) })
|
|
123
123
|
] }),
|
|
124
124
|
/* @__PURE__ */ e(Q, { limit: 6, className: "border-t border-gray-200" }),
|
|
125
125
|
/* @__PURE__ */ a("div", { className: "border-t border-gray-300 bg-white", children: [
|
|
@@ -127,7 +127,7 @@ function de({
|
|
|
127
127
|
/* @__PURE__ */ a("div", { className: "px-4 py-2 space-y-2", children: [
|
|
128
128
|
/* @__PURE__ */ a("div", { className: "flex justify-between", children: [
|
|
129
129
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Subtotal" }),
|
|
130
|
-
/* @__PURE__ */ e("span", { className: "font-semibold", children: d(
|
|
130
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: d(H) })
|
|
131
131
|
] }),
|
|
132
132
|
g > 0 && /* @__PURE__ */ a("div", { className: "flex justify-between text-green-600", children: [
|
|
133
133
|
/* @__PURE__ */ e("span", { children: "Discount" }),
|
|
@@ -138,7 +138,7 @@ function de({
|
|
|
138
138
|
] }),
|
|
139
139
|
/* @__PURE__ */ a("div", { className: "flex justify-between", children: [
|
|
140
140
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Shipping" }),
|
|
141
|
-
/* @__PURE__ */ e("span", { className: "font-semibold", children: t.deliveryZone ? ((
|
|
141
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: t.deliveryZone ? ((v = t.pricing) == null ? void 0 : v.deliveryCharge) === 0 ? /* @__PURE__ */ e("span", { className: "text-green-600", children: "Free" }) : d(((w = t.pricing) == null ? void 0 : w.deliveryCharge) ?? 0) : /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs font-normal", children: "Calculated at checkout" }) })
|
|
142
142
|
] })
|
|
143
143
|
] }),
|
|
144
144
|
/* @__PURE__ */ a("div", { className: "flex justify-between p-4 border-t border-gray-300 text-lg", children: [
|
|
@@ -148,26 +148,26 @@ function de({
|
|
|
148
148
|
] }),
|
|
149
149
|
/* @__PURE__ */ a("div", { className: "px-4 py-2 space-y-2 pt-0", children: [
|
|
150
150
|
/* @__PURE__ */ a(
|
|
151
|
-
|
|
151
|
+
F,
|
|
152
152
|
{
|
|
153
|
-
onClick:
|
|
153
|
+
onClick: P,
|
|
154
154
|
disabled: D || t.items.length === 0,
|
|
155
|
-
className: c("w-full bg-accent-500 text-white hover:bg-accent-600",
|
|
155
|
+
className: c("w-full bg-accent-500 text-white hover:bg-accent-600", T),
|
|
156
156
|
size: "lg",
|
|
157
157
|
children: [
|
|
158
|
-
/* @__PURE__ */ e(
|
|
159
|
-
|
|
158
|
+
/* @__PURE__ */ e(f, { className: "h-5 w-5" }),
|
|
159
|
+
z
|
|
160
160
|
]
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
L && /* @__PURE__ */ e(
|
|
164
|
+
F,
|
|
165
165
|
{
|
|
166
166
|
onClick: X,
|
|
167
167
|
variant: "outline",
|
|
168
168
|
className: c("w-full border-gray-300 text-gray-600 hover:bg-gray-100", B),
|
|
169
169
|
size: "lg",
|
|
170
|
-
children:
|
|
170
|
+
children: Y
|
|
171
171
|
}
|
|
172
172
|
)
|
|
173
173
|
] })
|
|
@@ -179,9 +179,9 @@ function de({
|
|
|
179
179
|
/* @__PURE__ */ e(
|
|
180
180
|
O,
|
|
181
181
|
{
|
|
182
|
-
isOpen:
|
|
182
|
+
isOpen: q,
|
|
183
183
|
onSuccess: (r) => {
|
|
184
|
-
|
|
184
|
+
p == null || p(r), i();
|
|
185
185
|
},
|
|
186
186
|
onClose: () => u(!1),
|
|
187
187
|
refundPolicy: {
|
|
@@ -199,5 +199,5 @@ function de({
|
|
|
199
199
|
] });
|
|
200
200
|
}
|
|
201
201
|
export {
|
|
202
|
-
|
|
202
|
+
oe as ShoppingCart
|
|
203
203
|
};
|
package/dist/index144.mjs
CHANGED
package/dist/index146.mjs
CHANGED
package/dist/index147.mjs
CHANGED
package/dist/index151.mjs
CHANGED
package/dist/index154.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import H from "./index85.mjs";
|
|
3
|
-
import D from "./
|
|
3
|
+
import D from "./index250.mjs";
|
|
4
4
|
import L from "./index149.mjs";
|
|
5
5
|
import n from "./index96.mjs";
|
|
6
6
|
import y from "./index91.mjs";
|
|
7
|
-
import O from "./
|
|
7
|
+
import O from "./index251.mjs";
|
|
8
8
|
import U from "./index151.mjs";
|
|
9
9
|
import q from "./index99.mjs";
|
|
10
|
-
import { progressEventReducer as A } from "./
|
|
11
|
-
import v from "./
|
|
10
|
+
import { progressEventReducer as A } from "./index252.mjs";
|
|
11
|
+
import v from "./index253.mjs";
|
|
12
12
|
const N = typeof XMLHttpRequest < "u", Q = N && function(s) {
|
|
13
13
|
return new Promise(function(C, i) {
|
|
14
14
|
const t = v(s);
|
package/dist/index155.mjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import K from "./index151.mjs";
|
|
3
3
|
import t from "./index85.mjs";
|
|
4
4
|
import b from "./index96.mjs";
|
|
5
|
-
import ee from "./
|
|
6
|
-
import { trackStream as z } from "./
|
|
5
|
+
import ee from "./index254.mjs";
|
|
6
|
+
import { trackStream as z } from "./index255.mjs";
|
|
7
7
|
import te from "./index99.mjs";
|
|
8
|
-
import { progressEventDecorator as I, progressEventReducer as M, asyncDecorator as j } from "./
|
|
9
|
-
import se from "./
|
|
10
|
-
import re from "./
|
|
8
|
+
import { progressEventDecorator as I, progressEventReducer as M, asyncDecorator as j } from "./index252.mjs";
|
|
9
|
+
import se from "./index253.mjs";
|
|
10
|
+
import re from "./index250.mjs";
|
|
11
11
|
const J = 64 * 1024, { isFunction: P } = t, ne = (({ Request: r, Response: n }) => ({
|
|
12
12
|
Request: r,
|
|
13
13
|
Response: n
|