@instockng/storefront-ui 1.0.75 → 1.0.76

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 (244) hide show
  1. package/dist/components/ProductAddOns.d.ts +3 -1
  2. package/dist/components/ProductAddOns.d.ts.map +1 -1
  3. package/dist/components/RecommendedProducts.d.ts.map +1 -1
  4. package/dist/components/VariantPickerModal.d.ts +28 -0
  5. package/dist/components/VariantPickerModal.d.ts.map +1 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.mjs +104 -102
  9. package/dist/index10.mjs +162 -121
  10. package/dist/index100.mjs +20 -69
  11. package/dist/index101.mjs +55 -34
  12. package/dist/index102.mjs +32 -42
  13. package/dist/index103.mjs +2 -2
  14. package/dist/index104.mjs +2 -28
  15. package/dist/index105.mjs +20 -17
  16. package/dist/index106.mjs +54 -213
  17. package/dist/index107.mjs +28 -179
  18. package/dist/index108.mjs +6 -21
  19. package/dist/index109.mjs +50 -21
  20. package/dist/index11.mjs +116 -88
  21. package/dist/index110.mjs +6 -33
  22. package/dist/index111.mjs +11 -155
  23. package/dist/index112.mjs +7 -20
  24. package/dist/index113.mjs +28 -31
  25. package/dist/index114.mjs +2 -84
  26. package/dist/index115.mjs +68 -36
  27. package/dist/index116.mjs +163 -141
  28. package/dist/index117.mjs +2 -55
  29. package/dist/index118.mjs +26 -21
  30. package/dist/index119.mjs +11 -20
  31. package/dist/index12.mjs +86 -90
  32. package/dist/index120.mjs +211 -19
  33. package/dist/index121.mjs +174 -19
  34. package/dist/index122.mjs +15 -14
  35. package/dist/index123.mjs +16 -15
  36. package/dist/index124.mjs +26 -14
  37. package/dist/index125.mjs +147 -56
  38. package/dist/index126.mjs +10 -8
  39. package/dist/index127.mjs +22 -30
  40. package/dist/index128.mjs +77 -17
  41. package/dist/index129.mjs +30 -26
  42. package/dist/index13.mjs +83 -185
  43. package/dist/index130.mjs +140 -22
  44. package/dist/index131.mjs +50 -14
  45. package/dist/index132.mjs +17 -15
  46. package/dist/index133.mjs +18 -38
  47. package/dist/index134.mjs +17 -17
  48. package/dist/index135.mjs +19 -262
  49. package/dist/index136.mjs +13 -62
  50. package/dist/index137.mjs +21 -7
  51. package/dist/index138.mjs +21 -2
  52. package/dist/index139.mjs +65 -2
  53. package/dist/index14.mjs +196 -94
  54. package/dist/index140.mjs +12 -27
  55. package/dist/index141.mjs +39 -2
  56. package/dist/index142.mjs +24 -2
  57. package/dist/index143.mjs +33 -20
  58. package/dist/index144.mjs +25 -54
  59. package/dist/index145.mjs +18 -28
  60. package/dist/index146.mjs +20 -6
  61. package/dist/index147.mjs +44 -49
  62. package/dist/index148.mjs +23 -6
  63. package/dist/index149.mjs +267 -11
  64. package/dist/index15.mjs +82 -713
  65. package/dist/index150.mjs +70 -7
  66. package/dist/index151.mjs +8 -28
  67. package/dist/index152.mjs +2 -2
  68. package/dist/index153.mjs +2 -70
  69. package/dist/index154.mjs +30 -164
  70. package/dist/index155.mjs +2 -2
  71. package/dist/index159.mjs +1 -1
  72. package/dist/index16.mjs +722 -53
  73. package/dist/index160.mjs +1 -1
  74. package/dist/index161.mjs +1 -1
  75. package/dist/index162.mjs +1 -1
  76. package/dist/index163.mjs +1 -1
  77. package/dist/index165.mjs +3 -3
  78. package/dist/index166.mjs +1 -1
  79. package/dist/index168.mjs +3 -3
  80. package/dist/index169.mjs +1 -1
  81. package/dist/index17.mjs +58 -60
  82. package/dist/index174.mjs +2 -2
  83. package/dist/index176.mjs +1 -1
  84. package/dist/index18.mjs +60 -22
  85. package/dist/index182.mjs +1 -1
  86. package/dist/index185.mjs +1 -1
  87. package/dist/index188.mjs +3 -3
  88. package/dist/index189.mjs +1 -1
  89. package/dist/index19.mjs +22 -107
  90. package/dist/index193.mjs +2 -2
  91. package/dist/index195.mjs +2 -2
  92. package/dist/index199.mjs +1 -1
  93. package/dist/index2.mjs +2 -2
  94. package/dist/index20.mjs +105 -38
  95. package/dist/index201.mjs +1 -1
  96. package/dist/index21.mjs +37 -37
  97. package/dist/index210.mjs +2 -2
  98. package/dist/index212.mjs +1 -1
  99. package/dist/index213.mjs +1 -1
  100. package/dist/index214.mjs +1 -1
  101. package/dist/index215.mjs +3 -3
  102. package/dist/index218.mjs +3 -3
  103. package/dist/index22.mjs +42 -71
  104. package/dist/index220.mjs +1 -1
  105. package/dist/index222.mjs +3 -3
  106. package/dist/index223.mjs +8 -8
  107. package/dist/index224.mjs +3 -3
  108. package/dist/index226.mjs +2 -2
  109. package/dist/index227.mjs +2 -108
  110. package/dist/index228.mjs +2 -2
  111. package/dist/index229.mjs +2 -2
  112. package/dist/index23.mjs +67 -28
  113. package/dist/index230.mjs +2 -37
  114. package/dist/index231.mjs +2 -2
  115. package/dist/index232.mjs +2 -2
  116. package/dist/index233.mjs +37 -2
  117. package/dist/index234.mjs +2 -2
  118. package/dist/index237.mjs +1 -1
  119. package/dist/index239.mjs +2 -2
  120. package/dist/index24.mjs +29 -6
  121. package/dist/index240.mjs +1 -1
  122. package/dist/index241.mjs +2 -2
  123. package/dist/index242.mjs +2 -2
  124. package/dist/index243.mjs +2 -2
  125. package/dist/index244.mjs +108 -2
  126. package/dist/index245.mjs +2 -2
  127. package/dist/index246.mjs +2 -2
  128. package/dist/index247.mjs +2 -2
  129. package/dist/index248.mjs +2 -2
  130. package/dist/index249.mjs +2 -2
  131. package/dist/index25.mjs +8 -21
  132. package/dist/index250.mjs +2 -2
  133. package/dist/index251.mjs +2 -2
  134. package/dist/index253.mjs +2 -2
  135. package/dist/index254.mjs +2 -2
  136. package/dist/index255.mjs +2 -2
  137. package/dist/index256.mjs +2 -4
  138. package/dist/index257.mjs +4 -2
  139. package/dist/index258.mjs +3 -2
  140. package/dist/index259.mjs +2 -18
  141. package/dist/index26.mjs +19 -34
  142. package/dist/index260.mjs +2 -47
  143. package/dist/index261.mjs +17 -2
  144. package/dist/index262.mjs +13 -2
  145. package/dist/index263.mjs +6 -2
  146. package/dist/index264.mjs +30 -2
  147. package/dist/index265.mjs +2 -91
  148. package/dist/index266.mjs +2 -3
  149. package/dist/index267.mjs +18 -2
  150. package/dist/index268.mjs +47 -2
  151. package/dist/index269.mjs +2 -17
  152. package/dist/index27.mjs +34 -37
  153. package/dist/index270.mjs +2 -13
  154. package/dist/index271.mjs +2 -6
  155. package/dist/index272.mjs +91 -30
  156. package/dist/index273.mjs +2 -2
  157. package/dist/index274.mjs +2 -2
  158. package/dist/index276.mjs +2 -2
  159. package/dist/index277.mjs +5 -0
  160. package/dist/index28.mjs +28 -103
  161. package/dist/index29.mjs +104 -20
  162. package/dist/index3.mjs +5 -5
  163. package/dist/index30.mjs +29 -9
  164. package/dist/index31.mjs +9 -9
  165. package/dist/index32.mjs +11 -116
  166. package/dist/index33.mjs +116 -25
  167. package/dist/index34.mjs +25 -81
  168. package/dist/index35.mjs +81 -112
  169. package/dist/index36.mjs +109 -8
  170. package/dist/index37.mjs +9 -33
  171. package/dist/index38.mjs +26 -19
  172. package/dist/index39.mjs +26 -9
  173. package/dist/index4.mjs +1 -1
  174. package/dist/index40.mjs +10 -122
  175. package/dist/index41.mjs +114 -380
  176. package/dist/index42.mjs +384 -20
  177. package/dist/index43.mjs +24 -31
  178. package/dist/index44.mjs +32 -7
  179. package/dist/index45.mjs +6 -1432
  180. package/dist/index46.mjs +1432 -69
  181. package/dist/index47.mjs +70 -2
  182. package/dist/index48.mjs +2 -60
  183. package/dist/index49.mjs +57 -48
  184. package/dist/index5.mjs +1 -1
  185. package/dist/index50.mjs +51 -33
  186. package/dist/index51.mjs +33 -15
  187. package/dist/index52.mjs +12 -2260
  188. package/dist/index53.mjs +2263 -36
  189. package/dist/index54.mjs +36 -44
  190. package/dist/index55.mjs +44 -99
  191. package/dist/index56.mjs +99 -81
  192. package/dist/index57.mjs +75 -13
  193. package/dist/index58.mjs +15 -125
  194. package/dist/index59.mjs +93 -89
  195. package/dist/index6.mjs +1 -1
  196. package/dist/index60.mjs +102 -56
  197. package/dist/index61.mjs +55 -89
  198. package/dist/index62.mjs +82 -76
  199. package/dist/index63.mjs +100 -13
  200. package/dist/index64.mjs +17 -92
  201. package/dist/index65.mjs +70 -56
  202. package/dist/index66.mjs +62 -44
  203. package/dist/index67.mjs +47 -46
  204. package/dist/index68.mjs +48 -121
  205. package/dist/index69.mjs +133 -22
  206. package/dist/index7.mjs +6 -6
  207. package/dist/index70.mjs +21 -150
  208. package/dist/index71.mjs +2 -23
  209. package/dist/index73.mjs +23 -2
  210. package/dist/index74.mjs +149 -71
  211. package/dist/index75.mjs +74 -14
  212. package/dist/index76.mjs +14 -62
  213. package/dist/index77.mjs +63 -2
  214. package/dist/index78.mjs +234 -5
  215. package/dist/index79.mjs +5 -1133
  216. package/dist/index8.mjs +4 -4
  217. package/dist/index80.mjs +131 -17
  218. package/dist/index81.mjs +67 -54
  219. package/dist/index82.mjs +84 -30
  220. package/dist/index83.mjs +29 -2
  221. package/dist/index84.mjs +9 -235
  222. package/dist/index85.mjs +74 -5
  223. package/dist/index86.mjs +3 -133
  224. package/dist/index87.mjs +2 -68
  225. package/dist/index88.mjs +79 -83
  226. package/dist/index89.mjs +52 -27
  227. package/dist/index9.mjs +3 -3
  228. package/dist/index90.mjs +5 -8
  229. package/dist/index91.mjs +4 -74
  230. package/dist/index92.mjs +178 -3
  231. package/dist/index93.mjs +53 -2
  232. package/dist/index94.mjs +68 -82
  233. package/dist/index95.mjs +33 -53
  234. package/dist/index96.mjs +42 -5
  235. package/dist/index97.mjs +2 -5
  236. package/dist/index98.mjs +5 -178
  237. package/dist/index99.mjs +1134 -53
  238. package/dist/styles.css +1 -1
  239. package/package.json +1 -1
  240. package/src/components/ProductAddOns.stories.tsx +10 -3
  241. package/src/components/ProductAddOns.tsx +167 -112
  242. package/src/components/RecommendedProducts.tsx +130 -88
  243. package/src/components/VariantPickerModal.tsx +154 -0
  244. package/src/index.ts +3 -0
