@instockng/storefront-ui 1.0.26 → 1.0.27

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 (219) hide show
  1. package/dist/components/CartItem.d.ts +0 -5
  2. package/dist/components/CartItem.d.ts.map +1 -1
  3. package/dist/components/DiscountCodeInput.d.ts +0 -6
  4. package/dist/components/DiscountCodeInput.d.ts.map +1 -1
  5. package/dist/components/ProductCard.d.ts +0 -6
  6. package/dist/components/ProductCard.d.ts.map +1 -1
  7. package/dist/index100.mjs +15 -13
  8. package/dist/index101.mjs +27 -16
  9. package/dist/index102.mjs +20 -26
  10. package/dist/index103.mjs +14 -151
  11. package/dist/index104.mjs +14 -13
  12. package/dist/index105.mjs +39 -23
  13. package/dist/index106.mjs +15 -76
  14. package/dist/index107.mjs +263 -33
  15. package/dist/index108.mjs +63 -138
  16. package/dist/index109.mjs +7 -54
  17. package/dist/index110.mjs +2 -23
  18. package/dist/index111.mjs +2 -27
  19. package/dist/index112.mjs +29 -19
  20. package/dist/index113.mjs +2 -25
  21. package/dist/index114.mjs +232 -18
  22. package/dist/index115.mjs +5 -21
  23. package/dist/index116.mjs +130 -17
  24. package/dist/index117.mjs +67 -64
  25. package/dist/index118.mjs +85 -16
  26. package/dist/index119.mjs +28 -38
  27. package/dist/index120.mjs +8 -23
  28. package/dist/index121.mjs +72 -31
  29. package/dist/index122.mjs +3 -26
  30. package/dist/index123.mjs +2 -19
  31. package/dist/index124.mjs +81 -19
  32. package/dist/index125.mjs +53 -46
  33. package/dist/index126.mjs +5 -22
  34. package/dist/index127.mjs +4 -267
  35. package/dist/index128.mjs +171 -62
  36. package/dist/index129.mjs +53 -8
  37. package/dist/index130.mjs +69 -2
  38. package/dist/index131.mjs +34 -2
  39. package/dist/index132.mjs +42 -32
  40. package/dist/index133.mjs +2 -2
  41. package/dist/index134.mjs +2 -21
  42. package/dist/index135.mjs +2 -56
  43. package/dist/index136.mjs +2 -29
  44. package/dist/index137.mjs +2 -7
  45. package/dist/index138.mjs +16 -50
  46. package/dist/index139.mjs +32 -6
  47. package/dist/index140.mjs +37 -11
  48. package/dist/index141.mjs +18 -7
  49. package/dist/index142.mjs +18 -28
  50. package/dist/index143.mjs +2 -2
  51. package/dist/index144.mjs +20 -70
  52. package/dist/index145.mjs +42 -163
  53. package/dist/index147.mjs +30 -2
  54. package/dist/index148.mjs +18 -2
  55. package/dist/index149.mjs +2 -2
  56. package/dist/index150.mjs +2 -18
  57. package/dist/index151.mjs +2 -32
  58. package/dist/index152.mjs +2 -38
  59. package/dist/index153.mjs +67 -13
  60. package/dist/index154.mjs +2 -18
  61. package/dist/index155.mjs +53 -2
  62. package/dist/index156.mjs +2 -20
  63. package/dist/index157.mjs +29 -39
  64. package/dist/index158.mjs +152 -2
  65. package/dist/index159.mjs +2 -30
  66. package/dist/index160.mjs +2 -18
  67. package/dist/index161.mjs +19 -2
  68. package/dist/index162.mjs +2 -2
  69. package/dist/index163.mjs +2 -2
  70. package/dist/index164.mjs +26 -2
  71. package/dist/index165.mjs +2 -72
  72. package/dist/index166.mjs +2 -2
  73. package/dist/index167.mjs +20 -49
  74. package/dist/index168.mjs +23 -2
  75. package/dist/index169.mjs +2 -36
  76. package/dist/index170.mjs +2 -152
  77. package/dist/index171.mjs +2 -2
  78. package/dist/index172.mjs +23 -2
  79. package/dist/index173.mjs +2 -19
  80. package/dist/index174.mjs +23 -2
  81. package/dist/index176.mjs +2 -26
  82. package/dist/index177.mjs +2 -2
  83. package/dist/index178.mjs +23 -2
  84. package/dist/index179.mjs +2 -24
  85. package/dist/index180.mjs +15 -15
  86. package/dist/index181.mjs +2 -2
  87. package/dist/index182.mjs +2 -2
  88. package/dist/index183.mjs +2 -2
  89. package/dist/index184.mjs +2 -23
  90. package/dist/index185.mjs +2 -2
  91. package/dist/index186.mjs +2 -23
  92. package/dist/index187.mjs +2 -2
  93. package/dist/index188.mjs +2 -2
  94. package/dist/index189.mjs +127 -2
  95. package/dist/index190.mjs +2 -23
  96. package/dist/index191.mjs +74 -2
  97. package/dist/index192.mjs +71 -20
  98. package/dist/index193.mjs +21 -2
  99. package/dist/index194.mjs +56 -2
  100. package/dist/index195.mjs +29 -2
  101. package/dist/index196.mjs +7 -2
  102. package/dist/index197.mjs +52 -2
  103. package/dist/index198.mjs +6 -2
  104. package/dist/index199.mjs +12 -2
  105. package/dist/index200.mjs +7 -2
  106. package/dist/index201.mjs +28 -127
  107. package/dist/index202.mjs +2 -2
  108. package/dist/index203.mjs +69 -73
  109. package/dist/index204.mjs +164 -71
  110. package/dist/index205.mjs +2 -31
  111. package/dist/index206.mjs +2 -11
  112. package/dist/index207.mjs +2 -4
  113. package/dist/index208.mjs +2 -4
  114. package/dist/index209.mjs +108 -13
  115. package/dist/index210.mjs +2 -7
  116. package/dist/index211.mjs +2 -2
  117. package/dist/index212.mjs +2 -2
  118. package/dist/index213.mjs +2 -2
  119. package/dist/index214.mjs +2 -2
  120. package/dist/index215.mjs +2 -2
  121. package/dist/index216.mjs +2 -2
  122. package/dist/index217.mjs +244 -2
  123. package/dist/index218.mjs +2 -2
  124. package/dist/index219.mjs +28 -103
  125. package/dist/index220.mjs +65 -2
  126. package/dist/index221.mjs +24 -11
  127. package/dist/index222.mjs +2 -5
  128. package/dist/index223.mjs +37 -33
  129. package/dist/index224.mjs +2 -31
  130. package/dist/index225.mjs +2 -28
  131. package/dist/index226.mjs +2 -61
  132. package/dist/index227.mjs +2 -2
  133. package/dist/index228.mjs +2 -2
  134. package/dist/index229.mjs +2 -37
  135. package/dist/index232.mjs +2 -244
  136. package/dist/index233.mjs +4 -2
  137. package/dist/index234.mjs +2 -33
  138. package/dist/index235.mjs +2 -65
  139. package/dist/index236.mjs +13 -25
  140. package/dist/index237.mjs +7 -2
  141. package/dist/index238.mjs +31 -2
  142. package/dist/index239.mjs +11 -2
  143. package/dist/index240.mjs +4 -2
  144. package/dist/index241.mjs +4 -2
  145. package/dist/index242.mjs +12 -2
  146. package/dist/index243.mjs +5 -2
  147. package/dist/index244.mjs +33 -2
  148. package/dist/index245.mjs +31 -4
  149. package/dist/index246.mjs +28 -2
  150. package/dist/index247.mjs +61 -2
  151. package/dist/index249.mjs +2 -2
  152. package/dist/index250.mjs +2 -18
  153. package/dist/index251.mjs +13 -42
  154. package/dist/index252.mjs +47 -2
  155. package/dist/index257.mjs +1 -2
  156. package/dist/index258.mjs +3 -2
  157. package/dist/index259.mjs +2 -2
  158. package/dist/index260.mjs +2 -2
  159. package/dist/index263.mjs +1 -1
  160. package/dist/index264.mjs +2 -2
  161. package/dist/index32.mjs +1 -1
  162. package/dist/index33.mjs +1 -1
  163. package/dist/index34.mjs +1 -1
  164. package/dist/index35.mjs +1 -1
  165. package/dist/index36.mjs +1 -1
  166. package/dist/index37.mjs +1 -1
  167. package/dist/index39.mjs +3 -3
  168. package/dist/index47.mjs +17 -17
  169. package/dist/index48.mjs +2 -2
  170. package/dist/index49.mjs +1 -1
  171. package/dist/index50.mjs +1 -1
  172. package/dist/index51.mjs +1 -1
  173. package/dist/index52.mjs +1 -1
  174. package/dist/index53.mjs +1 -1
  175. package/dist/index54.mjs +1 -1
  176. package/dist/index55.mjs +1 -1
  177. package/dist/index56.mjs +1 -1
  178. package/dist/index57.mjs +1 -1
  179. package/dist/index58.mjs +1 -1
  180. package/dist/index59.mjs +1 -1
  181. package/dist/index62.mjs +2 -5
  182. package/dist/index64.mjs +75 -2
  183. package/dist/index65.mjs +14 -74
  184. package/dist/index66.mjs +62 -14
  185. package/dist/index67.mjs +4 -62
  186. package/dist/index70.mjs +35 -35
  187. package/dist/index71.mjs +1 -1
  188. package/dist/index72.mjs +2 -2
  189. package/dist/index73.mjs +1 -1
  190. package/dist/index75.mjs +2 -34
  191. package/dist/index76.mjs +25 -40
  192. package/dist/index77.mjs +15 -232
  193. package/dist/index78.mjs +214 -5
  194. package/dist/index79.mjs +173 -127
  195. package/dist/index80.mjs +21 -67
  196. package/dist/index81.mjs +21 -85
  197. package/dist/index82.mjs +32 -28
  198. package/dist/index83.mjs +155 -8
  199. package/dist/index84.mjs +17 -72
  200. package/dist/index85.mjs +30 -3
  201. package/dist/index86.mjs +84 -2
  202. package/dist/index87.mjs +36 -81
  203. package/dist/index88.mjs +144 -53
  204. package/dist/index89.mjs +54 -5
  205. package/dist/index9.mjs +22 -22
  206. package/dist/index90.mjs +22 -4
  207. package/dist/index91.mjs +24 -176
  208. package/dist/index92.mjs +23 -53
  209. package/dist/index93.mjs +25 -69
  210. package/dist/index94.mjs +21 -2
  211. package/dist/index95.mjs +22 -2
  212. package/dist/index96.mjs +19 -26
  213. package/dist/index97.mjs +58 -11
  214. package/dist/index98.mjs +13 -210
  215. package/dist/index99.mjs +32 -173
  216. package/package.json +1 -1
  217. package/src/components/CartItem.tsx +6 -2
  218. package/src/components/DiscountCodeInput.tsx +2 -0
  219. package/src/components/ProductCard.tsx +2 -0
