@instockng/storefront-ui 1.0.0
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/README.md +394 -0
- package/dist/components/CartItem.d.ts +15 -0
- package/dist/components/CartItem.d.ts.map +1 -0
- package/dist/components/Checkout.d.ts +39 -0
- package/dist/components/Checkout.d.ts.map +1 -0
- package/dist/components/DiscountCodeInput.d.ts +20 -0
- package/dist/components/DiscountCodeInput.d.ts.map +1 -0
- package/dist/components/OrderConfirmation.d.ts +30 -0
- package/dist/components/OrderConfirmation.d.ts.map +1 -0
- package/dist/components/ProductCard.d.ts +42 -0
- package/dist/components/ProductCard.d.ts.map +1 -0
- package/dist/components/ProductGrid.d.ts +33 -0
- package/dist/components/ProductGrid.d.ts.map +1 -0
- package/dist/components/ShoppingCart.d.ts +28 -0
- package/dist/components/ShoppingCart.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/form-input.d.ts +20 -0
- package/dist/components/ui/form-input.d.ts.map +1 -0
- package/dist/components/ui/form-select.d.ts +18 -0
- package/dist/components/ui/form-select.d.ts.map +1 -0
- package/dist/components/ui/modal.d.ts +31 -0
- package/dist/components/ui/modal.d.ts.map +1 -0
- package/dist/contexts/CartContext.d.ts +60 -0
- package/dist/contexts/CartContext.d.ts.map +1 -0
- package/dist/hooks/usePaystackPayment.d.ts +46 -0
- package/dist/hooks/usePaystackPayment.d.ts.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +99 -0
- package/dist/index10.mjs +644 -0
- package/dist/index100.mjs +7 -0
- package/dist/index101.mjs +35 -0
- package/dist/index102.mjs +33 -0
- package/dist/index103.mjs +30 -0
- package/dist/index104.mjs +63 -0
- package/dist/index105.mjs +5 -0
- package/dist/index106.mjs +4 -0
- package/dist/index107.mjs +4 -0
- package/dist/index108.mjs +19 -0
- package/dist/index109.mjs +15 -0
- package/dist/index11.mjs +62 -0
- package/dist/index110.mjs +8 -0
- package/dist/index111.mjs +32 -0
- package/dist/index12.mjs +64 -0
- package/dist/index13.mjs +26 -0
- package/dist/index14.mjs +117 -0
- package/dist/index15.mjs +44 -0
- package/dist/index16.mjs +44 -0
- package/dist/index17.mjs +44 -0
- package/dist/index18.mjs +43 -0
- package/dist/index19.mjs +11 -0
- package/dist/index2.mjs +24 -0
- package/dist/index20.mjs +29 -0
- package/dist/index21.mjs +34 -0
- package/dist/index22.mjs +22 -0
- package/dist/index23.mjs +90 -0
- package/dist/index24.mjs +22 -0
- package/dist/index25.mjs +13 -0
- package/dist/index26.mjs +99 -0
- package/dist/index27.mjs +20 -0
- package/dist/index28.mjs +67 -0
- package/dist/index29.mjs +98 -0
- package/dist/index3.mjs +121 -0
- package/dist/index30.mjs +21 -0
- package/dist/index31.mjs +21 -0
- package/dist/index32.mjs +13 -0
- package/dist/index33.mjs +6 -0
- package/dist/index34.mjs +1435 -0
- package/dist/index35.mjs +4 -0
- package/dist/index36.mjs +59 -0
- package/dist/index37.mjs +53 -0
- package/dist/index38.mjs +35 -0
- package/dist/index39.mjs +17 -0
- package/dist/index4.mjs +201 -0
- package/dist/index40.mjs +2265 -0
- package/dist/index41.mjs +25 -0
- package/dist/index42.mjs +38 -0
- package/dist/index43.mjs +46 -0
- package/dist/index44.mjs +101 -0
- package/dist/index45.mjs +114 -0
- package/dist/index46.mjs +78 -0
- package/dist/index47.mjs +89 -0
- package/dist/index48.mjs +106 -0
- package/dist/index49.mjs +87 -0
- package/dist/index5.mjs +112 -0
- package/dist/index50.mjs +76 -0
- package/dist/index51.mjs +20 -0
- package/dist/index52.mjs +19 -0
- package/dist/index53.mjs +64 -0
- package/dist/index54.mjs +131 -0
- package/dist/index55.mjs +135 -0
- package/dist/index56.mjs +77 -0
- package/dist/index57.mjs +17 -0
- package/dist/index58.mjs +65 -0
- package/dist/index59.mjs +6 -0
- package/dist/index6.mjs +82 -0
- package/dist/index60.mjs +4 -0
- package/dist/index61.mjs +7 -0
- package/dist/index62.mjs +36 -0
- package/dist/index63.mjs +45 -0
- package/dist/index64.mjs +237 -0
- package/dist/index65.mjs +8 -0
- package/dist/index66.mjs +136 -0
- package/dist/index67.mjs +70 -0
- package/dist/index68.mjs +89 -0
- package/dist/index69.mjs +31 -0
- package/dist/index7.mjs +100 -0
- package/dist/index70.mjs +11 -0
- package/dist/index71.mjs +77 -0
- package/dist/index72.mjs +6 -0
- package/dist/index73.mjs +4 -0
- package/dist/index74.mjs +85 -0
- package/dist/index75.mjs +56 -0
- package/dist/index76.mjs +8 -0
- package/dist/index77.mjs +7 -0
- package/dist/index78.mjs +181 -0
- package/dist/index79.mjs +55 -0
- package/dist/index8.mjs +165 -0
- package/dist/index80.mjs +71 -0
- package/dist/index81.mjs +23 -0
- package/dist/index82.mjs +58 -0
- package/dist/index83.mjs +31 -0
- package/dist/index84.mjs +9 -0
- package/dist/index85.mjs +54 -0
- package/dist/index86.mjs +8 -0
- package/dist/index87.mjs +14 -0
- package/dist/index88.mjs +9 -0
- package/dist/index89.mjs +30 -0
- package/dist/index9.mjs +100 -0
- package/dist/index90.mjs +4 -0
- package/dist/index91.mjs +72 -0
- package/dist/index92.mjs +169 -0
- package/dist/index93.mjs +15 -0
- package/dist/index94.mjs +9 -0
- package/dist/index95.mjs +33 -0
- package/dist/index96.mjs +13 -0
- package/dist/index97.mjs +6 -0
- package/dist/index98.mjs +6 -0
- package/dist/index99.mjs +14 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/mockServiceWorker.js +349 -0
- package/dist/providers/StorefrontProvider.d.ts +47 -0
- package/dist/providers/StorefrontProvider.d.ts.map +1 -0
- package/dist/test-utils/MockCartProvider.d.ts +21 -0
- package/dist/test-utils/MockCartProvider.d.ts.map +1 -0
- package/package.json +77 -0
package/dist/index78.mjs
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import i from "./index64.mjs";
|
|
2
|
+
import S from "./index89.mjs";
|
|
3
|
+
const h = Symbol("internals");
|
|
4
|
+
function y(r) {
|
|
5
|
+
return r && String(r).trim().toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
function m(r) {
|
|
8
|
+
return r === !1 || r == null ? r : i.isArray(r) ? r.map(m) : String(r);
|
|
9
|
+
}
|
|
10
|
+
function A(r) {
|
|
11
|
+
const t = /* @__PURE__ */ Object.create(null), e = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
12
|
+
let s;
|
|
13
|
+
for (; s = e.exec(r); )
|
|
14
|
+
t[s[1]] = s[2];
|
|
15
|
+
return t;
|
|
16
|
+
}
|
|
17
|
+
const k = (r) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());
|
|
18
|
+
function g(r, t, e, s, n) {
|
|
19
|
+
if (i.isFunction(s))
|
|
20
|
+
return s.call(this, t, e);
|
|
21
|
+
if (n && (t = e), !!i.isString(t)) {
|
|
22
|
+
if (i.isString(s))
|
|
23
|
+
return t.indexOf(s) !== -1;
|
|
24
|
+
if (i.isRegExp(s))
|
|
25
|
+
return s.test(t);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function E(r) {
|
|
29
|
+
return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, e, s) => e.toUpperCase() + s);
|
|
30
|
+
}
|
|
31
|
+
function j(r, t) {
|
|
32
|
+
const e = i.toCamelCase(" " + t);
|
|
33
|
+
["get", "set", "has"].forEach((s) => {
|
|
34
|
+
Object.defineProperty(r, s + e, {
|
|
35
|
+
value: function(n, o, f) {
|
|
36
|
+
return this[s].call(this, t, n, o, f);
|
|
37
|
+
},
|
|
38
|
+
configurable: !0
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
class b {
|
|
43
|
+
constructor(t) {
|
|
44
|
+
t && this.set(t);
|
|
45
|
+
}
|
|
46
|
+
set(t, e, s) {
|
|
47
|
+
const n = this;
|
|
48
|
+
function o(c, l, a) {
|
|
49
|
+
const u = y(l);
|
|
50
|
+
if (!u)
|
|
51
|
+
throw new Error("header name must be a non-empty string");
|
|
52
|
+
const p = i.findKey(n, u);
|
|
53
|
+
(!p || n[p] === void 0 || a === !0 || a === void 0 && n[p] !== !1) && (n[p || l] = m(c));
|
|
54
|
+
}
|
|
55
|
+
const f = (c, l) => i.forEach(c, (a, u) => o(a, u, l));
|
|
56
|
+
if (i.isPlainObject(t) || t instanceof this.constructor)
|
|
57
|
+
f(t, e);
|
|
58
|
+
else if (i.isString(t) && (t = t.trim()) && !k(t))
|
|
59
|
+
f(S(t), e);
|
|
60
|
+
else if (i.isObject(t) && i.isIterable(t)) {
|
|
61
|
+
let c = {}, l, a;
|
|
62
|
+
for (const u of t) {
|
|
63
|
+
if (!i.isArray(u))
|
|
64
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
65
|
+
c[a = u[0]] = (l = c[a]) ? i.isArray(l) ? [...l, u[1]] : [l, u[1]] : u[1];
|
|
66
|
+
}
|
|
67
|
+
f(c, e);
|
|
68
|
+
} else
|
|
69
|
+
t != null && o(e, t, s);
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
get(t, e) {
|
|
73
|
+
if (t = y(t), t) {
|
|
74
|
+
const s = i.findKey(this, t);
|
|
75
|
+
if (s) {
|
|
76
|
+
const n = this[s];
|
|
77
|
+
if (!e)
|
|
78
|
+
return n;
|
|
79
|
+
if (e === !0)
|
|
80
|
+
return A(n);
|
|
81
|
+
if (i.isFunction(e))
|
|
82
|
+
return e.call(this, n, s);
|
|
83
|
+
if (i.isRegExp(e))
|
|
84
|
+
return e.exec(n);
|
|
85
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
has(t, e) {
|
|
90
|
+
if (t = y(t), t) {
|
|
91
|
+
const s = i.findKey(this, t);
|
|
92
|
+
return !!(s && this[s] !== void 0 && (!e || g(this, this[s], s, e)));
|
|
93
|
+
}
|
|
94
|
+
return !1;
|
|
95
|
+
}
|
|
96
|
+
delete(t, e) {
|
|
97
|
+
const s = this;
|
|
98
|
+
let n = !1;
|
|
99
|
+
function o(f) {
|
|
100
|
+
if (f = y(f), f) {
|
|
101
|
+
const c = i.findKey(s, f);
|
|
102
|
+
c && (!e || g(s, s[c], c, e)) && (delete s[c], n = !0);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return i.isArray(t) ? t.forEach(o) : o(t), n;
|
|
106
|
+
}
|
|
107
|
+
clear(t) {
|
|
108
|
+
const e = Object.keys(this);
|
|
109
|
+
let s = e.length, n = !1;
|
|
110
|
+
for (; s--; ) {
|
|
111
|
+
const o = e[s];
|
|
112
|
+
(!t || g(this, this[o], o, t, !0)) && (delete this[o], n = !0);
|
|
113
|
+
}
|
|
114
|
+
return n;
|
|
115
|
+
}
|
|
116
|
+
normalize(t) {
|
|
117
|
+
const e = this, s = {};
|
|
118
|
+
return i.forEach(this, (n, o) => {
|
|
119
|
+
const f = i.findKey(s, o);
|
|
120
|
+
if (f) {
|
|
121
|
+
e[f] = m(n), delete e[o];
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const c = t ? E(o) : String(o).trim();
|
|
125
|
+
c !== o && delete e[o], e[c] = m(n), s[c] = !0;
|
|
126
|
+
}), this;
|
|
127
|
+
}
|
|
128
|
+
concat(...t) {
|
|
129
|
+
return this.constructor.concat(this, ...t);
|
|
130
|
+
}
|
|
131
|
+
toJSON(t) {
|
|
132
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
133
|
+
return i.forEach(this, (s, n) => {
|
|
134
|
+
s != null && s !== !1 && (e[n] = t && i.isArray(s) ? s.join(", ") : s);
|
|
135
|
+
}), e;
|
|
136
|
+
}
|
|
137
|
+
[Symbol.iterator]() {
|
|
138
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
139
|
+
}
|
|
140
|
+
toString() {
|
|
141
|
+
return Object.entries(this.toJSON()).map(([t, e]) => t + ": " + e).join(`
|
|
142
|
+
`);
|
|
143
|
+
}
|
|
144
|
+
getSetCookie() {
|
|
145
|
+
return this.get("set-cookie") || [];
|
|
146
|
+
}
|
|
147
|
+
get [Symbol.toStringTag]() {
|
|
148
|
+
return "AxiosHeaders";
|
|
149
|
+
}
|
|
150
|
+
static from(t) {
|
|
151
|
+
return t instanceof this ? t : new this(t);
|
|
152
|
+
}
|
|
153
|
+
static concat(t, ...e) {
|
|
154
|
+
const s = new this(t);
|
|
155
|
+
return e.forEach((n) => s.set(n)), s;
|
|
156
|
+
}
|
|
157
|
+
static accessor(t) {
|
|
158
|
+
const s = (this[h] = this[h] = {
|
|
159
|
+
accessors: {}
|
|
160
|
+
}).accessors, n = this.prototype;
|
|
161
|
+
function o(f) {
|
|
162
|
+
const c = y(f);
|
|
163
|
+
s[c] || (j(n, f), s[c] = !0);
|
|
164
|
+
}
|
|
165
|
+
return i.isArray(t) ? t.forEach(o) : o(t), this;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
b.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
169
|
+
i.reduceDescriptors(b.prototype, ({ value: r }, t) => {
|
|
170
|
+
let e = t[0].toUpperCase() + t.slice(1);
|
|
171
|
+
return {
|
|
172
|
+
get: () => r,
|
|
173
|
+
set(s) {
|
|
174
|
+
this[e] = s;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
i.freezeMethods(b);
|
|
179
|
+
export {
|
|
180
|
+
b as default
|
|
181
|
+
};
|
package/dist/index79.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import s from "./index64.mjs";
|
|
2
|
+
import m from "./index90.mjs";
|
|
3
|
+
import u from "./index91.mjs";
|
|
4
|
+
import { getFetch as b } from "./index92.mjs";
|
|
5
|
+
import d from "./index75.mjs";
|
|
6
|
+
const p = {
|
|
7
|
+
http: m,
|
|
8
|
+
xhr: u,
|
|
9
|
+
fetch: {
|
|
10
|
+
get: b
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
s.forEach(p, (e, o) => {
|
|
14
|
+
if (e) {
|
|
15
|
+
try {
|
|
16
|
+
Object.defineProperty(e, "name", { value: o });
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(e, "adapterName", { value: o });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const f = (e) => `- ${e}`, g = (e) => s.isFunction(e) || e === null || e === !1, y = {
|
|
23
|
+
getAdapter: (e, o) => {
|
|
24
|
+
e = s.isArray(e) ? e : [e];
|
|
25
|
+
const { length: a } = e;
|
|
26
|
+
let i, t;
|
|
27
|
+
const c = {};
|
|
28
|
+
for (let r = 0; r < a; r++) {
|
|
29
|
+
i = e[r];
|
|
30
|
+
let n;
|
|
31
|
+
if (t = i, !g(i) && (t = p[(n = String(i)).toLowerCase()], t === void 0))
|
|
32
|
+
throw new d(`Unknown adapter '${n}'`);
|
|
33
|
+
if (t && (s.isFunction(t) || (t = t.get(o))))
|
|
34
|
+
break;
|
|
35
|
+
c[n || "#" + r] = t;
|
|
36
|
+
}
|
|
37
|
+
if (!t) {
|
|
38
|
+
const r = Object.entries(c).map(
|
|
39
|
+
([l, h]) => `adapter ${l} ` + (h === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
40
|
+
);
|
|
41
|
+
let n = a ? r.length > 1 ? `since :
|
|
42
|
+
` + r.map(f).join(`
|
|
43
|
+
`) : " " + f(r[0]) : "as no adapter specified";
|
|
44
|
+
throw new d(
|
|
45
|
+
"There is no suitable adapter to dispatch the request " + n,
|
|
46
|
+
"ERR_NOT_SUPPORT"
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
},
|
|
51
|
+
adapters: p
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
y as default
|
|
55
|
+
};
|
package/dist/index8.mjs
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as N, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Y, useEffect as b } from "react";
|
|
3
|
+
import { useCart as q } from "./index3.mjs";
|
|
4
|
+
import { CartItem as B } from "./index7.mjs";
|
|
5
|
+
import { DiscountCodeInput as T } from "./index9.mjs";
|
|
6
|
+
import { Checkout as X } from "./index10.mjs";
|
|
7
|
+
import { Button as v } from "./index11.mjs";
|
|
8
|
+
import { X as Z, Loader2 as A, Package as f } from "lucide-react";
|
|
9
|
+
import { cn as c, formatCurrency as n } from "./index17.mjs";
|
|
10
|
+
function W({
|
|
11
|
+
isOpen: s,
|
|
12
|
+
onClose: l,
|
|
13
|
+
onCheckout: d,
|
|
14
|
+
onContinueShopping: o,
|
|
15
|
+
className: w,
|
|
16
|
+
showDiscountCode: j = !0,
|
|
17
|
+
checkoutButtonText: k = "Checkout",
|
|
18
|
+
continueShoppingText: C = "Continue Shopping",
|
|
19
|
+
checkoutButtonClassName: E,
|
|
20
|
+
continueShoppingButtonClassName: L,
|
|
21
|
+
disableCheckout: z = !1,
|
|
22
|
+
emptyMessage: I = "Your cart is empty"
|
|
23
|
+
}) {
|
|
24
|
+
var x, y, g;
|
|
25
|
+
const { cart: t, isLoading: i, error: m } = q(), [D, u] = Y(!1);
|
|
26
|
+
b(() => (s ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
27
|
+
document.body.style.overflow = "";
|
|
28
|
+
}), [s]), b(() => {
|
|
29
|
+
const r = (h) => {
|
|
30
|
+
h.key === "Escape" && s && l();
|
|
31
|
+
};
|
|
32
|
+
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
33
|
+
}, [s, l]);
|
|
34
|
+
const F = ((x = t == null ? void 0 : t.pricing) == null ? void 0 : x.subtotal) || 0, p = ((y = t == null ? void 0 : t.pricing.discount) == null ? void 0 : y.amount) || 0, P = () => {
|
|
35
|
+
u(!0), d == null || d();
|
|
36
|
+
}, S = () => {
|
|
37
|
+
o == null || o(), l();
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ a(N, { children: [
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: c(
|
|
44
|
+
"fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",
|
|
45
|
+
s ? "opacity-100" : "pointer-events-none opacity-0"
|
|
46
|
+
),
|
|
47
|
+
onClick: l,
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ e(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
className: c(
|
|
55
|
+
"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]",
|
|
56
|
+
s ? "translate-x-0" : "translate-x-full",
|
|
57
|
+
w
|
|
58
|
+
),
|
|
59
|
+
children: /* @__PURE__ */ a("div", { className: "flex h-full flex-col", children: [
|
|
60
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-300 px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
61
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
62
|
+
/* @__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: (g = t == null ? void 0 : t.items) == null ? void 0 : g.length }),
|
|
63
|
+
/* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Your Cart" })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
onClick: l,
|
|
69
|
+
className: "rounded-full p-2 transition-colors hover:bg-gray-100",
|
|
70
|
+
"aria-label": "Close cart",
|
|
71
|
+
children: /* @__PURE__ */ e(Z, { className: "h-6 w-6" })
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] }) }),
|
|
75
|
+
i && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
76
|
+
/* @__PURE__ */ e(A, { className: "mx-auto mb-4 h-12 w-12 animate-spin text-accent-500" }),
|
|
77
|
+
/* @__PURE__ */ e("p", { className: "text-gray-600", children: "Loading cart..." })
|
|
78
|
+
] }) }),
|
|
79
|
+
m && !i && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
80
|
+
/* @__PURE__ */ e(f, { className: "mx-auto mb-4 h-12 w-12 text-red-600" }),
|
|
81
|
+
/* @__PURE__ */ e("p", { className: "text-red-600", children: "Failed to load cart. Please try again." })
|
|
82
|
+
] }) }),
|
|
83
|
+
!i && !m && (!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: [
|
|
84
|
+
/* @__PURE__ */ e(f, { className: "mx-auto mb-4 h-12 w-12 text-gray-400" }),
|
|
85
|
+
/* @__PURE__ */ e("p", { className: "text-gray-600", children: I })
|
|
86
|
+
] }) }),
|
|
87
|
+
!i && !m && t && t.items && t.items.length > 0 && /* @__PURE__ */ a(N, { children: [
|
|
88
|
+
/* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto p-4", children: [
|
|
89
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: t.items.map((r, h) => /* @__PURE__ */ a("div", { children: [
|
|
90
|
+
/* @__PURE__ */ e(
|
|
91
|
+
B,
|
|
92
|
+
{
|
|
93
|
+
item: r
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
h < t.items.length - 1 && /* @__PURE__ */ e("hr", { className: "border-gray-200 mt-2" })
|
|
97
|
+
] }, r.id)) }),
|
|
98
|
+
j && /* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(T, {}) })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ a("div", { className: "border-t border-gray-300 bg-white", children: [
|
|
101
|
+
/* @__PURE__ */ a("div", { className: " text-base", children: [
|
|
102
|
+
/* @__PURE__ */ a("div", { className: "p-4 space-y-2", children: [
|
|
103
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between", children: [
|
|
104
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Subtotal" }),
|
|
105
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: n(F) })
|
|
106
|
+
] }),
|
|
107
|
+
p > 0 && /* @__PURE__ */ a("div", { className: "flex justify-between text-green-600", children: [
|
|
108
|
+
/* @__PURE__ */ e("span", { children: "Discount" }),
|
|
109
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: [
|
|
110
|
+
"-",
|
|
111
|
+
n(p)
|
|
112
|
+
] })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between", children: [
|
|
115
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Shipping" }),
|
|
116
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: t.pricing && t.deliveryZone ? n(t.pricing.deliveryCharge) : "-" })
|
|
117
|
+
] })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ a("div", { className: "flex justify-between p-4 border-t border-gray-300 text-lg", children: [
|
|
120
|
+
/* @__PURE__ */ e("span", { className: "font-bold", children: "Total" }),
|
|
121
|
+
/* @__PURE__ */ e("span", { className: "font-bold", children: n(t.pricing.total) })
|
|
122
|
+
] })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ a("div", { className: "p-4 space-y-2", children: [
|
|
125
|
+
/* @__PURE__ */ a(
|
|
126
|
+
v,
|
|
127
|
+
{
|
|
128
|
+
onClick: P,
|
|
129
|
+
disabled: z || t.items.length === 0,
|
|
130
|
+
className: c("w-full bg-accent-500 text-white hover:bg-accent-600", E),
|
|
131
|
+
size: "lg",
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ e(f, { className: "h-5 w-5" }),
|
|
134
|
+
k
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ e(
|
|
139
|
+
v,
|
|
140
|
+
{
|
|
141
|
+
onClick: S,
|
|
142
|
+
variant: "outline",
|
|
143
|
+
className: c("w-full border-gray-300 text-gray-600 hover:bg-gray-100", L),
|
|
144
|
+
size: "lg",
|
|
145
|
+
children: C
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] })
|
|
149
|
+
] })
|
|
150
|
+
] })
|
|
151
|
+
] })
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ e(
|
|
155
|
+
X,
|
|
156
|
+
{
|
|
157
|
+
isOpen: D,
|
|
158
|
+
onClose: () => u(!1)
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] });
|
|
162
|
+
}
|
|
163
|
+
export {
|
|
164
|
+
W as ShoppingCart
|
|
165
|
+
};
|
package/dist/index80.mjs
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
Continue: 100,
|
|
3
|
+
SwitchingProtocols: 101,
|
|
4
|
+
Processing: 102,
|
|
5
|
+
EarlyHints: 103,
|
|
6
|
+
Ok: 200,
|
|
7
|
+
Created: 201,
|
|
8
|
+
Accepted: 202,
|
|
9
|
+
NonAuthoritativeInformation: 203,
|
|
10
|
+
NoContent: 204,
|
|
11
|
+
ResetContent: 205,
|
|
12
|
+
PartialContent: 206,
|
|
13
|
+
MultiStatus: 207,
|
|
14
|
+
AlreadyReported: 208,
|
|
15
|
+
ImUsed: 226,
|
|
16
|
+
MultipleChoices: 300,
|
|
17
|
+
MovedPermanently: 301,
|
|
18
|
+
Found: 302,
|
|
19
|
+
SeeOther: 303,
|
|
20
|
+
NotModified: 304,
|
|
21
|
+
UseProxy: 305,
|
|
22
|
+
Unused: 306,
|
|
23
|
+
TemporaryRedirect: 307,
|
|
24
|
+
PermanentRedirect: 308,
|
|
25
|
+
BadRequest: 400,
|
|
26
|
+
Unauthorized: 401,
|
|
27
|
+
PaymentRequired: 402,
|
|
28
|
+
Forbidden: 403,
|
|
29
|
+
NotFound: 404,
|
|
30
|
+
MethodNotAllowed: 405,
|
|
31
|
+
NotAcceptable: 406,
|
|
32
|
+
ProxyAuthenticationRequired: 407,
|
|
33
|
+
RequestTimeout: 408,
|
|
34
|
+
Conflict: 409,
|
|
35
|
+
Gone: 410,
|
|
36
|
+
LengthRequired: 411,
|
|
37
|
+
PreconditionFailed: 412,
|
|
38
|
+
PayloadTooLarge: 413,
|
|
39
|
+
UriTooLong: 414,
|
|
40
|
+
UnsupportedMediaType: 415,
|
|
41
|
+
RangeNotSatisfiable: 416,
|
|
42
|
+
ExpectationFailed: 417,
|
|
43
|
+
ImATeapot: 418,
|
|
44
|
+
MisdirectedRequest: 421,
|
|
45
|
+
UnprocessableEntity: 422,
|
|
46
|
+
Locked: 423,
|
|
47
|
+
FailedDependency: 424,
|
|
48
|
+
TooEarly: 425,
|
|
49
|
+
UpgradeRequired: 426,
|
|
50
|
+
PreconditionRequired: 428,
|
|
51
|
+
TooManyRequests: 429,
|
|
52
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
53
|
+
UnavailableForLegalReasons: 451,
|
|
54
|
+
InternalServerError: 500,
|
|
55
|
+
NotImplemented: 501,
|
|
56
|
+
BadGateway: 502,
|
|
57
|
+
ServiceUnavailable: 503,
|
|
58
|
+
GatewayTimeout: 504,
|
|
59
|
+
HttpVersionNotSupported: 505,
|
|
60
|
+
VariantAlsoNegotiates: 506,
|
|
61
|
+
InsufficientStorage: 507,
|
|
62
|
+
LoopDetected: 508,
|
|
63
|
+
NotExtended: 510,
|
|
64
|
+
NetworkAuthenticationRequired: 511
|
|
65
|
+
};
|
|
66
|
+
Object.entries(e).forEach(([t, o]) => {
|
|
67
|
+
e[o] = t;
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
e as default
|
|
71
|
+
};
|
package/dist/index81.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import f from "./index64.mjs";
|
|
2
|
+
import d from "./index95.mjs";
|
|
3
|
+
function l(e) {
|
|
4
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
5
|
+
}
|
|
6
|
+
function m(e, c, i) {
|
|
7
|
+
if (!c)
|
|
8
|
+
return e;
|
|
9
|
+
const t = i && i.encode || l;
|
|
10
|
+
f.isFunction(i) && (i = {
|
|
11
|
+
serialize: i
|
|
12
|
+
});
|
|
13
|
+
const r = i && i.serialize;
|
|
14
|
+
let n;
|
|
15
|
+
if (r ? n = r(c, i) : n = f.isURLSearchParams(c) ? c.toString() : new d(c, i).toString(t), n) {
|
|
16
|
+
const a = e.indexOf("#");
|
|
17
|
+
a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + n;
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
m as default
|
|
23
|
+
};
|
package/dist/index82.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import n from "./index64.mjs";
|
|
2
|
+
class a {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.handlers = [];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Add a new interceptor to the stack
|
|
8
|
+
*
|
|
9
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
10
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
11
|
+
*
|
|
12
|
+
* @return {Number} An ID used to remove interceptor later
|
|
13
|
+
*/
|
|
14
|
+
use(s, h, r) {
|
|
15
|
+
return this.handlers.push({
|
|
16
|
+
fulfilled: s,
|
|
17
|
+
rejected: h,
|
|
18
|
+
synchronous: r ? r.synchronous : !1,
|
|
19
|
+
runWhen: r ? r.runWhen : null
|
|
20
|
+
}), this.handlers.length - 1;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Remove an interceptor from the stack
|
|
24
|
+
*
|
|
25
|
+
* @param {Number} id The ID that was returned by `use`
|
|
26
|
+
*
|
|
27
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
28
|
+
*/
|
|
29
|
+
eject(s) {
|
|
30
|
+
this.handlers[s] && (this.handlers[s] = null);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Clear all interceptors from the stack
|
|
34
|
+
*
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
clear() {
|
|
38
|
+
this.handlers && (this.handlers = []);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Iterate over all the registered interceptors
|
|
42
|
+
*
|
|
43
|
+
* This method is particularly useful for skipping over any
|
|
44
|
+
* interceptors that may have become `null` calling `eject`.
|
|
45
|
+
*
|
|
46
|
+
* @param {Function} fn The function to call for each interceptor
|
|
47
|
+
*
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
forEach(s) {
|
|
51
|
+
n.forEach(this.handlers, function(r) {
|
|
52
|
+
r !== null && s(r);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
a as default
|
|
58
|
+
};
|
package/dist/index83.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import r from "./index96.mjs";
|
|
2
|
+
import p from "./index72.mjs";
|
|
3
|
+
import l from "./index68.mjs";
|
|
4
|
+
import m from "./index70.mjs";
|
|
5
|
+
import a from "./index78.mjs";
|
|
6
|
+
import o from "./index79.mjs";
|
|
7
|
+
function d(e) {
|
|
8
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
9
|
+
throw new m(null, e);
|
|
10
|
+
}
|
|
11
|
+
function q(e) {
|
|
12
|
+
return d(e), e.headers = a.from(e.headers), e.data = r.call(
|
|
13
|
+
e,
|
|
14
|
+
e.transformRequest
|
|
15
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), o.getAdapter(e.adapter || l.adapter, e)(e).then(function(t) {
|
|
16
|
+
return d(e), t.data = r.call(
|
|
17
|
+
e,
|
|
18
|
+
e.transformResponse,
|
|
19
|
+
t
|
|
20
|
+
), t.headers = a.from(t.headers), t;
|
|
21
|
+
}, function(t) {
|
|
22
|
+
return p(t) || (d(e), t && t.response && (t.response.data = r.call(
|
|
23
|
+
e,
|
|
24
|
+
e.transformResponse,
|
|
25
|
+
t.response
|
|
26
|
+
), t.response.headers = a.from(t.response.headers))), Promise.reject(t);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
q as default
|
|
31
|
+
};
|
package/dist/index84.mjs
ADDED
package/dist/index85.mjs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { VERSION as w } from "./index73.mjs";
|
|
2
|
+
import s from "./index75.mjs";
|
|
3
|
+
const l = {};
|
|
4
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((n, t) => {
|
|
5
|
+
l[n] = function(o) {
|
|
6
|
+
return typeof o === n || "a" + (t < 1 ? "n " : " ") + n;
|
|
7
|
+
};
|
|
8
|
+
});
|
|
9
|
+
const f = {};
|
|
10
|
+
l.transitional = function(t, i, o) {
|
|
11
|
+
function a(r, e) {
|
|
12
|
+
return "[Axios v" + w + "] Transitional option '" + r + "'" + e + (o ? ". " + o : "");
|
|
13
|
+
}
|
|
14
|
+
return (r, e, u) => {
|
|
15
|
+
if (t === !1)
|
|
16
|
+
throw new s(
|
|
17
|
+
a(e, " has been removed" + (i ? " in " + i : "")),
|
|
18
|
+
s.ERR_DEPRECATED
|
|
19
|
+
);
|
|
20
|
+
return i && !f[e] && (f[e] = !0, console.warn(
|
|
21
|
+
a(
|
|
22
|
+
e,
|
|
23
|
+
" has been deprecated since v" + i + " and will be removed in the near future"
|
|
24
|
+
)
|
|
25
|
+
)), t ? t(r, e, u) : !0;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
l.spelling = function(t) {
|
|
29
|
+
return (i, o) => (console.warn(`${o} is likely a misspelling of ${t}`), !0);
|
|
30
|
+
};
|
|
31
|
+
function b(n, t, i) {
|
|
32
|
+
if (typeof n != "object")
|
|
33
|
+
throw new s("options must be an object", s.ERR_BAD_OPTION_VALUE);
|
|
34
|
+
const o = Object.keys(n);
|
|
35
|
+
let a = o.length;
|
|
36
|
+
for (; a-- > 0; ) {
|
|
37
|
+
const r = o[a], e = t[r];
|
|
38
|
+
if (e) {
|
|
39
|
+
const u = n[r], c = u === void 0 || e(u, r, n);
|
|
40
|
+
if (c !== !0)
|
|
41
|
+
throw new s("option " + r + " must be " + c, s.ERR_BAD_OPTION_VALUE);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (i !== !0)
|
|
45
|
+
throw new s("Unknown option " + r, s.ERR_BAD_OPTION);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const m = {
|
|
49
|
+
assertOptions: b,
|
|
50
|
+
validators: l
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
m as default
|
|
54
|
+
};
|
package/dist/index86.mjs
ADDED
package/dist/index87.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import s from "./index64.mjs";
|
|
2
|
+
import f from "./index74.mjs";
|
|
3
|
+
import r from "./index88.mjs";
|
|
4
|
+
function d(o, i) {
|
|
5
|
+
return f(o, new r.classes.URLSearchParams(), {
|
|
6
|
+
visitor: function(t, a, n, e) {
|
|
7
|
+
return r.isNode && s.isBuffer(t) ? (this.append(a, t.toString("base64")), !1) : e.defaultVisitor.apply(this, arguments);
|
|
8
|
+
},
|
|
9
|
+
...i
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
d as default
|
|
14
|
+
};
|