package/dist/index107.mjs CHANGED
@@ -1,183 +1,32 @@
1
1
  'use client';
2
- import { __module as L } from "./index164.mjs";
3
- import "./index78.mjs";
4
- import { __require as K } from "./index104.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 "./index165.mjs";
9
- import { __require as D } from "./index166.mjs";
10
- import { __require as G } from "./index161.mjs";
11
- import { __exports as Q } from "./index83.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", {
17
- 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 $;
34
- }
35
- });
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
- });
51
- }
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
- });
171
- }
172
- return null;
173
- }
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);
2
+ import r from "./index215.mjs";
3
+ import p from "./index86.mjs";
4
+ import l from "./index82.mjs";
5
+ import m from "./index84.mjs";
6
+ import a from "./index92.mjs";
7
+ import o from "./index93.mjs";
8
+ function d(e) {
9
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
10
+ throw new m(null, e);
11
+ }
12
+ function q(e) {
13
+ return d(e), e.headers = a.from(e.headers), e.data = r.call(
14
+ e,
15
+ e.transformRequest
16
+ ), ["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) {
17
+ return d(e), t.data = r.call(
18
+ e,
19
+ e.transformResponse,
20
+ t
21
+ ), t.headers = a.from(t.headers), t;
22
+ }, function(t) {
23
+ return p(t) || (d(e), t && t.response && (t.response.data = r.call(
24
+ e,
25
+ e.transformResponse,
26
+ t.response
27
+ ), t.response.headers = a.from(t.response.headers))), Promise.reject(t);
28
+ });
180
29
  }
