@instockng/storefront-ui 1.0.11 → 1.0.13

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.
Files changed (75) hide show
  1. package/dist/components/Checkout.d.ts.map +1 -1
  2. package/dist/components/ShoppingCart.d.ts.map +1 -1
  3. package/dist/contexts/CartContext.d.ts +2 -0
  4. package/dist/contexts/CartContext.d.ts.map +1 -1
  5. package/dist/index10.mjs +70 -70
  6. package/dist/index101.mjs +1 -1
  7. package/dist/index102.mjs +3 -3
  8. package/dist/index103.mjs +3 -3
  9. package/dist/index105.mjs +1 -1
  10. package/dist/index111.mjs +1 -1
  11. package/dist/index29.mjs +1 -1
  12. package/dist/index3.mjs +83 -78
  13. package/dist/index30.mjs +1 -1
  14. package/dist/index31.mjs +1 -1
  15. package/dist/index32.mjs +1 -1
  16. package/dist/index42.mjs +17 -17
  17. package/dist/index43.mjs +2 -2
  18. package/dist/index44.mjs +1 -1
  19. package/dist/index45.mjs +1 -1
  20. package/dist/index46.mjs +1 -1
  21. package/dist/index47.mjs +1 -1
  22. package/dist/index48.mjs +1 -1
  23. package/dist/index49.mjs +1 -1
  24. package/dist/index50.mjs +1 -1
  25. package/dist/index51.mjs +1 -1
  26. package/dist/index52.mjs +1 -1
  27. package/dist/index53.mjs +1 -1
  28. package/dist/index54.mjs +1 -1
  29. package/dist/index58.mjs +2 -2
  30. package/dist/index59.mjs +3 -4
  31. package/dist/index60.mjs +2 -4
  32. package/dist/index61.mjs +5 -2
  33. package/dist/index62.mjs +231 -30
  34. package/dist/index63.mjs +5 -42
  35. package/dist/index64.mjs +127 -228
  36. package/dist/index65.mjs +66 -4
  37. package/dist/index66.mjs +77 -124
  38. package/dist/index67.mjs +26 -65
  39. package/dist/index68.mjs +6 -84
  40. package/dist/index69.mjs +72 -26
  41. package/dist/index70.mjs +3 -8
  42. package/dist/index71.mjs +2 -75
  43. package/dist/index72.mjs +82 -3
  44. package/dist/index73.mjs +54 -2
  45. package/dist/index74.mjs +5 -82
  46. package/dist/index75.mjs +4 -53
  47. package/dist/index76.mjs +178 -5
  48. package/dist/index77.mjs +53 -5
  49. package/dist/index78.mjs +68 -178
  50. package/dist/index79.mjs +31 -50
  51. package/dist/index8.mjs +8 -7
  52. package/dist/index80.mjs +43 -69
  53. package/dist/index81.mjs +2 -2
  54. package/dist/index82.mjs +1 -1
  55. package/dist/index83.mjs +6 -6
  56. package/dist/index84.mjs +2 -2
  57. package/dist/index85.mjs +2 -2
  58. package/dist/index87.mjs +2 -2
  59. package/dist/index88.mjs +2 -2
  60. package/dist/index89.mjs +1 -1
  61. package/dist/index91.mjs +4 -4
  62. package/dist/index92.mjs +3 -3
  63. package/dist/index93.mjs +12 -30
  64. package/dist/index94.mjs +7 -11
  65. package/dist/index95.mjs +30 -3
  66. package/dist/index96.mjs +10 -3
  67. package/dist/index97.mjs +4 -13
  68. package/dist/index98.mjs +4 -7
  69. package/dist/index99.mjs +1 -1
  70. package/dist/test-utils/MockCartProvider.d.ts.map +1 -1
  71. package/package.json +1 -1
  72. package/src/components/Checkout.tsx +9 -1
  73. package/src/components/ShoppingCart.tsx +1 -0
  74. package/src/contexts/CartContext.tsx +51 -24
  75. package/src/test-utils/MockCartProvider.tsx +8 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Checkout.d.ts","sourceRoot":"","sources":["../../src/components/Checkout.tsx"],"names":[],"mappings":"AA4FA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,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C;IACjC,gDAAgD;IAChD,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,uBAAuB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,gBAAuB,EACvB,kBAA+B,EAC/B,oBAA0C,EAC1C,uBAAuB,EACvB,+BAA+B,EAC/B,eAAuB,EACvB,YAAmC,GACpC,EAAE,iBAAiB,2CA4MnB"}
