@instockng/storefront-ui 1.0.15 → 1.0.16

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 (88) hide show
  1. package/dist/components/OrderConfirmation.d.ts.map +1 -1
  2. package/dist/index10.mjs +3 -3
  3. package/dist/index100.mjs +33 -5
  4. package/dist/index101.mjs +31 -33
  5. package/dist/index102.mjs +26 -29
  6. package/dist/index103.mjs +59 -26
  7. package/dist/index104.mjs +3 -61
  8. package/dist/index105.mjs +2 -3
  9. package/dist/index106.mjs +2 -2
  10. package/dist/index107.mjs +17 -2
  11. package/dist/index108.mjs +11 -15
  12. package/dist/index109.mjs +6 -13
  13. package/dist/index11.mjs +2 -2
  14. package/dist/index110.mjs +30 -6
  15. package/dist/index13.mjs +1 -1
  16. package/dist/index17.mjs +2 -2
  17. package/dist/index29.mjs +1 -1
  18. package/dist/index30.mjs +1 -1
  19. package/dist/index31.mjs +1 -1
  20. package/dist/index32.mjs +1 -1
  21. package/dist/index33.mjs +1433 -4
  22. package/dist/index34.mjs +2 -1433
  23. package/dist/index35.mjs +57 -2
  24. package/dist/index36.mjs +48 -54
  25. package/dist/index37.mjs +33 -51
  26. package/dist/index38.mjs +15 -33
  27. package/dist/index39.mjs +2260 -12
  28. package/dist/index4.mjs +37 -37
  29. package/dist/index40.mjs +19 -2259
  30. package/dist/index42.mjs +17 -17
  31. package/dist/index43.mjs +2 -2
  32. package/dist/index44.mjs +1 -1
  33. package/dist/index45.mjs +1 -1
  34. package/dist/index46.mjs +1 -1
  35. package/dist/index47.mjs +1 -1
  36. package/dist/index48.mjs +1 -1
  37. package/dist/index49.mjs +1 -1
  38. package/dist/index50.mjs +1 -1
  39. package/dist/index51.mjs +1 -1
  40. package/dist/index52.mjs +1 -1
  41. package/dist/index53.mjs +1 -1
  42. package/dist/index54.mjs +1 -1
  43. package/dist/index55.mjs +73 -21
  44. package/dist/index56.mjs +14 -74
  45. package/dist/index57.mjs +62 -14
  46. package/dist/index58.mjs +4 -62
  47. package/dist/index61.mjs +34 -5
  48. package/dist/index62.mjs +40 -31
  49. package/dist/index63.mjs +230 -38
  50. package/dist/index64.mjs +4 -233
  51. package/dist/index65.mjs +133 -5
  52. package/dist/index66.mjs +63 -129
  53. package/dist/index67.mjs +86 -67
  54. package/dist/index68.mjs +27 -85
  55. package/dist/index69.mjs +8 -28
  56. package/dist/index70.mjs +74 -8
  57. package/dist/index71.mjs +3 -74
  58. package/dist/index72.mjs +2 -4
  59. package/dist/index73.mjs +83 -2
  60. package/dist/index74.mjs +52 -81
  61. package/dist/index75.mjs +5 -53
  62. package/dist/index76.mjs +4 -5
  63. package/dist/index77.mjs +178 -4
  64. package/dist/index78.mjs +48 -174
  65. package/dist/index79.mjs +67 -51
  66. package/dist/index80.mjs +21 -69
  67. package/dist/index81.mjs +54 -19
  68. package/dist/index82.mjs +28 -55
  69. package/dist/index83.mjs +5 -27
  70. package/dist/index84.mjs +51 -6
  71. package/dist/index85.mjs +5 -51
  72. package/dist/index86.mjs +12 -6
  73. package/dist/index87.mjs +7 -12
  74. package/dist/index88.mjs +27 -6
  75. package/dist/index89.mjs +2 -28
  76. package/dist/index90.mjs +70 -2
  77. package/dist/index91.mjs +164 -67
  78. package/dist/index92.mjs +28 -164
  79. package/dist/index93.mjs +10 -30
  80. package/dist/index94.mjs +3 -10
  81. package/dist/index95.mjs +3 -3
  82. package/dist/index96.mjs +13 -4
  83. package/dist/index97.mjs +7 -13
  84. package/dist/index98.mjs +12 -7
  85. package/dist/index99.mjs +4 -11
  86. package/package.json +2 -3
  87. package/src/components/OrderConfirmation.tsx +6 -1
  88. package/dist/index111.mjs +0 -33