181
30
  export {
182
- ie as __require
31
+ q as default
183
32
  };
package/dist/index108.mjs CHANGED
@@ -1,25 +1,10 @@
1
1
  'use client';
2
- import { __exports as r } from "./index167.mjs";
3
- import { __require as m } from "./index168.mjs";
4
- import { __require as l } from "./index169.mjs";
5
- var i;
6
- function p() {
7
- return i ? r : (i = 1, function(t) {
8
- Object.defineProperty(t, "__esModule", {
9
- value: !0
10
- }), Object.defineProperty(t, "denormalizePagePath", {
11
- enumerable: !0,
12
- get: function() {
13
- return o;
14
- }
15
- });
16
- const a = m(), n = l();
17
- function o(u) {
18
- let e = (0, n.normalizePathSep)(u);
19
- return e.startsWith("/index/") && !(0, a.isDynamicRoute)(e) ? e.slice(6) : e !== "/index" ? e : "/";
20
- }
21
- }(r), r);
2
+ import r from "./index216.mjs";
3
+ import f from "./index217.mjs";
4
+ function u(l, i, t) {
5
+ let o = !r(i);
6
+ return l && (o || t == !1) ? f(l, i) : i;
22
7
  }
23
8
  export {
24
- p as __require
9
+ u as default
25
10
  };
package/dist/index109.mjs CHANGED
@@ -1,26 +1,55 @@
1
1
  'use client';
2
- import { __exports as t } from "./index170.mjs";
3
- var i;
4
- function s() {
5
- return i ? t : (i = 1, function(o) {
6
- Object.defineProperty(o, "__esModule", {
7
- value: !0
8
- }), Object.defineProperty(o, "normalizeLocalePath", {
9
- enumerable: !0,
10
- get: function() {
11
- return u;
12
- }
13
- });
14
- function u(r, l) {
15
- let a;
16
- const e = r.split("/");
17
- return (l || []).some((n) => e[1] && e[1].toLowerCase() === n.toLowerCase() ? (a = n, e.splice(1, 1), r = e.join("/") || "/", !0) : !1), {
18
- pathname: r,
19
- detectedLocale: a
20
- };
2
+ import { VERSION as w } from "./index87.mjs";
3
+ import s from "./index89.mjs";
4
+ const l = {};
5
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((n, t) => {
6
+ l[n] = function(o) {
7
+ return typeof o === n || "a" + (t < 1 ? "n " : " ") + n;
8
+ };
9
+ });
10
+ const f = {};
11
+ l.transitional = function(t, i, o) {
12
+ function a(r, e) {
13
+ return "[Axios v" + w + "] Transitional option '" + r + "'" + e + (o ? ". " + o : "");
14
+ }
15
+ return (r, e, u) => {
16
+ if (t === !1)
17
+ throw new s(
18
+ a(e, " has been removed" + (i ? " in " + i : "")),
19
+ s.ERR_DEPRECATED
20
+ );
21
+ return i && !f[e] && (f[e] = !0, console.warn(
22
+ a(
23
+ e,
24
+ " has been deprecated since v" + i + " and will be removed in the near future"
25
+ )
26
+ )), t ? t(r, e, u) : !0;
27
+ };
28
+ };
29
+ l.spelling = function(t) {
30
+ return (i, o) => (console.warn(`${o} is likely a misspelling of ${t}`), !0);
31
+ };
32
+ function b(n, t, i) {
33
+ if (typeof n != "object")
34
+ throw new s("options must be an object", s.ERR_BAD_OPTION_VALUE);
35
+ const o = Object.keys(n);
36
+ let a = o.length;
37
+ for (; a-- > 0; ) {
38
+ const r = o[a], e = t[r];
39
+ if (e) {
40
+ const u = n[r], c = u === void 0 || e(u, r, n);
41
+ if (c !== !0)
42
+ throw new s("option " + r + " must be " + c, s.ERR_BAD_OPTION_VALUE);
43
+ continue;
21
44
  }
22
- }(t), t);
45
+ if (i !== !0)
46
+ throw new s("Unknown option " + r, s.ERR_BAD_OPTION);
47
+ }
23
48
  }
49
+ const m = {
50
+ assertOptions: b,
51
+ validators: l
52
+ };
24
53
  export {
25
- s as __require
54
+ m as default
26
55
  };
package/dist/index11.mjs CHANGED
@@ -1,106 +1,134 @@
1
1
  'use client';
2
- import { jsx as i, jsxs as t, Fragment as g } from "react/jsx-runtime";
3
- import "./index23.mjs";
4
- import { useGetCartRecommendations as F } from "./index35.mjs";
2
+ import { jsx as i, jsxs as s, Fragment as f } from "react/jsx-runtime";
3
+ import "./index24.mjs";
4
+ import { useGetCartRecommendations as U } from "./index36.mjs";
5
5
  import "@tanstack/react-query";
6
- import { useCart as T } from "./index3.mjs";
7
- import { cn as x, formatCurrency as L } from "./index22.mjs";
8
- import { Button as S } from "./index16.mjs";
9
- import { Loader2 as N, Package as U, ShoppingCart as q } from "lucide-react";
10
- import { useState as d, useEffect as z } from "react";
11
- function K({
12
- limit: v,
13
- className: w
6
+ import { useCart as q } from "./index3.mjs";
7
+ import { cn as p, formatCurrency as z } from "./index23.mjs";
8
+ import { Button as B } from "./index17.mjs";
9
+ import { Loader2 as b, Package as D, ShoppingCart as E } from "lucide-react";
10
+ import { useState as r, useEffect as G } from "react";
11
+ import { VariantPickerModal as H } from "./index12.mjs";
12
+ function _({
13
+ limit: P,
14
+ className: C
14
15
  }) {
15
- const { cart: a, addItem: p } = T(), { data: r, isLoading: b, error: y } = F(a == null ? void 0 : a.id, v), [P, o] = d([]), [I, m] = d([]), [C, f] = d([]), [k, h] = d([]);
16
- if (z(() => {
17
- h([]), m([]), f([]);
18
- }, [r]), !a)
16
+ const { cart: o, addItem: k } = q(), { data: c, isLoading: I, error: A } = U(o == null ? void 0 : o.id, P), [j, h] = r([]), [F, u] = r([]), [V, g] = r([]), [L, x] = r([]), [v, m] = r(null), [M, w] = r(!1);
17
+ if (G(() => {
18
+ x([]), u([]), g([]);
19
+ }, [c]), !o)
19
20
  return null;
20
- if (b)
21
- return /* @__PURE__ */ i("div", { className: "py-6", children: /* @__PURE__ */ i("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ i(N, { className: "h-6 w-6 animate-spin text-accent-500" }) }) });
22
- const n = r == null ? void 0 : r.filter(
23
- (e) => !k.includes(e.id)
21
+ if (I)
22
+ return /* @__PURE__ */ i("div", { className: "py-6", children: /* @__PURE__ */ i("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ i(b, { className: "h-6 w-6 animate-spin text-accent-500" }) }) });
23
+ const a = c == null ? void 0 : c.filter(
24
+ (e) => !L.includes(e.id)
24
25
  );
25
- if (y || !n || n.length === 0)
26
+ if (A || !a || a.length === 0)
26
27
  return null;
27
- const j = async (e, l) => {
28
- o((s) => [...s, e.id]);
28
+ const N = async (e, t) => {
29
+ h((n) => [...n, e.id]);
29
30
  try {
30
- await p(e.slug, e.name, l.price, l.sku, 1), m((s) => [...s, e.id]), setTimeout(() => {
31
- f((s) => [...s, e.id]);
31
+ await k(e.slug, e.name, t.price, t.sku, 1), u((n) => [...n, e.id]), setTimeout(() => {
32
+ g((n) => [...n, e.id]);
32
33
  }, 500), setTimeout(() => {
33
- h((s) => [...s, e.id]);
34
+ x((n) => [...n, e.id]);
34
35
  }, 1e3);
35
36
  } finally {
36
- o((s) => s.filter((c) => c !== e.id));
37
+ h((n) => n.filter((l) => l !== e.id));
38
+ }
39
+ }, T = (e) => {
40
+ if (e.variants.length > 1) {
41
+ m(e);
42
+ return;
43
+ }
44
+ const t = e.variants[0];
45
+ t && N(e, t);
46
+ }, S = async (e, t) => {
47
+ w(!0);
48
+ try {
49
+ const n = a.find((d) => d.id === e.id), l = n == null ? void 0 : n.variants.find((d) => d.id === t.id);
50
+ n && l && await N(n, l), m(null);
51
+ } finally {
52
+ w(!1);
37
53
  }
38
54
  };
39
- return /* @__PURE__ */ t("div", { className: x("pt-2", w), children: [
40
- /* @__PURE__ */ i("div", { className: "mb-2 px-4", children: /* @__PURE__ */ i("h3", { className: "text-lg font-semibold text-gray-900", children: "Frequently bought together" }) }),
41
- /* @__PURE__ */ i("div", { className: "overflow-x-auto", children: /* @__PURE__ */ t("div", { className: "flex gap-4 pb-2 transition-all duration-500", children: [
42
- /* @__PURE__ */ i("div", { className: "flex-shrink-0 w-1" }),
43
- n == null ? void 0 : n.map((e) => {
44
- const l = e.variants[0];
45
- if (!l) return null;
46
- const s = P.includes(e.id), c = I.includes(e.id), A = C.includes(e.id);
47
- return /* @__PURE__ */ i(
48
- "div",
49
- {
50
- className: x(
51
- "flex flex-row flex-shrink-0 w-64 h-24 bg-white border border-gray-300 rounded-lg overflow-hidden transition-all duration-500",
52
- c && "opacity-0 blur-sm scale-95 pointer-events-none",
53
- A && "w-0 h-0 mr-[-1rem] overflow-hidden"
54
- ),
55
- children: /* @__PURE__ */ t(
56
- "a",
57
- {
58
- href: `/product/${e.slug}`,
59
- className: "flex flex-row flex-1 hover:bg-gray-50 transition-colors",
60
- children: [
61
- /* @__PURE__ */ i("div", { className: "relative w-20 h-full flex-shrink-0 bg-gray-100", children: e.thumbnailUrl ? /* @__PURE__ */ i(
62
- "img",
63
- {
64
- src: e.thumbnailUrl,
65
- alt: e.name,
66
- className: "w-full h-full object-cover"
67
- }
68
- ) : /* @__PURE__ */ i("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ i(U, { className: "h-8 w-8 text-gray-300" }) }) }),
69
- /* @__PURE__ */ t("div", { className: "p-2 flex flex-col flex-1 justify-between", children: [
70
- /* @__PURE__ */ t("div", { children: [
71
- /* @__PURE__ */ i("h4", { className: "text-xs font-medium text-gray-900 line-clamp-2 leading-tight", children: e.name }),
72
- /* @__PURE__ */ i("p", { className: "text-xs font-semibold text-accent-600 mt-0.5", children: L(l.price) })
73
- ] }),
74
- /* @__PURE__ */ i(
75
- S,
55
+ return /* @__PURE__ */ s(f, { children: [
56
+ /* @__PURE__ */ s("div", { className: p("pt-2", C), children: [
57
+ /* @__PURE__ */ i("div", { className: "mb-2 px-4", children: /* @__PURE__ */ i("h3", { className: "text-lg font-semibold text-gray-900", children: "Frequently bought together" }) }),
58
+ /* @__PURE__ */ i("div", { className: "overflow-x-auto", children: /* @__PURE__ */ s("div", { className: "flex gap-4 pb-2 transition-all duration-500", children: [
59
+ /* @__PURE__ */ i("div", { className: "flex-shrink-0 w-1" }),
60
+ a == null ? void 0 : a.map((e) => {
61
+ const t = e.variants[0];
62
+ if (!t) return null;
63
+ const n = j.includes(e.id), l = F.includes(e.id), d = V.includes(e.id);
64
+ return /* @__PURE__ */ i(
65
+ "div",
66
+ {
67
+ className: p(
68
+ "flex flex-row flex-shrink-0 w-64 h-24 bg-white border border-gray-300 rounded-lg overflow-hidden transition-all duration-500",
69
+ l && "opacity-0 blur-sm scale-95 pointer-events-none",
70
+ d && "w-0 h-0 mr-[-1rem] overflow-hidden"
71
+ ),
72
+ children: /* @__PURE__ */ s(
73
+ "a",
74
+ {
75
+ href: `/product/${e.slug}`,
76
+ className: "flex flex-row flex-1 hover:bg-gray-50 transition-colors",
77
+ children: [
78
+ /* @__PURE__ */ i("div", { className: "relative w-20 h-full flex-shrink-0 bg-gray-100", children: e.thumbnailUrl ? /* @__PURE__ */ i(
79
+ "img",
76
80
  {
77
- size: "sm",
78
- onClick: (u) => {
79
- u.preventDefault(), u.stopPropagation(), j(e, l);
80
- },
81
- disabled: s,
82
- className: "w-full bg-accent-500 hover:bg-accent-600 text-white text-xs h-6 mt-1",
83
- children: s ? /* @__PURE__ */ t(g, { children: [
84
- /* @__PURE__ */ i(N, { className: "h-3 w-3 animate-spin" }),
85
- "Adding..."
86
- ] }) : /* @__PURE__ */ t(g, { children: [
87
- /* @__PURE__ */ i(q, { className: "h-3 w-3" }),
88
- "Add"
89
- ] })
81
+ src: e.thumbnailUrl,
82
+ alt: e.name,
83
+ className: "w-full h-full object-cover"
90
84
  }
91
- )
92
- ] })
93
- ]
94
- }
95
- )
96
- },
97
- e.id
98
- );
99
- }),
100
- /* @__PURE__ */ i("div", { className: "flex-shrink-0 w-1" })
101
- ] }) })
85
+ ) : /* @__PURE__ */ i("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ i(D, { className: "h-8 w-8 text-gray-300" }) }) }),
86
+ /* @__PURE__ */ s("div", { className: "p-2 flex flex-col flex-1 justify-between", children: [
87
+ /* @__PURE__ */ s("div", { children: [
88
+ /* @__PURE__ */ i("h4", { className: "text-xs font-medium text-gray-900 line-clamp-2 leading-tight", children: e.name }),
89
+ /* @__PURE__ */ i("p", { className: "text-xs font-semibold text-accent-600 mt-0.5", children: z(t.price) })
90
+ ] }),
91
+ /* @__PURE__ */ i(
92
+ B,
93
+ {
94
+ size: "sm",
95
+ onClick: (y) => {
96
+ y.preventDefault(), y.stopPropagation(), T(e);
97
+ },
98
+ disabled: n,
99
+ className: "w-full bg-accent-500 hover:bg-accent-600 text-white text-xs h-6 mt-1",
100
+ children: n ? /* @__PURE__ */ s(f, { children: [
101
+ /* @__PURE__ */ i(b, { className: "h-3 w-3 animate-spin" }),
102
+ "Adding..."
103
+ ] }) : /* @__PURE__ */ s(f, { children: [
104
+ /* @__PURE__ */ i(E, { className: "h-3 w-3" }),
105
+ "Add"
106
+ ] })
107
+ }
108
+ )
109
+ ] })
110
+ ]
111
+ }
112
+ )
113
+ },
114
+ e.id
115
+ );
116
+ }),
117
+ /* @__PURE__ */ i("div", { className: "flex-shrink-0 w-1" })
118
+ ] }) })
119
+ ] }),
120
+ /* @__PURE__ */ i(
121
+ H,
122
+ {
123
+ isOpen: !!v,
124
+ onClose: () => m(null),
125
+ product: v,
126
+ onConfirm: S,
127
+ isLoading: M
128
+ }
129
+ )
102
130
  ] });
103
131
  }
104
132
  export {
105
- K as RecommendedProducts
133
+ _ as RecommendedProducts
106
134
  };
package/dist/index110.mjs CHANGED
@@ -1,36 +1,9 @@
1
1
  'use client';
2
- import { __exports as u } from "./index171.mjs";
3
- var f;
4
- function m() {
5
- return f ? u : (f = 1, function(i) {
6
- Object.defineProperty(i, "__esModule", {
7
- value: !0
8
- }), Object.defineProperty(i, "default", {
9
- enumerable: !0,
10
- get: function() {
11
- return o;
12
- }
13
- });
14
- function o() {
15
- const t = /* @__PURE__ */ Object.create(null);
16
- return {
17
- on(e, r) {
18
- (t[e] || (t[e] = [])).push(r);
19
- },
20
- off(e, r) {
21
- t[e] && t[e].splice(t[e].indexOf(r) >>> 0, 1);
22
- },
23
- emit(e) {
24
- for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
25
- a[n - 1] = arguments[n];
26
- (t[e] || []).slice().map((c) => {
27
- c(...a);
28
- });
29
- }
30
- };
31
- }
32
- }(u), u);
33
- }
2
+ const r = {
3
+ silentJSONParsing: !0,
4
+ forcedJSONParsing: !0,
5
+ clarifyTimeoutError: !1
6
+ };
34
7
  export {
35
- m as __require
8
+ r as default
36
9
  };