@instockng/storefront-ui 1.0.9 → 1.0.11

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 (104) hide show
  1. package/README.md +26 -0
  2. package/dist/components/Checkout.d.ts.map +1 -1
  3. package/dist/contexts/CartContext.d.ts.map +1 -1
  4. package/dist/index10.mjs +144 -141
  5. package/dist/index101.mjs +1 -1
  6. package/dist/index102.mjs +3 -3
  7. package/dist/index103.mjs +3 -3
  8. package/dist/index105.mjs +1 -1
  9. package/dist/index111.mjs +1 -1
  10. package/dist/index20.mjs +2 -2
  11. package/dist/index21.mjs +1 -1
  12. package/dist/index28.mjs +11 -11
  13. package/dist/index29.mjs +1 -1
  14. package/dist/index3.mjs +88 -74
  15. package/dist/index30.mjs +1 -1
  16. package/dist/index31.mjs +1 -1
  17. package/dist/index32.mjs +1 -1
  18. package/dist/index37.mjs +1 -1
  19. package/dist/index41.mjs +36 -23
  20. package/dist/index42.mjs +44 -36
  21. package/dist/index43.mjs +99 -44
  22. package/dist/index44.mjs +112 -99
  23. package/dist/index45.mjs +44 -80
  24. package/dist/index46.mjs +64 -53
  25. package/dist/index47.mjs +66 -49
  26. package/dist/index48.mjs +54 -73
  27. package/dist/index49.mjs +52 -63
  28. package/dist/index50.mjs +14 -70
  29. package/dist/index51.mjs +13 -14
  30. package/dist/index52.mjs +58 -13
  31. package/dist/index53.mjs +101 -34
  32. package/dist/index54.mjs +99 -95
  33. package/dist/index55.mjs +22 -132
  34. package/dist/index58.mjs +2 -2
  35. package/dist/index59.mjs +4 -3
  36. package/dist/index60.mjs +4 -2
  37. package/dist/index61.mjs +2 -5
  38. package/dist/index62.mjs +30 -231
  39. package/dist/index63.mjs +42 -5
  40. package/dist/index64.mjs +228 -127
  41. package/dist/index65.mjs +4 -66
  42. package/dist/index66.mjs +124 -77
  43. package/dist/index67.mjs +65 -26
  44. package/dist/index68.mjs +84 -6
  45. package/dist/index69.mjs +26 -72
  46. package/dist/index70.mjs +8 -3
  47. package/dist/index71.mjs +75 -2
  48. package/dist/index72.mjs +3 -82
  49. package/dist/index73.mjs +2 -54
  50. package/dist/index74.mjs +82 -5
  51. package/dist/index75.mjs +53 -4
  52. package/dist/index76.mjs +5 -178
  53. package/dist/index77.mjs +5 -53
  54. package/dist/index78.mjs +178 -68
  55. package/dist/index79.mjs +50 -31
  56. package/dist/index80.mjs +69 -43
  57. package/dist/index81.mjs +2 -2
  58. package/dist/index82.mjs +1 -1
  59. package/dist/index83.mjs +6 -6
  60. package/dist/index84.mjs +2 -2
  61. package/dist/index85.mjs +2 -2
  62. package/dist/index87.mjs +2 -2
  63. package/dist/index88.mjs +2 -2
  64. package/dist/index89.mjs +1 -1
  65. package/dist/index91.mjs +4 -4
  66. package/dist/index92.mjs +3 -3
  67. package/dist/index93.mjs +30 -12
  68. package/dist/index94.mjs +11 -7
  69. package/dist/index95.mjs +3 -30
  70. package/dist/index96.mjs +3 -10
  71. package/dist/index97.mjs +13 -4
  72. package/dist/index98.mjs +7 -4
  73. package/dist/index99.mjs +1 -1
  74. package/dist/styles.css +1 -0
  75. package/package.json +14 -13
  76. package/src/components/CartItem.stories.tsx +94 -0
  77. package/src/components/CartItem.tsx +141 -0
  78. package/src/components/Checkout.stories.tsx +380 -0
  79. package/src/components/Checkout.tsx +954 -0
  80. package/src/components/DiscountCodeInput.stories.tsx +76 -0
  81. package/src/components/DiscountCodeInput.tsx +162 -0
  82. package/src/components/OrderConfirmation.stories.tsx +142 -0
  83. package/src/components/OrderConfirmation.tsx +301 -0
  84. package/src/components/ProductCard.stories.tsx +112 -0
  85. package/src/components/ProductCard.tsx +195 -0
  86. package/src/components/ProductGrid.stories.tsx +137 -0
  87. package/src/components/ProductGrid.tsx +141 -0
  88. package/src/components/ShoppingCart.stories.tsx +459 -0
  89. package/src/components/ShoppingCart.tsx +262 -0
  90. package/src/components/ui/badge.tsx +37 -0
  91. package/src/components/ui/button.tsx +71 -0
  92. package/src/components/ui/card.tsx +79 -0
  93. package/src/components/ui/form-input.tsx +78 -0
  94. package/src/components/ui/form-select.tsx +73 -0
  95. package/src/components/ui/modal.tsx +181 -0
  96. package/src/contexts/CartContext.tsx +305 -0
  97. package/src/hooks/usePaystackPayment.ts +137 -0
  98. package/src/index.ts +51 -0
  99. package/src/lib/utils.ts +45 -0
  100. package/src/paystack.svg +67 -0
  101. package/src/providers/StorefrontProvider.tsx +70 -0
  102. package/src/styles.css +1 -0
  103. package/src/test-utils/MockCartProvider.tsx +424 -0
  104. package/src/vite-env.d.ts +12 -0
