@instockng/storefront-ui 1.0.27 → 1.0.28
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/ShoppingCart.d.ts +3 -1
- package/dist/components/ShoppingCart.d.ts.map +1 -1
- package/dist/index10.mjs +39 -38
- package/dist/index100.mjs +13 -15
- package/dist/index101.mjs +16 -27
- package/dist/index102.mjs +26 -20
- package/dist/index103.mjs +151 -14
- package/dist/index104.mjs +13 -14
- package/dist/index105.mjs +23 -39
- package/dist/index106.mjs +76 -15
- package/dist/index107.mjs +33 -263
- package/dist/index108.mjs +138 -63
- package/dist/index109.mjs +54 -7
- package/dist/index110.mjs +23 -2
- package/dist/index111.mjs +27 -2
- package/dist/index112.mjs +19 -29
- package/dist/index113.mjs +25 -2
- package/dist/index114.mjs +18 -232
- package/dist/index115.mjs +21 -5
- package/dist/index116.mjs +17 -130
- package/dist/index117.mjs +64 -67
- package/dist/index118.mjs +16 -85
- package/dist/index119.mjs +38 -28
- package/dist/index120.mjs +23 -8
- package/dist/index121.mjs +31 -72
- package/dist/index122.mjs +26 -3
- package/dist/index123.mjs +19 -2
- package/dist/index124.mjs +19 -81
- package/dist/index125.mjs +46 -53
- package/dist/index126.mjs +22 -5
- package/dist/index127.mjs +267 -4
- package/dist/index128.mjs +62 -171
- package/dist/index129.mjs +8 -53
- package/dist/index130.mjs +2 -69
- package/dist/index131.mjs +2 -34
- package/dist/index132.mjs +32 -42
- package/dist/index133.mjs +2 -2
- package/dist/index138.mjs +1 -1
- package/dist/index139.mjs +1 -1
- package/dist/index141.mjs +1 -1
- package/dist/index142.mjs +1 -1
- package/dist/index144.mjs +1 -1
- package/dist/index145.mjs +1 -1
- package/dist/index147.mjs +3 -3
- package/dist/index148.mjs +1 -1
- package/dist/index153.mjs +2 -2
- package/dist/index155.mjs +1 -1
- package/dist/index157.mjs +2 -2
- package/dist/index158.mjs +5 -5
- package/dist/index161.mjs +1 -1
- package/dist/index167.mjs +2 -2
- package/dist/index172.mjs +2 -2
- package/dist/index174.mjs +2 -2
- package/dist/index180.mjs +1 -1
- package/dist/index193.mjs +2 -2
- package/dist/index194.mjs +1 -1
- package/dist/index195.mjs +6 -6
- package/dist/index196.mjs +2 -2
- package/dist/index197.mjs +2 -2
- package/dist/index199.mjs +2 -2
- package/dist/index200.mjs +2 -2
- package/dist/index201.mjs +1 -1
- package/dist/index203.mjs +4 -4
- package/dist/index204.mjs +3 -3
- package/dist/index205.mjs +2 -2
- package/dist/index206.mjs +2 -2
- package/dist/index208.mjs +2 -2
- package/dist/index209.mjs +2 -108
- package/dist/index210.mjs +2 -2
- package/dist/index211.mjs +37 -2
- package/dist/index212.mjs +2 -2
- package/dist/index213.mjs +2 -2
- package/dist/index214.mjs +2 -2
- package/dist/index215.mjs +2 -2
- package/dist/index216.mjs +244 -2
- package/dist/index217.mjs +2 -244
- package/dist/index218.mjs +33 -2
- package/dist/index219.mjs +60 -28
- package/dist/index220.mjs +20 -60
- package/dist/index221.mjs +2 -25
- package/dist/index222.mjs +2 -2
- package/dist/index223.mjs +96 -25
- package/dist/index224.mjs +2 -2
- package/dist/index236.mjs +30 -12
- package/dist/index237.mjs +11 -7
- package/dist/index238.mjs +3 -30
- package/dist/index239.mjs +3 -10
- package/dist/index240.mjs +13 -4
- package/dist/index241.mjs +7 -4
- package/dist/index242.mjs +1 -1
- package/dist/index244.mjs +1 -1
- package/dist/index245.mjs +3 -3
- package/dist/index246.mjs +3 -3
- package/dist/index248.mjs +2 -2
- package/dist/index249.mjs +18 -2
- package/dist/index250.mjs +47 -2
- package/dist/index251.mjs +2 -18
- package/dist/index252.mjs +2 -47
- package/dist/index253.mjs +2 -2
- package/dist/index254.mjs +2 -2
- package/dist/index255.mjs +91 -2
- package/dist/index256.mjs +2 -91
- package/dist/index258.mjs +1 -1
- package/dist/index264.mjs +1 -1
- package/dist/index47.mjs +17 -17
- package/dist/index48.mjs +2 -2
- package/dist/index66.mjs +1 -1
- package/dist/index70.mjs +35 -35
- package/dist/index71.mjs +1 -1
- package/dist/index72.mjs +2 -2
- package/dist/index73.mjs +1 -1
- package/dist/index75.mjs +235 -2
- package/dist/index76.mjs +5 -27
- package/dist/index77.mjs +130 -14
- package/dist/index78.mjs +67 -214
- package/dist/index79.mjs +82 -175
- package/dist/index80.mjs +28 -21
- package/dist/index81.mjs +8 -22
- package/dist/index82.mjs +72 -30
- package/dist/index83.mjs +3 -155
- package/dist/index84.mjs +2 -20
- package/dist/index85.mjs +81 -29
- package/dist/index86.mjs +53 -83
- package/dist/index87.mjs +5 -37
- package/dist/index88.mjs +4 -144
- package/dist/index89.mjs +173 -49
- package/dist/index90.mjs +53 -23
- package/dist/index91.mjs +69 -27
- package/dist/index92.mjs +2 -23
- package/dist/index93.mjs +34 -25
- package/dist/index94.mjs +42 -20
- package/dist/index95.mjs +2 -22
- package/dist/index96.mjs +26 -19
- package/dist/index97.mjs +11 -58
- package/dist/index98.mjs +210 -13
- package/dist/index99.mjs +173 -32
- package/package.json +1 -1
- package/src/components/ShoppingCart.tsx +5 -2
package/dist/index99.mjs
CHANGED
|
@@ -1,42 +1,183 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { __require as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { __module as L } from "./index143.mjs";
|
|
3
|
+
import "./index69.mjs";
|
|
4
|
+
import { __require as K } from "./index96.mjs";
|
|
5
|
+
import F from "react/jsx-runtime";
|
|
6
|
+
import J from "react-dom";
|
|
7
|
+
import N from "react";
|
|
8
|
+
import { __require as B } from "./index144.mjs";
|
|
9
|
+
import { __require as D } from "./index145.mjs";
|
|
10
|
+
import { __require as G } from "./index140.mjs";
|
|
11
|
+
import { __exports as Q } from "./index74.mjs";
|
|
12
|
+
var w;
|
|
13
|
+
function ie() {
|
|
14
|
+
return w ? L.exports : (w = 1, function(x, o) {
|
|
15
|
+
"use client";
|
|
16
|
+
Object.defineProperty(o, "__esModule", {
|
|
10
17
|
value: !0
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
});
|
|
19
|
+
function M(t, e) {
|
|
20
|
+
for (var n in e) Object.defineProperty(t, n, {
|
|
21
|
+
enumerable: !0,
|
|
22
|
+
get: e[n]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
M(o, {
|
|
26
|
+
default: function() {
|
|
27
|
+
return z;
|
|
28
|
+
},
|
|
29
|
+
handleClientScriptLoad: function() {
|
|
30
|
+
return C;
|
|
31
|
+
},
|
|
32
|
+
initScriptLoader: function() {
|
|
33
|
+
return $;
|
|
15
34
|
}
|
|
16
35
|
});
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
const j = Q, P = K(), O = F, h = /* @__PURE__ */ j._(J), g = /* @__PURE__ */ P._(N), R = B(), k = D(), I = G(), v = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Set(), A = (t) => {
|
|
37
|
+
if (h.default.preinit) {
|
|
38
|
+
t.forEach((e) => {
|
|
39
|
+
h.default.preinit(e, {
|
|
40
|
+
as: "style"
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (typeof window < "u") {
|
|
46
|
+
let e = document.head;
|
|
47
|
+
t.forEach((n) => {
|
|
48
|
+
let s = document.createElement("link");
|
|
49
|
+
s.type = "text/css", s.rel = "stylesheet", s.href = n, e.appendChild(s);
|
|
50
|
+
});
|
|
29
51
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
52
|
+
}, y = (t) => {
|
|
53
|
+
const { src: e, id: n, onLoad: s = () => {
|
|
54
|
+
}, onReady: l = null, dangerouslySetInnerHTML: i, children: _ = "", strategy: S = "afterInteractive", onError: r, stylesheets: q } = t, c = n || e;
|
|
55
|
+
if (c && p.has(c))
|
|
56
|
+
return;
|
|
57
|
+
if (v.has(e)) {
|
|
58
|
+
p.add(c), v.get(e).then(s, r);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const d = () => {
|
|
62
|
+
l && l(), p.add(c);
|
|
63
|
+
}, a = document.createElement("script"), u = new Promise((m, b) => {
|
|
64
|
+
a.addEventListener("load", function(f) {
|
|
65
|
+
m(), s && s.call(this, f), d();
|
|
66
|
+
}), a.addEventListener("error", function(f) {
|
|
67
|
+
b(f);
|
|
68
|
+
});
|
|
69
|
+
}).catch(function(m) {
|
|
70
|
+
r && r(m);
|
|
71
|
+
});
|
|
72
|
+
i ? (a.innerHTML = i.__html || "", d()) : _ ? (a.textContent = typeof _ == "string" ? _ : Array.isArray(_) ? _.join("") : "", d()) : e && (a.src = e, v.set(e, u)), (0, k.setAttributesFromProps)(a, t), S === "worker" && a.setAttribute("type", "text/partytown"), a.setAttribute("data-nscript", S), q && A(q), document.body.appendChild(a);
|
|
73
|
+
};
|
|
74
|
+
function C(t) {
|
|
75
|
+
const { strategy: e = "afterInteractive" } = t;
|
|
76
|
+
e === "lazyOnload" ? window.addEventListener("load", () => {
|
|
77
|
+
(0, I.requestIdleCallback)(() => y(t));
|
|
78
|
+
}) : y(t);
|
|
79
|
+
}
|
|
80
|
+
function H(t) {
|
|
81
|
+
document.readyState === "complete" ? (0, I.requestIdleCallback)(() => y(t)) : window.addEventListener("load", () => {
|
|
82
|
+
(0, I.requestIdleCallback)(() => y(t));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function T() {
|
|
86
|
+
[
|
|
87
|
+
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
|
|
88
|
+
...document.querySelectorAll('[data-nscript="beforePageRender"]')
|
|
89
|
+
].forEach((e) => {
|
|
90
|
+
const n = e.id || e.getAttribute("src");
|
|
91
|
+
p.add(n);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function $(t) {
|
|
95
|
+
t.forEach(C), T();
|
|
96
|
+
}
|
|
97
|
+
function E(t) {
|
|
98
|
+
const { id: e, src: n = "", onLoad: s = () => {
|
|
99
|
+
}, onReady: l = null, strategy: i = "afterInteractive", onError: _, stylesheets: S, ...r } = t, { updateScripts: q, scripts: c, getIsSsr: d, appDir: a, nonce: u } = (0, g.useContext)(R.HeadManagerContext), m = (0, g.useRef)(!1);
|
|
100
|
+
(0, g.useEffect)(() => {
|
|
101
|
+
const f = e || n;
|
|
102
|
+
m.current || (l && f && p.has(f) && l(), m.current = !0);
|
|
103
|
+
}, [
|
|
104
|
+
l,
|
|
105
|
+
e,
|
|
106
|
+
n
|
|
107
|
+
]);
|
|
108
|
+
const b = (0, g.useRef)(!1);
|
|
109
|
+
if ((0, g.useEffect)(() => {
|
|
110
|
+
b.current || (i === "afterInteractive" ? y(t) : i === "lazyOnload" && H(t), b.current = !0);
|
|
111
|
+
}, [
|
|
112
|
+
t,
|
|
113
|
+
i
|
|
114
|
+
]), (i === "beforeInteractive" || i === "worker") && (q ? (c[i] = (c[i] || []).concat([
|
|
115
|
+
{
|
|
116
|
+
id: e,
|
|
117
|
+
src: n,
|
|
118
|
+
onLoad: s,
|
|
119
|
+
onReady: l,
|
|
120
|
+
onError: _,
|
|
121
|
+
...r
|
|
122
|
+
}
|
|
123
|
+
]), q(c)) : d && d() ? p.add(e || n) : d && !d() && y(t)), a) {
|
|
124
|
+
if (S && S.forEach((f) => {
|
|
125
|
+
h.default.preinit(f, {
|
|
126
|
+
as: "style"
|
|
127
|
+
});
|
|
128
|
+
}), i === "beforeInteractive")
|
|
129
|
+
return n ? (h.default.preload(n, r.integrity ? {
|
|
130
|
+
as: "script",
|
|
131
|
+
integrity: r.integrity,
|
|
132
|
+
nonce: u,
|
|
133
|
+
crossOrigin: r.crossOrigin
|
|
134
|
+
} : {
|
|
135
|
+
as: "script",
|
|
136
|
+
nonce: u,
|
|
137
|
+
crossOrigin: r.crossOrigin
|
|
138
|
+
}), /* @__PURE__ */ (0, O.jsx)("script", {
|
|
139
|
+
nonce: u,
|
|
140
|
+
dangerouslySetInnerHTML: {
|
|
141
|
+
__html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([
|
|
142
|
+
n,
|
|
143
|
+
{
|
|
144
|
+
...r,
|
|
145
|
+
id: e
|
|
146
|
+
}
|
|
147
|
+
]) + ")"
|
|
148
|
+
}
|
|
149
|
+
})) : (r.dangerouslySetInnerHTML && (r.children = r.dangerouslySetInnerHTML.__html, delete r.dangerouslySetInnerHTML), /* @__PURE__ */ (0, O.jsx)("script", {
|
|
150
|
+
nonce: u,
|
|
151
|
+
dangerouslySetInnerHTML: {
|
|
152
|
+
__html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([
|
|
153
|
+
0,
|
|
154
|
+
{
|
|
155
|
+
...r,
|
|
156
|
+
id: e
|
|
157
|
+
}
|
|
158
|
+
]) + ")"
|
|
159
|
+
}
|
|
160
|
+
}));
|
|
161
|
+
i === "afterInteractive" && n && h.default.preload(n, r.integrity ? {
|
|
162
|
+
as: "script",
|
|
163
|
+
integrity: r.integrity,
|
|
164
|
+
nonce: u,
|
|
165
|
+
crossOrigin: r.crossOrigin
|
|
166
|
+
} : {
|
|
167
|
+
as: "script",
|
|
168
|
+
nonce: u,
|
|
169
|
+
crossOrigin: r.crossOrigin
|
|
170
|
+
});
|
|
35
171
|
}
|
|
36
|
-
return
|
|
172
|
+
return null;
|
|
37
173
|
}
|
|
38
|
-
|
|
174
|
+
Object.defineProperty(E, "__nextScript", {
|
|
175
|
+
value: !0
|
|
176
|
+
});
|
|
177
|
+
const z = E;
|
|
178
|
+
(typeof o.default == "function" || typeof o.default == "object" && o.default !== null) && typeof o.default.__esModule > "u" && (Object.defineProperty(o.default, "__esModule", { value: !0 }), Object.assign(o.default, o), x.exports = o.default);
|
|
179
|
+
}(L, L.exports), L.exports);
|
|
39
180
|
}
|
|
40
181
|
export {
|
|
41
|
-
|
|
182
|
+
ie as __require
|
|
42
183
|
};
|
package/package.json
CHANGED
|
@@ -29,6 +29,8 @@ export interface ShoppingCartProps {
|
|
|
29
29
|
className?: string;
|
|
30
30
|
/** Show discount code input */
|
|
31
31
|
showDiscountCode?: boolean;
|
|
32
|
+
/** Show continue shopping button */
|
|
33
|
+
showContinueShopping?: boolean;
|
|
32
34
|
/** Checkout button text */
|
|
33
35
|
checkoutButtonText?: string;
|
|
34
36
|
/** Continue shopping button text */
|
|
@@ -50,6 +52,7 @@ export function ShoppingCart({
|
|
|
50
52
|
onContinueShopping,
|
|
51
53
|
className,
|
|
52
54
|
showDiscountCode = true,
|
|
55
|
+
showContinueShopping = true,
|
|
53
56
|
checkoutButtonText = 'Complete Purchase',
|
|
54
57
|
continueShoppingText = 'Continue Shopping',
|
|
55
58
|
checkoutButtonClassName,
|
|
@@ -240,14 +243,14 @@ export function ShoppingCart({
|
|
|
240
243
|
<Package className="h-5 w-5" />
|
|
241
244
|
{checkoutButtonText}
|
|
242
245
|
</Button>
|
|
243
|
-
<Button
|
|
246
|
+
{showContinueShopping && <Button
|
|
244
247
|
onClick={handleContinueShopping}
|
|
245
248
|
variant="outline"
|
|
246
249
|
className={cn('w-full border-gray-300 text-gray-600 hover:bg-gray-100', continueShoppingButtonClassName)}
|
|
247
250
|
size="lg"
|
|
248
251
|
>
|
|
249
252
|
{continueShoppingText}
|
|
250
|
-
</Button>
|
|
253
|
+
</Button>}
|
|
251
254
|
</div>
|
|
252
255
|
</div>
|
|
253
256
|
</>
|