package/dist/index99.mjs CHANGED
@@ -1,183 +1,42 @@
1
1
  'use client';
2
- import { __module as L } from "./index155.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 "./index156.mjs";
9
- import { __require as D } from "./index157.mjs";
10
- import { __require as G } from "./index152.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", {
2
+ import { __exports as l } from "./index177.mjs";
3
+ import { __require as _ } from "./index81.mjs";
4
+ import { __require as v } from "./index178.mjs";
5
+ import { __require as q } from "./index174.mjs";
6
+ var s;
7
+ function N() {
8
+ return s ? l : (s = 1, function(h) {
9
+ Object.defineProperty(h, "__esModule", {
17
10
  value: !0
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 $;
11
+ }), Object.defineProperty(h, "getNextPathnameInfo", {
12
+ enumerable: !0,
13
+ get: function() {
14
+ return p;
34
15
  }
35
16
  });
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
- });
17
+ const c = _(), u = v(), d = q();
18
+ function p(i, t) {
19
+ var f;
20
+ const { basePath: r, i18n: o, trailingSlash: P } = (f = t.nextConfig) != null ? f : {}, e = {
21
+ pathname: i,
22
+ trailingSlash: i !== "/" ? i.endsWith("/") : P
23
+ };
24
+ r && (0, d.pathHasPrefix)(e.pathname, r) && (e.pathname = (0, u.removePathPrefix)(e.pathname, r), e.basePath = r);
25
+ let n = e.pathname;
26
+ if (e.pathname.startsWith("/_next/data/") && e.pathname.endsWith(".json")) {
27
+ const a = e.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/"), x = a[0];
28
+ e.buildId = x, n = a[1] !== "index" ? "/" + a.slice(1).join("/") : "/", t.parseData === !0 && (e.pathname = n);
51
29
  }
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
- });
30
+ if (o) {
31
+ let a = t.i18nProvider ? t.i18nProvider.analyze(e.pathname) : (0, c.normalizeLocalePath)(e.pathname, o.locales);
32
+ e.locale = a.detectedLocale;
33
+ var m;
34
+ e.pathname = (m = a.pathname) != null ? m : e.pathname, !a.detectedLocale && e.buildId && (a = t.i18nProvider ? t.i18nProvider.analyze(n) : (0, c.normalizeLocalePath)(n, o.locales), a.detectedLocale && (e.locale = a.detectedLocale));
171
35
  }
172
- return null;
36
+ return e;
173
37
  }
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);
38
+ }(l), l);
180
39
  }
181
40
  export {
182
- ie as __require
41
+ N as __require
183
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instockng/storefront-ui",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Pre-built UI components for OMS e-commerce sites",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /**
2
4
  * CartItem Component
3
5
  *
@@ -50,6 +52,8 @@ export function CartItem({
50
52
  setIsRemoving(false);
51
53
  }, [item.id, removeItem]);
52
54
 
55
+ const itemThumbnailUrl = item.variant.thumbnailUrl ?? item.variant.product.thumbnailUrl;
56
+
53
57
  return (
54
58
  <div
55
59
  className={cn(
@@ -60,9 +64,9 @@ export function CartItem({
60
64
  >
61
65
  {/* Product Image */}
62
66
  <div className="h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-gray-100">
63
- {item.variant.product.thumbnailUrl ? (
67
+ {itemThumbnailUrl ? (
64
68
  <img
65
- src={item.variant.product.thumbnailUrl}
69
+ src={itemThumbnailUrl}
66
70
  alt={item.variant.product.name}
67
71
  className="h-full w-full object-cover"
68
72
  />
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /**
2
4
  * DiscountCodeInput Component
3
5
  *
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /**
2
4
  * ProductCard Component
3
5
  *