@@ -32,6 +32,8 @@ interface CartContextValue {
32
32
  removeDiscount: () => Promise<void>;
33
33
  /** Clear cart (removes from localStorage) */
34
34
  clearCart: () => void;
35
+ /** Clear cart and create a new one immediately */
36
+ clearAndCreateNewCart: () => void;
35
37
  /** Refresh cart data */
36
38
  refetch: () => void;
37
39
  /** Whether the cart modal is open */
@@ -1 +1 @@
1
- {"version":3,"file":"CartContext.d.ts","sourceRoot":"","sources":["../../src/contexts/CartContext.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAkD,SAAS,EAAuB,MAAM,OAAO,CAAC;AACvG,OAAO,EAGL,aAAa,EAMb,eAAe,EACf,KAAK,IAAI,EACV,MAAM,iBAAiB,CAAC;AAKzB,UAAU,gBAAgB;IACxB,wBAAwB;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,mDAAmD;IACnD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,oBAAoB;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,gDAAgD;IAChD,kBAAkB,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IACrD,+CAA+C;IAC/C,gBAAgB,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IACrD,8BAA8B;IAC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pB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,kDAA+C,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,4BAA4B,EAAE,iBAAiB,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC;CACxG;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,2CAoPxG;AAED;;GAEG;AACH,wBAAgB,OAAO,qBAMtB"}
package/dist/index10.mjs CHANGED
@@ -1,51 +1,51 @@
1
1
  'use client';
2
- import { jsxs as a, jsx as e, Fragment as fe } from "react/jsx-runtime";
3
- import { useState as N, useEffect as q, useMemo as te, useCallback as pe } from "react";
4
- import { object as $, string as y, ValidationError as ve } from "./index34.mjs";
2
+ import { jsxs as a, jsx as e, Fragment as pe } from "react/jsx-runtime";
3
+ import { useState as N, useEffect as q, useMemo as re, useCallback as ve } from "react";
4
+ import { object as $, string as y, ValidationError as Ne } from "./index34.mjs";
5
5
  import "./index18.mjs";
6
6
  import "@tanstack/react-query";
7
- import { useGetDeliveryZones as Ne } from "./index32.mjs";
8
- import { useCart as ge } from "./index3.mjs";
9
- import { Modal as re } from "./index14.mjs";
7
+ import { useGetDeliveryZones as ge } from "./index32.mjs";
8
+ import { useCart as be } from "./index3.mjs";
9
+ import { Modal as ae } from "./index14.mjs";
10
10
  import { FormInput as P } from "./index15.mjs";
11
- import { FormSelect as ae } from "./index16.mjs";
11
+ import { FormSelect as se } from "./index16.mjs";
12
12
  import { Button as L } from "./index11.mjs";
13
- import { Loader2 as R, ChevronLeft as be, ChevronRight as xe, CheckCircle as we, Package as Ce, Mail as Pe, Phone as ke, Zap as Me, Banknote as qe, ChevronDown as Ie } from "lucide-react";
13
+ import { Loader2 as R, ChevronLeft as xe, ChevronRight as we, CheckCircle as Ce, Package as Pe, Mail as ke, Phone as Me, Zap as qe, Banknote as Ie, ChevronDown as Ze } from "lucide-react";
14
14
  import { formatCurrency as k, cn as w } from "./index17.mjs";
15
- import Ze from "./index35.mjs";
16
- import { usePaystackPayment as je } from "./index36.mjs";
17
- const Se = (d) => d.replace(/\D/g, ""), ze = $({
15
+ import je from "./index35.mjs";
16
+ import { usePaystackPayment as Se } from "./index36.mjs";
17
+ const ze = (d) => d.replace(/\D/g, ""), Fe = $({
18
18
  firstName: y().required("First name is required").min(2, "First name must be at least 2 characters").max(50, "First name must be less than 50 characters"),
19
19
  lastName: y().required("Last name is required").min(2, "Last name must be at least 2 characters").max(50, "Last name must be less than 50 characters"),
20
20
  email: y().required("Email is required").email("Please enter a valid email address"),
21
21
  phone: y().required("Phone number is required").test("nigerian-phone", "Please enter a valid Nigerian phone number (e.g. 0812 564 8668)", (d) => {
22
22
  if (!d) return !1;
23
- const M = Se(d);
23
+ const M = ze(d);
24
24
  return [
25
25
  /^0[789]\d{9}$/
26
26
  // 0xxxxxxxxx (11 digits total)
27
27
  ].some((f) => f.test(M));
28
28
  })
29
- }), Fe = $({
29
+ }), Le = $({
30
30
  address: y().required("Street address is required").min(10, "Please provide a complete address"),
31
31
  city: y().required("City is required").min(3, "City name must be at least 3 characters"),
32
32
  state: y().required("State is required").test("not-empty", "State is required", (d) => !!d && d.trim() !== ""),
33
33
  deliveryZoneId: y().required("Delivery zone is required").test("not-empty", "Delivery zone is required", (d) => !!d && d.trim() !== "")
34
- }), Le = $({
34
+ }), Be = $({
35
35
  paymentMethod: y().oneOf(["cod", "online"], "Please select a payment method").required("Payment method is required")
36
36
  });
37
- function Xe({
37
+ function Ee({
38
38
  isOpen: d,
39
39
  onClose: M,
40
40
  initialData: l,
41
41
  onSuccess: f,
42
42
  onError: c,
43
- submitButtonText: se = "Place Order",
43
+ submitButtonText: ne = "Place Order",
44
44
  refundPolicy: I
45
45
  }) {
46
- var W, J, Q, U, X, E, D, ee;
47
- const ne = "pk_live_dfb74efb5f74d2acbc253d5ca396ab9015ef0fa7", [o, p] = N("customer"), [Z, le] = N(void 0), [g, G] = N(void 0), [u, B] = N(null), { refetch: K, isLoading: O, cart: s, updateCartMutation: T, checkoutMutation: de } = ge(), V = je({
48
- publicKey: ne,
46
+ var J, Q, U, X, E, D, ee, te;
47
+ const le = "pk_live_dfb74efb5f74d2acbc253d5ca396ab9015ef0fa7", [o, p] = N("customer"), [Z, de] = N(void 0), [g, G] = N(void 0), [u, B] = N(null), { refetch: K, isLoading: O, cart: s, updateCartMutation: T, checkoutMutation: ie, clearAndCreateNewCart: V } = be(), Y = Se({
48
+ publicKey: le,
49
49
  onSuccess: async (t) => {
50
50
  try {
51
51
  const n = await C.mutateAsync({
@@ -64,7 +64,7 @@ function Xe({
64
64
  c == null || c(new Error((i == null ? void 0 : i.message) || "Checkout failed"));
65
65
  return;
66
66
  }
67
- B(n), f == null || f(n.id);
67
+ B(n), V(), f == null || f(n.id);
68
68
  } catch (n) {
69
69
  c == null || c(n);
70
70
  }
@@ -76,9 +76,9 @@ function Xe({
76
76
  q(() => {
77
77
  d && K();
78
78
  }, [d, K]);
79
- const { data: b } = Ne(((W = s == null ? void 0 : s.brand) == null ? void 0 : W.id) || "", {
80
- enabled: !!((J = s == null ? void 0 : s.brand) != null && J.id)
81
- }), h = te(() => b == null ? void 0 : b.find((t) => t.id === Z), [b, Z]), C = de;
79
+ const { data: b } = ge(((J = s == null ? void 0 : s.brand) == null ? void 0 : J.id) || "", {
80
+ enabled: !!((Q = s == null ? void 0 : s.brand) != null && Q.id)
81
+ }), h = re(() => b == null ? void 0 : b.find((t) => t.id === Z), [b, Z]), C = ie;
82
82
  q(() => {
83
83
  d || (B(null), p("customer"), C.reset());
84
84
  }, [d]);
@@ -96,9 +96,9 @@ function Xe({
96
96
  q(() => {
97
97
  d && p("customer");
98
98
  }, [d]);
99
- const [Y, H] = N(!1);
99
+ const [H, W] = N(!1);
100
100
  q(() => {
101
- d && s && !l && !Y && (_((t) => {
101
+ d && s && !l && !H && (_((t) => {
102
102
  var n;
103
103
  return {
104
104
  ...t,
@@ -108,8 +108,8 @@ function Xe({
108
108
  phone: s.customerPhone || t.phone,
109
109
  deliveryZoneId: ((n = s.deliveryZone) == null ? void 0 : n.id) || t.deliveryZoneId
110
110
  };
111
- }), H(!0)), d || H(!1);
112
- }, [d, s, l, Y]), q(() => {
111
+ }), W(!0)), d || W(!1);
112
+ }, [d, s, l, H]), q(() => {
113
113
  if (g) {
114
114
  const t = h == null ? void 0 : h.zones.find((n) => n.id === g);
115
115
  t && _((n) => ({
@@ -118,10 +118,10 @@ function Xe({
118
118
  }));
119
119
  }
120
120
  }, [g, h]);
121
- const [m, j] = N({}), [A, ie] = N(!1), v = (t) => {
121
+ const [m, j] = N({}), [A, ce] = N(!1), v = (t) => {
122
122
  const { name: n, value: i } = t.target;
123
123
  _((x) => ({ ...x, [n]: i })), m[n] && j((x) => ({ ...x, [n]: void 0 }));
124
- }, S = pe(
124
+ }, S = ve(
125
125
  (t) => {
126
126
  const n = r[t];
127
127
  if (!n) return;
@@ -133,7 +133,7 @@ function Xe({
133
133
  const n = {};
134
134
  try {
135
135
  if (t === "customer")
136
- ze.validateSync(r, { abortEarly: !1 });
136
+ Fe.validateSync(r, { abortEarly: !1 });
137
137
  else if (t === "delivery") {
138
138
  const i = {
139
139
  address: r.address,
@@ -141,19 +141,19 @@ function Xe({
141
141
  state: Z || r.state || "",
142
142
  deliveryZoneId: g || r.deliveryZoneId || ""
143
143
  };
144
- Fe.validateSync(i, { abortEarly: !1 });
145
- } else t === "payment" && Le.validateSync(r, { abortEarly: !1 });
144
+ Le.validateSync(i, { abortEarly: !1 });
145
+ } else t === "payment" && Be.validateSync(r, { abortEarly: !1 });
146
146
  } catch (i) {
147
- i instanceof ve && i.inner.forEach((x) => {
147
+ i instanceof Ne && i.inner.forEach((x) => {
148
148
  x.path && (n[x.path] = x.message);
149
149
  });
150
150
  }
151
151
  return j(n), Object.keys(n).length === 0;
152
- }, ce = () => {
153
- z(o) && (o === "customer" ? p("delivery") : o === "delivery" && p("payment"));
154
152
  }, oe = () => {
153
+ z(o) && (o === "customer" ? p("delivery") : o === "delivery" && p("payment"));
154
+ }, me = () => {
155
155
  o === "payment" ? p("delivery") : o === "delivery" && p("customer");
156
- }, me = async () => {
156
+ }, ue = async () => {
157
157
  if (!z("customer")) {
158
158
  p("customer");
159
159
  return;
@@ -164,12 +164,12 @@ function Xe({
164
164
  }
165
165
  if (z("payment")) {
166
166
  if (r.paymentMethod === "online") {
167
- if (!V.isLoaded) {
167
+ if (!Y.isLoaded) {
168
168
  c == null || c(new Error("Payment system is loading. Please try again."));
169
169
  return;
170
170
  }
171
171
  const t = Math.round(s.pricing.total * 100);
172
- V.initializePayment({
172
+ Y.initializePayment({
173
173
  email: r.email || (s == null ? void 0 : s.customerEmail) || "customer@example.com",
174
174
  amount: t,
175
175
  currency: "NGN",
@@ -207,37 +207,37 @@ function Xe({
207
207
  c == null || c(new Error((n == null ? void 0 : n.message) || "Checkout failed"));
208
208
  return;
209
209
  }
210
- B(t), f == null || f(t.id);
210
+ B(t), V(), f == null || f(t.id);
211
211
  } catch (t) {
212
212
  c == null || c(t);
213
213
  }
214
214
  }
215
- }, ue = {
215
+ }, he = {
216
216
  customer: "Customer Information",
217
217
  delivery: "Delivery Address",
218
218
  payment: "Payment Method"
219
- }, he = te(() => ue[o], [o]), ye = /* @__PURE__ */ a("div", { className: "space-y-3", children: [
220
- (o === "payment" || o === "delivery") && ((Q = s == null ? void 0 : s.pricing) == null ? void 0 : Q.total) && /* @__PURE__ */ a("div", { className: "text-sm text-black relative", children: [
219
+ }, ye = re(() => he[o], [o]), fe = /* @__PURE__ */ a("div", { className: "space-y-3", children: [
220
+ (o === "payment" || o === "delivery") && ((U = s == null ? void 0 : s.pricing) == null ? void 0 : U.total) && /* @__PURE__ */ a("div", { className: "text-sm text-black relative", children: [
221
221
  O && /* @__PURE__ */ e("div", { className: "absolute flex items-center justify-center inset-0 bg-white opacity-50", children: /* @__PURE__ */ e(R, { className: "animate-spin text-accent-500" }) }),
222
222
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
223
223
  /* @__PURE__ */ e("span", { children: "Subtotal" }),
224
- /* @__PURE__ */ e("span", { children: k(((U = s == null ? void 0 : s.pricing) == null ? void 0 : U.subtotal) ?? 0) })
224
+ /* @__PURE__ */ e("span", { children: k(((X = s == null ? void 0 : s.pricing) == null ? void 0 : X.subtotal) ?? 0) })
225
225
  ] }),
226
226
  s.pricing.discount && /* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
227
227
  /* @__PURE__ */ e("span", { children: "Discount" }),
228
228
  /* @__PURE__ */ a("span", { className: "text-green-600", children: [
229
229
  "-",
230
- k(((E = (X = s == null ? void 0 : s.pricing) == null ? void 0 : X.discount) == null ? void 0 : E.amount) ?? 0)
230
+ k(((D = (E = s == null ? void 0 : s.pricing) == null ? void 0 : E.discount) == null ? void 0 : D.amount) ?? 0)
231
231
  ] })
232
232
  ] }),
233
233
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
234
234
  /* @__PURE__ */ e("span", { children: "Delivery Fee" }),
235
- /* @__PURE__ */ e("span", { children: k(((D = s == null ? void 0 : s.pricing) == null ? void 0 : D.deliveryCharge) ?? 0) })
235
+ /* @__PURE__ */ e("span", { children: k(((ee = s == null ? void 0 : s.pricing) == null ? void 0 : ee.deliveryCharge) ?? 0) })
236
236
  ] }),
237
237
  /* @__PURE__ */ e("hr", { className: "border-gray-200 my-2" }),
238
238
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
239
239
  /* @__PURE__ */ e("span", { children: "Total" }),
240
- /* @__PURE__ */ e("span", { children: k(((ee = s == null ? void 0 : s.pricing) == null ? void 0 : ee.total) ?? 0) })
240
+ /* @__PURE__ */ e("span", { children: k(((te = s == null ? void 0 : s.pricing) == null ? void 0 : te.total) ?? 0) })
241
241
  ] })
242
242
  ] }),
243
243
  /* @__PURE__ */ a("div", { className: "flex gap-3", children: [
@@ -246,11 +246,11 @@ function Xe({
246
246
  {
247
247
  type: "button",
248
248
  variant: "outline",
249
- onClick: oe,
249
+ onClick: me,
250
250
  className: "flex-1 border-gray-400",
251
251
  size: "lg",
252
252
  children: [
253
- /* @__PURE__ */ e(be, { className: "mr-2 h-4 w-4" }),
253
+ /* @__PURE__ */ e(xe, { className: "mr-2 h-4 w-4" }),
254
254
  "Back"
255
255
  ]
256
256
  }
@@ -259,33 +259,33 @@ function Xe({
259
259
  L,
260
260
  {
261
261
  type: "button",
262
- onClick: ce,
262
+ onClick: oe,
263
263
  className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
264
264
  size: "lg",
265
265
  children: [
266
266
  "Next",
267
- /* @__PURE__ */ e(xe, { className: "ml-2 h-4 w-4" })
267
+ /* @__PURE__ */ e(we, { className: "ml-2 h-4 w-4" })
268
268
  ]
269
269
  }
270
270
  ) : /* @__PURE__ */ e(
271
271
  L,
272
272
  {
273
273
  type: "button",
274
- onClick: me,
274
+ onClick: ue,
275
275
  disabled: C.isPending,
276
276
  className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
277
277
  size: "lg",
278
- children: C.isPending ? /* @__PURE__ */ a(fe, { children: [
278
+ children: C.isPending ? /* @__PURE__ */ a(pe, { children: [
279
279
  /* @__PURE__ */ e(R, { className: "mr-2 h-4 w-4 animate-spin" }),
280
280
  "Processing..."
281
- ] }) : se
281
+ ] }) : ne
282
282
  }
283
283
  )
284
284
  ] }),
285
285
  C.isError && /* @__PURE__ */ e("div", { className: "rounded-lg bg-red-50 p-3 text-sm text-red-600", children: "Failed to place order. Please check your information and try again." })
286
286
  ] }), F = (t) => !(s != null && s.availablePaymentMethods.includes(t));
287
287
  return u ? /* @__PURE__ */ e(
288
- re,
288
+ ae,
289
289
  {
290
290
  isOpen: d,
291
291
  onClose: M,
@@ -302,14 +302,14 @@ function Xe({
302
302
  size: "lg",
303
303
  contentClassName: "p-6",
304
304
  children: /* @__PURE__ */ a("div", { className: "text-center space-y-6", children: [
305
- /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e(we, { className: "h-12 w-12 text-green-600" }) }) }),
305
+ /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e(Ce, { className: "h-12 w-12 text-green-600" }) }) }),
306
306
  /* @__PURE__ */ a("div", { className: "space-y-2", children: [
307
307
  /* @__PURE__ */ e("h3", { className: "text-2xl font-bold text-gray-900", children: "Thank You!" }),
308
308
  /* @__PURE__ */ e("p", { className: "text-gray-600", children: "Your order has been placed successfully." })
309
309
  ] }),
310
310
  /* @__PURE__ */ a("div", { className: "bg-gray-50 rounded-lg p-6 space-y-4", children: [
311
311
  /* @__PURE__ */ a("div", { className: "flex items-center justify-center space-x-2 text-gray-700", children: [
312
- /* @__PURE__ */ e(Ce, { className: "h-5 w-5" }),
312
+ /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
313
313
  /* @__PURE__ */ a("span", { className: "font-medium", children: [
314
314
  "Order #",
315
315
  u.orderNumber
@@ -350,12 +350,12 @@ function Xe({
350
350
  ] })
351
351
  }
352
352
  ) : /* @__PURE__ */ e(
353
- re,
353
+ ae,
354
354
  {
355
355
  isOpen: d,
356
356
  onClose: M,
357
- title: he,
358
- footer: ye,
357
+ title: ye,
358
+ footer: fe,
359
359
  size: "lg",
360
360
  contentClassName: "p-0",
361
361
  children: O ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[300px]", children: /* @__PURE__ */ e(R, { className: "h-8 w-8 animate-spin text-gray-600" }) }) : /* @__PURE__ */ e("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "relative w-full", children: /* @__PURE__ */ a(
@@ -407,7 +407,7 @@ function Xe({
407
407
  onChange: v,
408
408
  onBlur: () => S("email"),
409
409
  error: m.email,
410
- icon: /* @__PURE__ */ e(Pe, { size: 16 }),
410
+ icon: /* @__PURE__ */ e(ke, { size: 16 }),
411
411
  autoCorrect: "off",
412
412
  required: !0
413
413
  }
@@ -424,7 +424,7 @@ function Xe({
424
424
  placeholder: "e.g. 08012345678",
425
425
  maxLength: 18,
426
426
  error: m.phone,
427
- icon: /* @__PURE__ */ e(ke, { size: 16 }),
427
+ icon: /* @__PURE__ */ e(Me, { size: 16 }),
428
428
  autoCorrect: "off",
429
429
  required: !0,
430
430
  className: "font-semibold"
@@ -460,7 +460,7 @@ function Xe({
460
460
  }
461
461
  ),
462
462
  /* @__PURE__ */ a(
463
- ae,
463
+ se,
464
464
  {
465
465
  label: "State",
466
466
  name: "state",
@@ -468,7 +468,7 @@ function Xe({
468
468
  onChange: (t) => {
469
469
  G("");
470
470
  const n = t.target.value;
471
- le(n || void 0), m.state && j((i) => ({ ...i, state: void 0 }));
471
+ de(n || void 0), m.state && j((i) => ({ ...i, state: void 0 }));
472
472
  },
473
473
  error: m.state,
474
474
  required: !0,
@@ -479,7 +479,7 @@ function Xe({
479
479
  }
480
480
  ),
481
481
  /* @__PURE__ */ a(
482
- ae,
482
+ se,
483
483
  {
484
484
  label: "Delivery Zone",
485
485
  value: g || "",
@@ -534,7 +534,7 @@ function Xe({
534
534
  "p-3 rounded-full",
535
535
  r.paymentMethod === "online" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
536
536
  ),
537
- children: /* @__PURE__ */ e(Me, { size: 24 })
537
+ children: /* @__PURE__ */ e(qe, { size: 24 })
538
538
  }
539
539
  ),
540
540
  /* @__PURE__ */ a("div", { children: [
@@ -543,7 +543,7 @@ function Xe({
543
543
  /* @__PURE__ */ e(
544
544
  "img",
545
545
  {
546
- src: Ze,
546
+ src: je,
547
547
  alt: "Paystack",
548
548
  className: "h-4 w-auto mt-2 mx-auto"
549
549
  }
@@ -583,7 +583,7 @@ function Xe({
583
583
  "p-3 rounded-full",
584
584
  r.paymentMethod === "cod" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
585
585
  ),
586
- children: /* @__PURE__ */ e(qe, { size: 24 })
586
+ children: /* @__PURE__ */ e(Ie, { size: 24 })
587
587
  }
588
588
  ),
589
589
  /* @__PURE__ */ a("div", { children: [
@@ -602,12 +602,12 @@ function Xe({
602
602
  "button",
603
603
  {
604
604
  type: "button",
605
- onClick: () => ie(!A),
605
+ onClick: () => ce(!A),
606
606
  className: "overflow-hidden w-full flex items-center overflow-hidden rounded-lg rounded-b-none justify-between p-4 text-left hover:bg-gray-50 transition-colors",
607
607
  children: [
608
608
  /* @__PURE__ */ e("span", { className: "text-sm font-medium text-gray-700", children: I.title || "🤔 Curious about Refunds?" }),
609
609
  /* @__PURE__ */ e(
610
- Ie,
610
+ Ze,
611
611
  {
612
612
  size: 16,
613
613
  className: w(
@@ -644,5 +644,5 @@ function Xe({
644
644
  );
645
645
  }
646
646
  export {
647
- Xe as Checkout
647
+ Ee as Checkout
648
648
  };
package/dist/index101.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import i from "./index108.mjs";
3
3
  import m from "./index109.mjs";
4
- import f from "./index64.mjs";
4
+ import f from "./index62.mjs";
5
5
  const h = (t, o, a = 3) => {
6
6
  let r = 0;
7
7
  const c = i(50, 250);
package/dist/index102.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import n from "./index88.mjs";
3
- import m from "./index64.mjs";
3
+ import m from "./index62.mjs";
4
4
  import c from "./index110.mjs";
5
5
  import h from "./index111.mjs";
6
6
  import w from "./index84.mjs";
7
- import b from "./index67.mjs";
8
- import C from "./index78.mjs";
7
+ import b from "./index65.mjs";
8
+ import C from "./index76.mjs";
9
9
  import g from "./index81.mjs";
10
10
  const E = (a) => {
11
11
  const e = b({}, a);
package/dist/index103.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import a from "./index70.mjs";
3
- import s from "./index75.mjs";
4
- import m from "./index64.mjs";
2
+ import a from "./index68.mjs";
3
+ import s from "./index73.mjs";
4
+ import m from "./index62.mjs";
5
5
  const h = (e, t) => {
6
6
  const { length: l } = e = e ? e.filter(Boolean) : [];
7
7
  if (t || l) {
package/dist/index105.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import a from "./index93.mjs";
2
+ import a from "./index95.mjs";
3
3
  const e = typeof URLSearchParams < "u" ? URLSearchParams : a;
4
4
  export {
5
5
  e as default
package/dist/index111.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import r from "./index64.mjs";
2
+ import r from "./index62.mjs";
3
3
  import c from "./index88.mjs";
4
4
  const p = c.hasStandardBrowserEnv ? (
5
5
  // Standard browser envs support document.cookie
package/dist/index29.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as s, useMutation as i } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as o } from "./index59.mjs";
3
+ import { useQueryUnwrapped as o } from "./index61.mjs";
4
4
  import { queryKeys as r } from "./index26.mjs";
5
5
  import { updateCart as c, createCart as l, applyDiscount as y, removeDiscount as m, addCartItem as C, updateCartItem as p, removeCartItem as q, checkoutCart as d, fetchCart as f } from "./index23.mjs";
6
6
  function b(e, t) {