@instockng/storefront-ui 1.0.15 → 1.0.17
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/components/OrderConfirmation.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/index10.mjs +3 -3
- package/dist/index100.mjs +33 -5
- package/dist/index101.mjs +31 -33
- package/dist/index102.mjs +26 -29
- package/dist/index103.mjs +59 -26
- package/dist/index104.mjs +3 -61
- package/dist/index105.mjs +2 -3
- package/dist/index106.mjs +2 -2
- package/dist/index107.mjs +17 -2
- package/dist/index108.mjs +11 -15
- package/dist/index109.mjs +6 -13
- package/dist/index11.mjs +2 -2
- package/dist/index110.mjs +30 -6
- package/dist/index13.mjs +1 -1
- package/dist/index17.mjs +2 -2
- package/dist/index18.mjs +12 -21
- package/dist/index20.mjs +4 -9
- package/dist/index21.mjs +1 -1
- package/dist/index28.mjs +11 -11
- package/dist/index29.mjs +1 -1
- package/dist/index30.mjs +1 -1
- package/dist/index31.mjs +1 -1
- package/dist/index32.mjs +1 -1
- package/dist/index33.mjs +1433 -4
- package/dist/index34.mjs +2 -1433
- package/dist/index35.mjs +57 -2
- package/dist/index36.mjs +48 -54
- package/dist/index37.mjs +33 -51
- package/dist/index38.mjs +15 -33
- package/dist/index39.mjs +2260 -12
- package/dist/index4.mjs +37 -37
- package/dist/index40.mjs +36 -2263
- package/dist/index41.mjs +44 -36
- package/dist/index42.mjs +99 -44
- package/dist/index43.mjs +97 -99
- package/dist/index44.mjs +47 -78
- package/dist/index45.mjs +54 -53
- package/dist/index46.mjs +63 -55
- package/dist/index47.mjs +56 -79
- package/dist/index48.mjs +57 -63
- package/dist/index49.mjs +15 -70
- package/dist/index50.mjs +14 -14
- package/dist/index51.mjs +59 -13
- package/dist/index52.mjs +99 -36
- package/dist/index53.mjs +97 -97
- package/dist/index54.mjs +4 -132
- package/dist/index58.mjs +2 -2
- package/dist/index59.mjs +234 -3
- package/dist/index60.mjs +6 -2
- package/dist/index61.mjs +133 -4
- package/dist/index62.mjs +64 -30
- package/dist/index63.mjs +84 -40
- package/dist/index64.mjs +23 -229
- package/dist/index65.mjs +8 -5
- package/dist/index66.mjs +66 -125
- package/dist/index67.mjs +3 -67
- package/dist/index68.mjs +2 -87
- package/dist/index69.mjs +78 -24
- package/dist/index70.mjs +52 -7
- package/dist/index71.mjs +5 -74
- package/dist/index72.mjs +4 -3
- package/dist/index73.mjs +179 -2
- package/dist/index74.mjs +49 -79
- package/dist/index75.mjs +68 -53
- package/dist/index76.mjs +34 -6
- package/dist/index77.mjs +42 -4
- package/dist/index78.mjs +3 -178
- package/dist/index79.mjs +2 -53
- package/dist/index80.mjs +21 -69
- package/dist/index81.mjs +54 -19
- package/dist/index82.mjs +28 -55
- package/dist/index83.mjs +5 -27
- package/dist/index84.mjs +51 -6
- package/dist/index85.mjs +5 -51
- package/dist/index86.mjs +12 -6
- package/dist/index87.mjs +7 -12
- package/dist/index88.mjs +27 -6
- package/dist/index89.mjs +2 -28
- package/dist/index90.mjs +70 -2
- package/dist/index91.mjs +164 -67
- package/dist/index92.mjs +28 -164
- package/dist/index93.mjs +10 -30
- package/dist/index94.mjs +3 -10
- package/dist/index95.mjs +3 -3
- package/dist/index96.mjs +13 -4
- package/dist/index97.mjs +7 -13
- package/dist/index98.mjs +12 -7
- package/dist/index99.mjs +4 -11
- package/dist/styles.css +1 -1
- package/package.json +11 -11
- package/src/components/OrderConfirmation.tsx +6 -1
- package/dist/index111.mjs +0 -33
- package/dist/test-utils/MockCartProvider.d.ts +0 -21
- package/dist/test-utils/MockCartProvider.d.ts.map +0 -1
package/dist/index4.mjs
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as e, jsxs as r, Fragment as T } from "react/jsx-runtime";
|
|
3
|
+
import { useState as E } from "react";
|
|
4
4
|
import "./index18.mjs";
|
|
5
5
|
import "@tanstack/react-query";
|
|
6
|
-
import { useGetOrder as
|
|
7
|
-
import { WHATSAPP_HELP_NUMBER_FORMATTED as E, WHATSAPP_HELP_LINK as M } from "./index33.mjs";
|
|
6
|
+
import { useGetOrder as U, useConfirmOrder as M } from "./index30.mjs";
|
|
8
7
|
import { Card as s, CardHeader as m, CardTitle as o, CardContent as i } from "./index12.mjs";
|
|
9
8
|
import { Button as S } from "./index11.mjs";
|
|
10
|
-
import { Badge as
|
|
11
|
-
import { Loader2 as
|
|
12
|
-
import { cn as l, formatDateTime as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import { Badge as g } from "./index13.mjs";
|
|
10
|
+
import { Loader2 as v, XCircle as _, Package as H, CheckCircle as L } from "lucide-react";
|
|
11
|
+
import { cn as l, formatDateTime as k, formatCurrency as c } from "./index17.mjs";
|
|
12
|
+
const b = "2348125648668", x = "0" + b.slice(3), W = `${x.slice(0, 4)} ${x.slice(4, 7)} ${x.slice(7)}`, $ = `https://wa.me/${b}`;
|
|
13
|
+
function V({
|
|
14
|
+
orderId: N,
|
|
15
|
+
token: f,
|
|
16
16
|
className: h,
|
|
17
|
-
headerClassName:
|
|
18
|
-
buttonClassName:
|
|
17
|
+
headerClassName: w,
|
|
18
|
+
buttonClassName: P,
|
|
19
19
|
cardClassName: n,
|
|
20
|
-
whatsappHelpLink:
|
|
21
|
-
whatsappHelpNumber: C =
|
|
22
|
-
currency:
|
|
23
|
-
locale:
|
|
20
|
+
whatsappHelpLink: A = $,
|
|
21
|
+
whatsappHelpNumber: C = W,
|
|
22
|
+
currency: B = "NGN",
|
|
23
|
+
locale: F = "en-NG"
|
|
24
24
|
}) {
|
|
25
|
-
var
|
|
26
|
-
const [p,
|
|
25
|
+
var y;
|
|
26
|
+
const [p, j] = E(!1), { data: u, isLoading: D, error: O } = U(N, f, {
|
|
27
27
|
retry: !1
|
|
28
|
-
}), d =
|
|
28
|
+
}), d = M({
|
|
29
29
|
onSuccess: (t) => {
|
|
30
|
-
|
|
30
|
+
j(!0);
|
|
31
31
|
},
|
|
32
32
|
onError: (t) => {
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
if (
|
|
35
|
+
if (D)
|
|
36
36
|
return /* @__PURE__ */ e("div", { className: l("min-h-screen bg-gray-50 flex items-center justify-center", h), children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
37
|
-
/* @__PURE__ */ e(
|
|
37
|
+
/* @__PURE__ */ e(v, { className: "h-12 w-12 animate-spin text-blue-500 mx-auto mb-4" }),
|
|
38
38
|
/* @__PURE__ */ e("p", { className: "text-gray-600", children: "Loading order details..." })
|
|
39
39
|
] }) });
|
|
40
|
-
if (
|
|
40
|
+
if (O || !u || "error" in u)
|
|
41
41
|
return /* @__PURE__ */ e("div", { className: l("min-h-screen bg-gray-50 flex items-center justify-center p-4", h), children: /* @__PURE__ */ r(s, { className: l("max-w-md w-full", n), children: [
|
|
42
42
|
/* @__PURE__ */ e(m, { children: /* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
43
|
-
/* @__PURE__ */ e(
|
|
43
|
+
/* @__PURE__ */ e(_, { className: "h-6 w-6 text-red-500" }),
|
|
44
44
|
/* @__PURE__ */ e(o, { children: "Order Not Found" })
|
|
45
45
|
] }) }),
|
|
46
46
|
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e("p", { className: "text-gray-600", children: "We couldn't find this order. The link may be invalid or expired. Please contact support if you need assistance." }) })
|
|
47
47
|
] }) });
|
|
48
48
|
const a = u;
|
|
49
49
|
return /* @__PURE__ */ e("div", { className: l("min-h-screen bg-gray-50 py-8 px-4", h), children: /* @__PURE__ */ r("div", { className: "max-w-3xl mx-auto space-y-6", children: [
|
|
50
|
-
/* @__PURE__ */ r("div", { className: l("text-center",
|
|
50
|
+
/* @__PURE__ */ r("div", { className: l("text-center", w), children: [
|
|
51
51
|
a.brand.logoUrl ? /* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-24 h-16 mb-4", children: /* @__PURE__ */ e(
|
|
52
52
|
"img",
|
|
53
53
|
{
|
|
@@ -55,7 +55,7 @@ function J({
|
|
|
55
55
|
alt: `${a.brand.name} logo`,
|
|
56
56
|
className: "max-w-full max-h-full object-contain"
|
|
57
57
|
}
|
|
58
|
-
) }) : /* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mb-4", children: /* @__PURE__ */ e(
|
|
58
|
+
) }) : /* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mb-4", children: /* @__PURE__ */ e(H, { className: "h-8 w-8 text-blue-600" }) }),
|
|
59
59
|
/* @__PURE__ */ r("h1", { className: "text-3xl font-bold text-gray-900", children: [
|
|
60
60
|
"Order #",
|
|
61
61
|
a.orderNumber
|
|
@@ -63,7 +63,7 @@ function J({
|
|
|
63
63
|
/* @__PURE__ */ e("p", { className: "text-gray-600 mt-2", children: a.brand.name })
|
|
64
64
|
] }),
|
|
65
65
|
p && /* @__PURE__ */ e(s, { className: l("border-green-200 bg-green-50", n), children: /* @__PURE__ */ e(i, { className: "pt-6", children: /* @__PURE__ */ r("div", { className: "flex items-start space-x-3", children: [
|
|
66
|
-
/* @__PURE__ */ e(
|
|
66
|
+
/* @__PURE__ */ e(L, { className: "h-6 w-6 text-green-600 mt-0.5" }),
|
|
67
67
|
/* @__PURE__ */ r("div", { children: [
|
|
68
68
|
/* @__PURE__ */ e("h3", { className: "font-semibold text-green-900", children: "Order Confirmed!" }),
|
|
69
69
|
/* @__PURE__ */ e("p", { className: "text-green-700 mt-1", children: "Thank you for confirming your order. We will contact you soon to arrange delivery." })
|
|
@@ -74,12 +74,12 @@ function J({
|
|
|
74
74
|
/* @__PURE__ */ e(
|
|
75
75
|
S,
|
|
76
76
|
{
|
|
77
|
-
onClick: () => d.mutate({ orderId:
|
|
77
|
+
onClick: () => d.mutate({ orderId: N, token: f }),
|
|
78
78
|
disabled: d.isPending,
|
|
79
|
-
className: l("w-full",
|
|
79
|
+
className: l("w-full", P),
|
|
80
80
|
size: "lg",
|
|
81
|
-
children: d.isPending ? /* @__PURE__ */ r(
|
|
82
|
-
/* @__PURE__ */ e(
|
|
81
|
+
children: d.isPending ? /* @__PURE__ */ r(T, { children: [
|
|
82
|
+
/* @__PURE__ */ e(v, { className: "mr-2 h-5 w-5 animate-spin" }),
|
|
83
83
|
"Confirming..."
|
|
84
84
|
] }) : "Confirm Order"
|
|
85
85
|
}
|
|
@@ -91,11 +91,11 @@ function J({
|
|
|
91
91
|
/* @__PURE__ */ e(i, { className: "space-y-4", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
92
92
|
/* @__PURE__ */ r("div", { children: [
|
|
93
93
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Status" }),
|
|
94
|
-
/* @__PURE__ */ e(
|
|
94
|
+
/* @__PURE__ */ e(g, { className: "mt-1", children: a.status })
|
|
95
95
|
] }),
|
|
96
96
|
/* @__PURE__ */ r("div", { children: [
|
|
97
97
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Order Date" }),
|
|
98
|
-
/* @__PURE__ */ e("p", { className: "font-medium", children: a.createdAt ?
|
|
98
|
+
/* @__PURE__ */ e("p", { className: "font-medium", children: a.createdAt ? k(a.createdAt) : "N/A" })
|
|
99
99
|
] }),
|
|
100
100
|
/* @__PURE__ */ r("div", { children: [
|
|
101
101
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Payment Method" }),
|
|
@@ -134,7 +134,7 @@ function J({
|
|
|
134
134
|
/* @__PURE__ */ r(s, { className: n, children: [
|
|
135
135
|
/* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(o, { children: "Items" }) }),
|
|
136
136
|
/* @__PURE__ */ r(i, { children: [
|
|
137
|
-
/* @__PURE__ */ e("div", { className: "space-y-4", children: (
|
|
137
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: (y = a.items) == null ? void 0 : y.map((t) => /* @__PURE__ */ r("div", { className: "flex items-start justify-between border-b pb-4 last:border-0", children: [
|
|
138
138
|
/* @__PURE__ */ r("div", { className: "flex items-start space-x-4 flex-1", children: [
|
|
139
139
|
(t.variant.thumbnailUrl || t.variant.product.thumbnailUrl) && /* @__PURE__ */ e(
|
|
140
140
|
"img",
|
|
@@ -146,7 +146,7 @@ function J({
|
|
|
146
146
|
),
|
|
147
147
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
148
148
|
/* @__PURE__ */ e("p", { className: "font-medium", children: t.variant.product.name }),
|
|
149
|
-
t.variant.name && /* @__PURE__ */ e(
|
|
149
|
+
t.variant.name && /* @__PURE__ */ e(g, { variant: "outline", className: "mt-1", children: t.variant.name }),
|
|
150
150
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-600 mt-1", children: [
|
|
151
151
|
"Quantity: ",
|
|
152
152
|
t.quantity
|
|
@@ -193,10 +193,10 @@ function J({
|
|
|
193
193
|
C,
|
|
194
194
|
" or contact us on",
|
|
195
195
|
" ",
|
|
196
|
-
/* @__PURE__ */ e("a", { href:
|
|
196
|
+
/* @__PURE__ */ e("a", { href: A, target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 hover:underline", children: "WhatsApp" })
|
|
197
197
|
] }) }) })
|
|
198
198
|
] }) });
|
|
199
199
|
}
|
|
200
200
|
export {
|
|
201
|
-
|
|
201
|
+
V as OrderConfirmation
|
|
202
202
|
};
|