package/dist/index101.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import i from "./index108.mjs";
3
3
  import m from "./index109.mjs";
4
- import f from "./index62.mjs";
4
+ import f from "./index64.mjs";
5
5
  const h = (t, o, a = 3) => {
6
6
  let r = 0;
7
7
  const c = i(50, 250);
package/dist/index102.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import n from "./index88.mjs";
3
- import m from "./index62.mjs";
3
+ import m from "./index64.mjs";
4
4
  import c from "./index110.mjs";
5
5
  import h from "./index111.mjs";
6
6
  import w from "./index84.mjs";
7
- import b from "./index65.mjs";
8
- import C from "./index76.mjs";
7
+ import b from "./index67.mjs";
8
+ import C from "./index78.mjs";
9
9
  import g from "./index81.mjs";
10
10
  const E = (a) => {
11
11
  const e = b({}, a);
package/dist/index103.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import a from "./index68.mjs";
3
- import s from "./index73.mjs";
4
- import m from "./index62.mjs";
2
+ import a from "./index70.mjs";
3
+ import s from "./index75.mjs";
4
+ import m from "./index64.mjs";
5
5
  const h = (e, t) => {
6
6
  const { length: l } = e = e ? e.filter(Boolean) : [];
7
7
  if (t || l) {
package/dist/index105.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import a from "./index95.mjs";
2
+ import a from "./index93.mjs";
3
3
  const e = typeof URLSearchParams < "u" ? URLSearchParams : a;
4
4
  export {
5
5
  e as default
package/dist/index111.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import r from "./index62.mjs";
2
+ import r from "./index64.mjs";
3
3
  import c from "./index88.mjs";
4
4
  const p = c.hasStandardBrowserEnv ? (
5
5
  // Standard browser envs support document.cookie
package/dist/index20.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import "./index42.mjs";
3
- import r from "./index43.mjs";
2
+ import "./index41.mjs";
3
+ import r from "./index42.mjs";
4
4
  let e = null;
5
5
  function p(t) {
6
6
  return e = r.create({
package/dist/index21.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { hc as e } from "./index44.mjs";
2
+ import { hc as e } from "./index43.mjs";
3
3
  function n(s) {
4
4
  const r = `${s}/v1`;
5
5
  return {
package/dist/index28.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  'use client';
2
- import { useCreateOrder as s, useDeleteOrder as r, useGetOrder as u, useListOrders as o, useUpdateOrder as a, useUpdateOrderStatus as n } from "./index45.mjs";
3
- import { useCreateBrand as i, useDeleteBrand as p, useGetBrand as C, useListBrands as D, useUpdateBrand as c } from "./index46.mjs";
4
- import { useCreateProduct as G, useDeleteProduct as f, useGetProduct as m, useListProducts as v, useUpdateProduct as x } from "./index47.mjs";
5
- import { useCreateVariant as L, useDeleteVariant as S, useGetVariantInventory as U, useListProductVariants as O, useSearchVariants as V, useUpdateVariant as h } from "./index48.mjs";
6
- import { useCreateWarehouse as I, useDeleteWarehouse as P, useGetWarehouseInventory as A, useListWarehouses as W, useUpdateWarehouse as Z } from "./index49.mjs";
7
- import { useAdjustInventory as k, useGetInventoryTransactions as w, useGetLowStockVariants as T, useListInventory as j, useTransferInventory as E } from "./index50.mjs";
8
- import { useGetCustomerHistory as g } from "./index51.mjs";
9
- import { useGetStats as z } from "./index52.mjs";
10
- import { useCleanupExpiredCarts as J, useGetAbandonedCart as K, useGetAbandonedCartStats as M, useListAbandonedCarts as N } from "./index53.mjs";
11
- import { useBulkGenerateDiscountCodes as R, useCreateDiscountCode as X, useDeleteDiscountCode as Y, useGetDiscountCode as _, useGetDiscountCodeAnalytics as $, useGetDiscountCodeOverviewStats as ee, useListDiscountCodes as te, useUpdateDiscountCode as se } from "./index54.mjs";
12
- import { useCreateDeliveryZone as ue, useCreateState as oe, useDeleteDeliveryZone as ae, useDeleteState as ne, useListDeliveryZones as de, useListStates as ie, useUpdateDeliveryZone as pe, useUpdateState as Ce } from "./index55.mjs";
2
+ import { useCreateOrder as s, useDeleteOrder as r, useGetOrder as u, useListOrders as o, useUpdateOrder as a, useUpdateOrderStatus as n } from "./index44.mjs";
3
+ import { useCreateBrand as i, useDeleteBrand as p, useGetBrand as C, useListBrands as D, useUpdateBrand as c } from "./index45.mjs";
4
+ import { useCreateProduct as G, useDeleteProduct as f, useGetProduct as m, useListProducts as v, useUpdateProduct as x } from "./index46.mjs";
5
+ import { useCreateVariant as L, useDeleteVariant as S, useGetVariantInventory as U, useListProductVariants as O, useSearchVariants as V, useUpdateVariant as h } from "./index47.mjs";
6
+ import { useCreateWarehouse as I, useDeleteWarehouse as P, useGetWarehouseInventory as A, useListWarehouses as W, useUpdateWarehouse as Z } from "./index48.mjs";
7
+ import { useAdjustInventory as k, useGetInventoryTransactions as w, useGetLowStockVariants as T, useListInventory as j, useTransferInventory as E } from "./index49.mjs";
8
+ import { useGetCustomerHistory as g } from "./index50.mjs";
9
+ import { useGetStats as z } from "./index51.mjs";
10
+ import { useCleanupExpiredCarts as J, useGetAbandonedCart as K, useGetAbandonedCartStats as M, useListAbandonedCarts as N } from "./index52.mjs";
11
+ import { useBulkGenerateDiscountCodes as R, useCreateDiscountCode as X, useDeleteDiscountCode as Y, useGetDiscountCode as _, useGetDiscountCodeAnalytics as $, useGetDiscountCodeOverviewStats as ee, useListDiscountCodes as te, useUpdateDiscountCode as se } from "./index53.mjs";
12
+ import { useCreateDeliveryZone as ue, useCreateState as oe, useDeleteDeliveryZone as ae, useDeleteState as ne, useListDeliveryZones as de, useListStates as ie, useUpdateDeliveryZone as pe, useUpdateState as Ce } from "./index54.mjs";
13
13
  export {
14
14
  k as useAdjustInventory,
15
15
  R as useBulkGenerateDiscountCodes,
package/dist/index29.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as s, useMutation as i } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as o } from "./index61.mjs";
3
+ import { useQueryUnwrapped as o } from "./index59.mjs";
4
4
  import { queryKeys as r } from "./index26.mjs";
5
5
  import { updateCart as c, createCart as l, applyDiscount as y, removeDiscount as m, addCartItem as C, updateCartItem as p, removeCartItem as q, checkoutCart as d, fetchCart as f } from "./index23.mjs";
6
6
  function b(e, t) {
package/dist/index3.mjs CHANGED
@@ -1,131 +1,145 @@
1
1
  'use client';
2
- import { jsxs as L, jsx as O } from "react/jsx-runtime";
3
- import { createContext as z, useState as p, useRef as G, useEffect as l, useCallback as r, useContext as K } from "react";
2
+ import { jsxs as H, jsx as K } from "react/jsx-runtime";
3
+ import { createContext as Y, useState as d, useRef as h, useEffect as c, useCallback as r, useContext as q } from "react";
4
4
  import "./index18.mjs";
5
- import { useCreateCart as T, useGetCart as Y, useAddCartItem as q, useUpdateCartItem as B, useRemoveCartItem as H, useApplyDiscount as J, useRemoveDiscount as Q, useUpdateCart as V, useCheckoutCart as W } from "./index29.mjs";
5
+ import { useGetCart as B, useCreateCart as J, useAddCartItem as Q, useUpdateCartItem as V, useRemoveCartItem as W, useApplyDiscount as X, useRemoveDiscount as Z, useUpdateCart as $, useCheckoutCart as tt } from "./index29.mjs";
6
6
  import "@tanstack/react-query";
7
- import { ShoppingCart as X } from "./index8.mjs";
8
- const s = "oms_cart_id", C = z(null);
9
- function nt({ children: a, brandSlug: I, initialCartId: u, shoppingCartProps: y }) {
10
- const [t, i] = p(() => {
11
- if (u) return u;
12
- if (typeof window < "u") {
13
- const n = new URLSearchParams(window.location.search).get("cartId");
14
- return n || localStorage.getItem(s);
7
+ import { ShoppingCart as et } from "./index8.mjs";
8
+ const m = "oms_cart_id", y = Y(null);
9
+ function ut({ children: a, brandSlug: v, initialCartId: u, shoppingCartProps: S }) {
10
+ const [t, s] = d(u || null), [w, p] = d(!1), [D, g] = d(!1), i = h(!1), f = h(!1);
11
+ c(() => {
12
+ g(!0);
13
+ }, []), c(() => {
14
+ if (u || i.current) return;
15
+ const n = new URLSearchParams(window.location.search).get("cartId");
16
+ if (n) {
17
+ s(n);
18
+ return;
15
19
  }
16
- return null;
17
- }), [m, f] = p(!1), d = G(!1), h = T({
20
+ const C = localStorage.getItem(m);
21
+ C && s(C);
22
+ }, [u]);
23
+ const { data: E, isLoading: M, error: l, refetch: o } = B(t || "", {
24
+ enabled: !!t,
25
+ retry: !1
26
+ // Don't retry on failure - cart might be invalid/expired
27
+ }), A = J({
18
28
  onSuccess: (e) => {
19
29
  if ("error" in e) {
20
30
  console.error("Failed to create cart:", e.error);
21
31
  return;
22
32
  }
23
- i(e.id);
33
+ s(e.id);
24
34
  },
25
35
  onError: (e) => {
26
36
  console.error("Failed to create cart:", e);
27
37
  }
28
- }), { data: S, isLoading: v, error: c, refetch: o } = Y(t || "", {
29
- enabled: !!t,
30
- retry: !1
31
- // Don't retry on failure - cart might be invalid/expired
32
38
  });
33
- l(() => {
34
- !d.current && !t && !u && (d.current = !0, h.mutate(I));
35
- }, []), l(() => {
36
- c && t && (console.warn("Cart fetch failed, clearing invalid cart:", c), i(null), typeof window < "u" && localStorage.removeItem(s));
37
- }, [c, t]);
38
- const D = q(t || "", {
39
+ c(() => {
40
+ if (!i.current && !t && !u) {
41
+ i.current = !0;
42
+ const e = setTimeout(() => {
43
+ i.current && A.mutate(v);
44
+ }, 0);
45
+ return () => clearTimeout(e);
46
+ }
47
+ }, []), c(() => {
48
+ l && t && !f.current && (f.current = !0, console.warn("Cart fetch failed, clearing invalid cart:", l), Promise.resolve().then(() => {
49
+ s(null), typeof window < "u" && localStorage.removeItem(m), f.current = !1;
50
+ }));
51
+ }, [l, t]);
52
+ const x = Q(t || "", {
39
53
  onSuccess: () => o()
40
- }), g = B(t || "", {
54
+ }), P = V(t || "", {
41
55
  onSuccess: () => o()
42
- }), E = H(t || "", {
56
+ }), R = W(t || "", {
43
57
  onSuccess: () => o()
44
- }), A = J(t || "", {
58
+ }), N = X(t || "", {
45
59
  onSuccess: () => o()
46
- }), M = Q(t || "", {
60
+ }), U = Z(t || "", {
47
61
  onSuccess: () => o()
48
- }), x = V(t || "", {
62
+ }), _ = $(t || "", {
49
63
  onSuccess: () => o()
50
- }), P = W(t || "");
51
- l(() => {
52
- t && typeof window < "u" && localStorage.setItem(s, t);
64
+ }), b = tt(t || "");
65
+ c(() => {
66
+ t && typeof window < "u" && localStorage.setItem(m, t);
53
67
  }, [t]);
54
- const R = r(
68
+ const k = r(
55
69
  async (e, n) => {
56
70
  if (!t) throw new Error("No cart ID");
57
- await D.mutateAsync({ sku: e, quantity: n });
71
+ await x.mutateAsync({ sku: e, quantity: n });
58
72
  },
59
73
  // eslint-disable-next-line react-hooks/exhaustive-deps
60
74
  [t]
61
- ), N = r(
75
+ ), F = r(
62
76
  async (e, n) => {
63
77
  if (!t) throw new Error("No cart ID");
64
- await g.mutateAsync({ itemId: e, quantity: n });
78
+ await P.mutateAsync({ itemId: e, quantity: n });
65
79
  },
66
80
  // eslint-disable-next-line react-hooks/exhaustive-deps
67
81
  [t]
68
- ), U = r(
82
+ ), T = r(
69
83
  async (e) => {
70
84
  if (!t) throw new Error("No cart ID");
71
- await E.mutateAsync(e);
85
+ await R.mutateAsync(e);
72
86
  },
73
87
  // eslint-disable-next-line react-hooks/exhaustive-deps
74
88
  [t]
75
- ), _ = r(
89
+ ), j = r(
76
90
  async (e) => {
77
91
  if (!t) throw new Error("No cart ID");
78
- await A.mutateAsync({ code: e });
92
+ await N.mutateAsync({ code: e });
79
93
  },
80
94
  // eslint-disable-next-line react-hooks/exhaustive-deps
81
95
  [t]
82
- ), b = r(async () => {
96
+ ), L = r(async () => {
83
97
  if (!t) throw new Error("No cart ID");
84
- await M.mutateAsync();
85
- }, [t]), k = r(() => {
86
- i(null), typeof window < "u" && localStorage.removeItem(s);
87
- }, []), F = r(() => {
88
- f(!0);
89
- }, []), w = r(() => {
90
- f(!1);
91
- }, []), j = {
92
- cart: S || null,
98
+ await U.mutateAsync();
99
+ }, [t]), O = r(() => {
100
+ s(null), typeof window < "u" && localStorage.removeItem(m);
101
+ }, []), z = r(() => {
102
+ p(!0);
103
+ }, []), I = r(() => {
104
+ p(!1);
105
+ }, []), G = {
106
+ cart: E || null,
93
107
  cartId: t,
94
- isLoading: v,
95
- error: c,
96
- updateCartMutation: x,
97
- checkoutMutation: P,
98
- addItem: R,
99
- updateItem: N,
100
- removeItem: U,
101
- applyDiscount: _,
102
- removeDiscount: b,
103
- clearCart: k,
108
+ isLoading: M,
109
+ error: l,
110
+ updateCartMutation: _,
111
+ checkoutMutation: b,
112
+ addItem: k,
113
+ updateItem: F,
114
+ removeItem: T,
115
+ applyDiscount: j,
116
+ removeDiscount: L,
117
+ clearCart: O,
104
118
  refetch: o,
105
- isOpen: m,
106
- open: F,
107
- close: w
119
+ isOpen: w,
120
+ open: z,
121
+ close: I
108
122
  };
109
- return /* @__PURE__ */ L(C.Provider, { value: j, children: [
123
+ return /* @__PURE__ */ H(y.Provider, { value: G, children: [
110
124
  a,
111
- /* @__PURE__ */ O(
112
- X,
125
+ D && /* @__PURE__ */ K(
126
+ et,
113
127
  {
114
- isOpen: m,
115
- onClose: w,
116
- ...y
128
+ isOpen: w,
129
+ onClose: I,
130
+ ...S
117
131
  }
118
132
  )
119
133
  ] });
120
134
  }
121
- function at() {
122
- const a = K(C);
135
+ function it() {
136
+ const a = q(y);
123
137
  if (!a)
124
138
  throw new Error("useCart must be used within CartProvider");
125
139
  return a;
126
140
  }
127
141
  export {
128
- C as CartContext,
129
- nt as CartProvider,
130
- at as useCart
142
+ y as CartContext,
143
+ ut as CartProvider,
144
+ it as useCart
131
145
  };
package/dist/index30.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useMutation as t } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as u } from "./index61.mjs";
3
+ import { useQueryUnwrapped as u } from "./index59.mjs";
4
4
  import { queryKeys as n } from "./index26.mjs";
5
5
  import { confirmOrder as i, fetchOrder as m } from "./index24.mjs";
6
6
  function y(e, r, o) {
package/dist/index31.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as u } from "./index61.mjs";
2
+ import { useQueryUnwrapped as u } from "./index59.mjs";
3
3
  import { queryKeys as t } from "./index26.mjs";
4
4
  import { fetchProductsByBrand as o, fetchProductBySlug as c } from "./index22.mjs";
5
5
  function n(r, e) {
package/dist/index32.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as o } from "./index61.mjs";
2
+ import { useQueryUnwrapped as o } from "./index59.mjs";
3
3
  import { queryKeys as i } from "./index26.mjs";
4
4
  import { fetchDeliveryZones as t } from "./index25.mjs";
5
5
  function p(e, r) {
package/dist/index37.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import * as l from "react";
3
- import { composeRefs as m } from "./index41.mjs";
3
+ import { composeRefs as m } from "./index55.mjs";
4
4
  import { jsx as u } from "react/jsx-runtime";
5
5
  // @__NO_SIDE_EFFECTS__
6
6
  function y(e) {
package/dist/index41.mjs CHANGED
@@ -1,26 +1,39 @@
1
1
  'use client';
2
- import "react";
3
- function i(n, o) {
4
- if (typeof n == "function")
5
- return n(o);
6
- n != null && (n.current = o);
7
- }
8
- function f(...n) {
9
- return (o) => {
10
- let u = !1;
11
- const c = n.map((t) => {
12
- const e = i(t, o);
13
- return !u && typeof e == "function" && (u = !0), e;
14
- });
15
- if (u)
16
- return () => {
17
- for (let t = 0; t < c.length; t++) {
18
- const e = c[t];
19
- typeof e == "function" ? e() : i(n[t], null);
20
- }
21
- };
22
- };
23
- }
2
+ import o from "./index42.mjs";
3
+ const {
4
+ Axios: e,
5
+ AxiosError: a,
6
+ CanceledError: s,
7
+ isCancel: t,
8
+ CancelToken: i,
9
+ VERSION: l,
10
+ all: n,
11
+ Cancel: d,
12
+ isAxiosError: x,
13
+ spread: C,
14
+ toFormData: c,
15
+ AxiosHeaders: m,
16
+ HttpStatusCode: p,
17
+ formToJSON: A,
18
+ getAdapter: f,
19
+ mergeConfig: E
20
+ } = o;
24
21
  export {
25
- f as composeRefs
22
+ e as Axios,
23
+ a as AxiosError,
24
+ m as AxiosHeaders,
25
+ d as Cancel,
26
+ i as CancelToken,
27
+ s as CanceledError,
28
+ p as HttpStatusCode,
29
+ l as VERSION,
30
+ n as all,
31
+ o as default,
32
+ A as formToJSON,
33
+ f as getAdapter,
34
+ x as isAxiosError,
35
+ t as isCancel,
36
+ E as mergeConfig,
37
+ C as spread,
38
+ c as toFormData
26
39
  };
package/dist/index42.mjs CHANGED
@@ -1,39 +1,47 @@
1
1
  'use client';
2
- import o from "./index43.mjs";
3
- const {
4
- Axios: e,
5
- AxiosError: a,
6
- CanceledError: s,
7
- isCancel: t,
8
- CancelToken: i,
9
- VERSION: l,
10
- all: n,
11
- Cancel: d,
12
- isAxiosError: x,
13
- spread: C,
14
- toFormData: c,
15
- AxiosHeaders: m,
16
- HttpStatusCode: p,
17
- formToJSON: A,
18
- getAdapter: f,
19
- mergeConfig: E
20
- } = o;
2
+ import a from "./index64.mjs";
3
+ import p from "./index65.mjs";
4
+ import m from "./index66.mjs";
5
+ import i from "./index67.mjs";
6
+ import f from "./index68.mjs";
7
+ import l from "./index69.mjs";
8
+ import c from "./index70.mjs";
9
+ import d from "./index71.mjs";
10
+ import u from "./index72.mjs";
11
+ import { VERSION as x } from "./index73.mjs";
12
+ import C from "./index74.mjs";
13
+ import A from "./index75.mjs";
14
+ import E from "./index76.mjs";
15
+ import O from "./index77.mjs";
16
+ import S from "./index78.mjs";
17
+ import H from "./index79.mjs";
18
+ import T from "./index80.mjs";
19
+ function n(o) {
20
+ const t = new m(o), e = p(m.prototype.request, t);
21
+ return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
22
+ return n(i(o, s));
23
+ }, e;
24
+ }
25
+ const r = n(f);
26
+ r.Axios = m;
27
+ r.CanceledError = c;
28
+ r.CancelToken = d;
29
+ r.isCancel = u;
30
+ r.VERSION = x;
31
+ r.toFormData = C;
32
+ r.AxiosError = A;
33
+ r.Cancel = r.CanceledError;
34
+ r.all = function(t) {
35
+ return Promise.all(t);
36
+ };
37
+ r.spread = E;
38
+ r.isAxiosError = O;
39
+ r.mergeConfig = i;
40
+ r.AxiosHeaders = S;
41
+ r.formToJSON = (o) => l(a.isHTMLForm(o) ? new FormData(o) : o);
42
+ r.getAdapter = H.getAdapter;
43
+ r.HttpStatusCode = T;
44
+ r.default = r;
21
45
  export {
22
- e as Axios,
23
- a as AxiosError,
24
- m as AxiosHeaders,
25
- d as Cancel,
26
- i as CancelToken,
27
- s as CanceledError,
28
- p as HttpStatusCode,
29
- l as VERSION,
30
- n as all,
31
- o as default,
32
- A as formToJSON,
33
- f as getAdapter,
34
- x as isAxiosError,
35
- t as isCancel,
36
- E as mergeConfig,
37
- C as spread,
38
- c as toFormData
46
+ r as default
39
47
  };