package/dist/index92.mjs CHANGED
@@ -1,170 +1,34 @@
1
1
  'use client';
2
- import K from "./index88.mjs";
3
- import t from "./index64.mjs";
4
- import b from "./index75.mjs";
5
- import ee from "./index103.mjs";
6
- import { trackStream as z } from "./index104.mjs";
7
- import te from "./index78.mjs";
8
- import { progressEventDecorator as I, progressEventReducer as M, asyncDecorator as j } from "./index101.mjs";
9
- import se from "./index102.mjs";
10
- import re from "./index99.mjs";
11
- const J = 64 * 1024, { isFunction: P } = t, ne = (({ Request: r, Response: n }) => ({
12
- Request: r,
13
- Response: n
14
- }))(t.global), {
15
- ReadableStream: V,
16
- TextEncoder: W
17
- } = t.global, Z = (r, ...n) => {
18
- try {
19
- return !!r(...n);
20
- } catch {
21
- return !1;
22
- }
23
- }, oe = (r) => {
24
- r = t.merge.call({
25
- skipUndefined: !0
26
- }, ne, r);
27
- const { fetch: n, Request: o, Response: y } = r, g = n ? P(n) : typeof fetch == "function", f = P(o), F = P(y);
28
- if (!g)
29
- return !1;
30
- const w = g && P(V), R = g && (typeof W == "function" ? /* @__PURE__ */ ((e) => (s) => e.encode(s))(new W()) : async (e) => new Uint8Array(await new o(e).arrayBuffer())), d = f && w && Z(() => {
31
- let e = !1;
32
- const s = new o(K.origin, {
33
- body: new V(),
34
- method: "POST",
35
- get duplex() {
36
- return e = !0, "half";
37
- }
38
- }).headers.has("Content-Type");
39
- return e && !s;
40
- }), h = F && w && Z(() => t.isReadableStream(new y("").body)), x = {
41
- stream: h && ((e) => e.body)
2
+ import p from "./index73.mjs";
3
+ function i(n) {
4
+ const t = {
5
+ "!": "%21",
6
+ "'": "%27",
7
+ "(": "%28",
8
+ ")": "%29",
9
+ "~": "%7E",
10
+ "%20": "+",
11
+ "%00": "\0"
42
12
  };
43
- g && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
44
- !x[e] && (x[e] = (s, i) => {
45
- let c = s && s[e];
46
- if (c)
47
- return c.call(s);
48
- throw new b(`Response type '${e}' is not supported`, b.ERR_NOT_SUPPORT, i);
49
- });
13
+ return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g, function(r) {
14
+ return t[r];
50
15
  });
51
- const $ = async (e) => {
52
- if (e == null)
53
- return 0;
54
- if (t.isBlob(e))
55
- return e.size;
56
- if (t.isSpecCompliantForm(e))
57
- return (await new o(K.origin, {
58
- method: "POST",
59
- body: e
60
- }).arrayBuffer()).byteLength;
61
- if (t.isArrayBufferView(e) || t.isArrayBuffer(e))
62
- return e.byteLength;
63
- if (t.isURLSearchParams(e) && (e = e + ""), t.isString(e))
64
- return (await R(e)).byteLength;
65
- }, G = async (e, s) => {
66
- const i = t.toFiniteNumber(e.getContentLength());
67
- return i ?? $(s);
68
- };
69
- return async (e) => {
70
- let {
71
- url: s,
72
- method: i,
73
- data: c,
74
- signal: Q,
75
- cancelToken: _,
76
- timeout: X,
77
- onDownloadProgress: O,
78
- onUploadProgress: B,
79
- responseType: l,
80
- headers: q,
81
- withCredentials: C = "same-origin",
82
- fetchOptions: U
83
- } = se(e), v = n || fetch;
84
- l = l ? (l + "").toLowerCase() : "text";
85
- let E = ee([Q, _ && _.toAbortSignal()], X), T = null;
86
- const m = E && E.unsubscribe && (() => {
87
- E.unsubscribe();
88
- });
89
- let D;
90
- try {
91
- if (B && d && i !== "get" && i !== "head" && (D = await G(q, c)) !== 0) {
92
- let p = new o(s, {
93
- method: "POST",
94
- body: c,
95
- duplex: "half"
96
- }), S;
97
- if (t.isFormData(c) && (S = p.headers.get("content-type")) && q.setContentType(S), p.body) {
98
- const [A, L] = I(
99
- D,
100
- M(j(B))
101
- );
102
- c = z(p.body, J, A, L);
103
- }
104
- }
105
- t.isString(C) || (C = C ? "include" : "omit");
106
- const a = f && "credentials" in o.prototype, N = {
107
- ...U,
108
- signal: E,
109
- method: i.toUpperCase(),
110
- headers: q.normalize().toJSON(),
111
- body: c,
112
- duplex: "half",
113
- credentials: a ? C : void 0
114
- };
115
- T = f && new o(s, N);
116
- let u = await (f ? v(T, U) : v(s, N));
117
- const k = h && (l === "stream" || l === "response");
118
- if (h && (O || k && m)) {
119
- const p = {};
120
- ["status", "statusText", "headers"].forEach((H) => {
121
- p[H] = u[H];
122
- });
123
- const S = t.toFiniteNumber(u.headers.get("content-length")), [A, L] = O && I(
124
- S,
125
- M(j(O), !0)
126
- ) || [];
127
- u = new y(
128
- z(u.body, J, A, () => {
129
- L && L(), m && m();
130
- }),
131
- p
132
- );
133
- }
134
- l = l || "text";
135
- let Y = await x[t.findKey(x, l) || "text"](u, e);
136
- return !k && m && m(), await new Promise((p, S) => {
137
- re(p, S, {
138
- data: Y,
139
- headers: te.from(u.headers),
140
- status: u.status,
141
- statusText: u.statusText,
142
- config: e,
143
- request: T
144
- });
145
- });
146
- } catch (a) {
147
- throw m && m(), a && a.name === "TypeError" && /Load failed|fetch/i.test(a.message) ? Object.assign(
148
- new b("Network Error", b.ERR_NETWORK, e, T),
149
- {
150
- cause: a.cause || a
151
- }
152
- ) : b.from(a, a && a.code, e, T);
153
- }
154
- };
155
- }, ae = /* @__PURE__ */ new Map(), ie = (r) => {
156
- let n = r ? r.env : {};
157
- const { fetch: o, Request: y, Response: g } = n, f = [
158
- y,
159
- g,
160
- o
161
- ];
162
- let F = f.length, w = F, R, d, h = ae;
163
- for (; w--; )
164
- R = f[w], d = h.get(R), d === void 0 && h.set(R, d = w ? /* @__PURE__ */ new Map() : oe(n)), h = d;
165
- return d;
16
+ }
17
+ function a(n, t) {
18
+ this._pairs = [], n && p(n, this, t);
19
+ }
20
+ const c = a.prototype;
21
+ c.append = function(t, o) {
22
+ this._pairs.push([t, o]);
23
+ };
24
+ c.toString = function(t) {
25
+ const o = t ? function(r) {
26
+ return t.call(this, r, i);
27
+ } : i;
28
+ return this._pairs.map(function(e) {
29
+ return o(e[0]) + "=" + o(e[1]);
30
+ }, "").join("&");
166
31
  };
167
- ie();
168
32
  export {
169
- ie as getFetch
33
+ a as default
170
34
  };
package/dist/index93.mjs CHANGED
@@ -1,34 +1,14 @@
1
1
  'use client';
2
- import p from "./index74.mjs";
3
- function i(n) {
4
- const t = {
5
- "!": "%21",
6
- "'": "%27",
7
- "(": "%28",
8
- ")": "%29",
9
- "~": "%7E",
10
- "%20": "+",
11
- "%00": "\0"
12
- };
13
- return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g, function(r) {
14
- return t[r];
15
- });
2
+ import i from "./index63.mjs";
3
+ import m from "./index67.mjs";
4
+ import s from "./index77.mjs";
5
+ function h(f, t) {
6
+ const o = this || m, r = t || o, n = s.from(r.headers);
7
+ let a = r.data;
8
+ return i.forEach(f, function(e) {
9
+ a = e.call(o, a, n.normalize(), t ? t.status : void 0);
10
+ }), n.normalize(), a;
16
11
  }
17
- function a(n, t) {
18
- this._pairs = [], n && p(n, this, t);
19
- }
20
- const c = a.prototype;
21
- c.append = function(t, o) {
22
- this._pairs.push([t, o]);
23
- };
24
- c.toString = function(t) {
25
- const o = t ? function(r) {
26
- return t.call(this, r, i);
27
- } : i;
28
- return this._pairs.map(function(e) {
29
- return o(e[0]) + "=" + o(e[1]);
30
- }, "").join("&");
31
- };
32
12
  export {
33
- a as default
13
+ h as default
34
14
  };
package/dist/index94.mjs CHANGED
@@ -1,14 +1,7 @@
1
1
  'use client';
2
- import i from "./index64.mjs";
3
- import m from "./index68.mjs";
4
- import s from "./index78.mjs";
5
- function h(f, t) {
6
- const o = this || m, r = t || o, n = s.from(r.headers);
7
- let a = r.data;
8
- return i.forEach(f, function(e) {
9
- a = e.call(o, a, n.normalize(), t ? t.status : void 0);
10
- }), n.normalize(), a;
2
+ function e(t) {
3
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
11
4
  }
12
5
  export {
13
- h as default
6
+ e as default
14
7
  };
package/dist/index95.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- function e(t) {
3
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
2
+ function n(e, c) {
3
+ return c ? e.replace(/\/?\/$/, "") + "/" + c.replace(/^\/+/, "") : e;
4
4
  }
5
5
  export {
6
- e as default
6
+ n as default
7
7
  };
package/dist/index96.mjs CHANGED
@@ -1,7 +1,16 @@
1
1
  'use client';
2
- function n(e, c) {
3
- return c ? e.replace(/\/?\/$/, "") + "/" + c.replace(/^\/+/, "") : e;
4
- }
2
+ import o from "./index104.mjs";
3
+ import r from "./index105.mjs";
4
+ import t from "./index106.mjs";
5
+ const l = {
6
+ isBrowser: !0,
7
+ classes: {
8
+ URLSearchParams: o,
9
+ FormData: r,
10
+ Blob: t
11
+ },
12
+ protocols: ["http", "https", "file", "blob", "url", "data"]
13
+ };
5
14
  export {
6
- n as default
15
+ l as default
7
16
  };
package/dist/index97.mjs CHANGED
@@ -1,16 +1,10 @@
1
1
  'use client';
2
- import o from "./index105.mjs";
3
- import r from "./index106.mjs";
4
- import t from "./index107.mjs";
5
- const l = {
6
- isBrowser: !0,
7
- classes: {
8
- URLSearchParams: o,
9
- FormData: r,
10
- Blob: t
11
- },
12
- protocols: ["http", "https", "file", "blob", "url", "data"]
13
- };
2
+ const e = typeof window < "u" && typeof document < "u", o = typeof navigator == "object" && navigator || void 0, n = e && (!o || ["ReactNative", "NativeScript", "NS"].indexOf(o.product) < 0), t = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
3
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", r = e && window.location.href || "http://localhost";
14
4
  export {
15
- l as default
5
+ e as hasBrowserEnv,
6
+ n as hasStandardBrowserEnv,
7
+ t as hasStandardBrowserWebWorkerEnv,
8
+ o as navigator,
9
+ r as origin
16
10
  };
package/dist/index98.mjs CHANGED
@@ -1,10 +1,15 @@
1
1
  'use client';
2
- const e = typeof window < "u" && typeof document < "u", o = typeof navigator == "object" && navigator || void 0, n = e && (!o || ["ReactNative", "NativeScript", "NS"].indexOf(o.product) < 0), t = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
3
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", r = e && window.location.href || "http://localhost";
2
+ import a from "./index74.mjs";
3
+ function E(i, f, t) {
4
+ const u = t.config.validateStatus;
5
+ !t.status || !u || u(t.status) ? i(t) : f(new a(
6
+ "Request failed with status code " + t.status,
7
+ [a.ERR_BAD_REQUEST, a.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
8
+ t.config,
9
+ t.request,
10
+ t
11
+ ));
12
+ }
4
13
  export {
5
- e as hasBrowserEnv,
6
- n as hasStandardBrowserEnv,
7
- t as hasStandardBrowserWebWorkerEnv,
8
- o as navigator,
9
- r as origin
14
+ E as default
10
15
  };
package/dist/index99.mjs CHANGED
@@ -1,15 +1,8 @@
1
1
  'use client';
2
- import a from "./index75.mjs";
3
- function E(i, f, t) {
4
- const u = t.config.validateStatus;
5
- !t.status || !u || u(t.status) ? i(t) : f(new a(
6
- "Request failed with status code " + t.status,
7
- [a.ERR_BAD_REQUEST, a.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
8
- t.config,
9
- t.request,
10
- t
11
- ));
2
+ function o(e) {
3
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
4
+ return t && t[1] || "";
12
5
  }
13
6
  export {
14
- E as default
7
+ o as default
15
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instockng/storefront-ui",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
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",
@@ -38,8 +38,7 @@
38
38
  "class-variance-authority": "^0.7.1",
39
39
  "clsx": "^2.1.0",
40
40
  "tailwind-merge": "^2.2.0",
41
- "yup": "^1.7.1",
42
- "@oms/shared": "1.0.0"
41
+ "yup": "^1.7.1"
43
42
  },
44
43
  "peerDependencies": {
45
44
  "@tanstack/react-query": "^5.0.0",
@@ -7,13 +7,18 @@
7
7
 
8
8
  import { useState } from 'react';
9
9
  import { useGetOrder, useConfirmOrder } from '@instockng/api-client';
10
- import { WHATSAPP_HELP_LINK, WHATSAPP_HELP_NUMBER_FORMATTED } from '@oms/shared';
11
10
  import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
12
11
  import { Button } from './ui/button';
13
12
  import { Badge } from './ui/badge';
14
13
  import { CheckCircle, XCircle, Loader2, Package } from 'lucide-react';
15
14
  import { formatCurrency, formatDateTime, cn } from '../lib/utils';
16
15
 
16
+ // WhatsApp support contact constants
17
+ const WHATSAPP_HELP_NUMBER = '2348125648668';
18
+ const localPart = '0' + WHATSAPP_HELP_NUMBER.slice(3);
19
+ const WHATSAPP_HELP_NUMBER_FORMATTED = `${localPart.slice(0, 4)} ${localPart.slice(4, 7)} ${localPart.slice(7)}`;
20
+ const WHATSAPP_HELP_LINK = `https://wa.me/${WHATSAPP_HELP_NUMBER}`;
21
+
17
22
  export interface OrderConfirmationProps {
18
23
  /** Order UUID */
19
24
  orderId: string;
package/dist/index111.mjs DELETED
@@ -1,33 +0,0 @@
1
- 'use client';
2
- import r from "./index64.mjs";
3
- import c from "./index88.mjs";
4
- const p = c.hasStandardBrowserEnv ? (
5
- // Standard browser envs support document.cookie
6
- {
7
- write(e, t, n, i, s, u) {
8
- const o = [e + "=" + encodeURIComponent(t)];
9
- r.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), r.isString(i) && o.push("path=" + i), r.isString(s) && o.push("domain=" + s), u === !0 && o.push("secure"), document.cookie = o.join("; ");
10
- },
11
- read(e) {
12
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
13
- return t ? decodeURIComponent(t[3]) : null;
14
- },
15
- remove(e) {
16
- this.write(e, "", Date.now() - 864e5);
17
- }
18
- }
19
- ) : (
20
- // Non-standard browser env (web workers, react-native) lack needed support.
21
- {
22
- write() {
23
- },
24
- read() {
25
- return null;
26
- },
27
- remove() {
28
- }
29
- }
30
- );
31
- export {
32
- p as default
33
- };