@instockng/storefront-ui 1.0.14 → 1.0.15
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/CartItem.d.ts +1 -1
- package/dist/components/CartItem.d.ts.map +1 -1
- package/dist/contexts/CartContext.d.ts +2 -2
- package/dist/contexts/CartContext.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index105.mjs +1 -1
- package/dist/index29.mjs +1 -1
- package/dist/index30.mjs +1 -1
- package/dist/index31.mjs +1 -1
- package/dist/index32.mjs +1 -1
- package/dist/index44.mjs +1 -1
- package/dist/index45.mjs +1 -1
- package/dist/index46.mjs +1 -1
- package/dist/index47.mjs +1 -1
- package/dist/index48.mjs +1 -1
- package/dist/index49.mjs +1 -1
- package/dist/index50.mjs +1 -1
- package/dist/index51.mjs +1 -1
- package/dist/index52.mjs +1 -1
- package/dist/index53.mjs +1 -1
- package/dist/index54.mjs +1 -1
- package/dist/index58.mjs +2 -2
- package/dist/index59.mjs +3 -4
- package/dist/index60.mjs +2 -4
- package/dist/index61.mjs +5 -2
- package/dist/index81.mjs +1 -1
- package/dist/index83.mjs +1 -1
- package/dist/index84.mjs +2 -2
- package/dist/index88.mjs +2 -2
- package/dist/index93.mjs +30 -12
- package/dist/index94.mjs +11 -7
- package/dist/index95.mjs +3 -30
- package/dist/index96.mjs +3 -10
- package/dist/index97.mjs +13 -4
- package/dist/index98.mjs +7 -4
- package/dist/test-utils/MockCartProvider.d.ts +1 -1
- package/dist/test-utils/MockCartProvider.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/CartItem.stories.tsx +1 -1
- package/src/components/CartItem.tsx +1 -1
- package/src/components/Checkout.stories.tsx +1 -1
- package/src/components/Checkout.tsx +2 -2
- package/src/components/OrderConfirmation.tsx +1 -1
- package/src/components/ProductGrid.tsx +1 -1
- package/src/components/ShoppingCart.stories.tsx +1 -1
- package/src/contexts/CartContext.tsx +2 -2
- package/src/index.ts +3 -2
- package/src/providers/StorefrontProvider.tsx +1 -1
- package/src/test-utils/MockCartProvider.tsx +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Displays a single item in the shopping cart with quantity controls and remove button.
|
|
5
5
|
*/
|
|
6
|
-
import type { CartItem as CartItemType } from '@
|
|
6
|
+
import type { CartItem as CartItemType } from '@instockng/api-client';
|
|
7
7
|
export interface CartItemProps {
|
|
8
8
|
item: CartItemType;
|
|
9
9
|
/** Custom class name */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartItem.d.ts","sourceRoot":"","sources":["../../src/components/CartItem.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CartItem.d.ts","sourceRoot":"","sources":["../../src/components/CartItem.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAItE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,QAAgB,GACjB,EAAE,aAAa,2CAoHf"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Cart Context Provider
|
|
3
3
|
*
|
|
4
4
|
* Manages cart state with localStorage persistence and auto-creation.
|
|
5
|
-
* Uses @
|
|
5
|
+
* Uses @instockng/api-client hooks for all cart operations.
|
|
6
6
|
* Includes built-in ShoppingCart modal that can be opened/closed from anywhere.
|
|
7
7
|
*/
|
|
8
8
|
import { ReactNode } from 'react';
|
|
9
|
-
import { useUpdateCart, useCheckoutCart, type Cart } from '@
|
|
9
|
+
import { useUpdateCart, useCheckoutCart, type Cart } from '@instockng/api-client';
|
|
10
10
|
interface CartContextValue {
|
|
11
11
|
/** Current cart data */
|
|
12
12
|
cart: Cart | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartContext.d.ts","sourceRoot":"","sources":["../../src/contexts/CartContext.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAkD,SAAS,EAAuB,MAAM,OAAO,CAAC;AACvG,OAAO,EAGL,aAAa,EAMb,eAAe,EACf,KAAK,IAAI,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"CartContext.d.ts","sourceRoot":"","sources":["../../src/contexts/CartContext.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAkD,SAAS,EAAuB,MAAM,OAAO,CAAC;AACvG,OAAO,EAGL,aAAa,EAMb,eAAe,EACf,KAAK,IAAI,EACV,MAAM,uBAAuB,CAAC;AAK/B,UAAU,gBAAgB;IACxB,wBAAwB;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,mDAAmD;IACnD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,oBAAoB;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,gDAAgD;IAChD,kBAAkB,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IACrD,+CAA+C;IAC/C,gBAAgB,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IACrD,8BAA8B;IAC9B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,2BAA2B;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,4BAA4B;IAC5B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,0BAA0B;IAC1B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,2BAA2B;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,kDAAkD;IAClD,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,wBAAwB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,kDAA+C,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,4BAA4B,EAAE,iBAAiB,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC;CACxG;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,2CAoPxG;AAED;;GAEG;AACH,wBAAgB,OAAO,qBAMtB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,5 +30,5 @@ export type { FormInputProps } from './components/ui/form-input';
|
|
|
30
30
|
export { FormSelect } from './components/ui/form-select';
|
|
31
31
|
export type { FormSelectProps } from './components/ui/form-select';
|
|
32
32
|
export { cn, formatCurrency, formatDate, formatDateTime, getStatusColor } from './lib/utils';
|
|
33
|
-
export * from '@
|
|
33
|
+
export * from '@instockng/api-client';
|
|
34
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAG9E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAG9E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7F,cAAc,uBAAuB,CAAC"}
|
package/dist/index105.mjs
CHANGED
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 "./
|
|
3
|
+
import { useQueryUnwrapped as o } from "./index61.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/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 "./
|
|
3
|
+
import { useQueryUnwrapped as u } from "./index61.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 "./
|
|
2
|
+
import { useQueryUnwrapped as u } from "./index61.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
package/dist/index44.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as y, useMutation as m } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as p } from "./
|
|
3
|
+
import { useQueryUnwrapped as p } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as d, authHeaders as c } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as i } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as l } from "./index19.mjs";
|
package/dist/index45.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as y, useMutation as m } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as b } from "./
|
|
3
|
+
import { useQueryUnwrapped as b } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as o } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as d } from "./index19.mjs";
|
package/dist/index46.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as p, useMutation as y } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as m } from "./
|
|
3
|
+
import { useQueryUnwrapped as m } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as a, authHeaders as c } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as i } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as d } from "./index19.mjs";
|
package/dist/index47.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as y, useMutation as v } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as m } from "./
|
|
3
|
+
import { useQueryUnwrapped as m } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as i } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as d } from "./index19.mjs";
|
package/dist/index48.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as w, useMutation as y } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as d } from "./
|
|
3
|
+
import { useQueryUnwrapped as d } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as i, authHeaders as c } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as u } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as l } from "./index19.mjs";
|
package/dist/index49.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as d, useMutation as v } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as l } from "./
|
|
3
|
+
import { useQueryUnwrapped as l } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as s } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as y } from "./index19.mjs";
|
package/dist/index50.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQueryUnwrapped as i } from "./
|
|
2
|
+
import { useQueryUnwrapped as i } from "./index61.mjs";
|
|
3
3
|
import { createAdminRpcClients as n, authHeaders as u } from "./index21.mjs";
|
|
4
4
|
import { queryKeys as m } from "./index26.mjs";
|
|
5
5
|
import { useApiConfig as a } from "./index19.mjs";
|
package/dist/index51.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQueryUnwrapped as s } from "./
|
|
2
|
+
import { useQueryUnwrapped as s } from "./index61.mjs";
|
|
3
3
|
import { createAdminRpcClients as i, authHeaders as u } from "./index21.mjs";
|
|
4
4
|
import { queryKeys as c } from "./index26.mjs";
|
|
5
5
|
import { useApiConfig as d } from "./index19.mjs";
|
package/dist/index52.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as l, useMutation as y } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as c } from "./
|
|
3
|
+
import { useQueryUnwrapped as c } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as s, authHeaders as o } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as i } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as u } from "./index19.mjs";
|
package/dist/index53.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as l, useMutation as y } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as C } from "./
|
|
3
|
+
import { useQueryUnwrapped as C } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as c, authHeaders as a } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as r } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as d } from "./index19.mjs";
|
package/dist/index54.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as y, useMutation as v } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as m } from "./
|
|
3
|
+
import { useQueryUnwrapped as m } from "./index61.mjs";
|
|
4
4
|
import { createAdminRpcClients as u, authHeaders as l } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as o } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as c } from "./index19.mjs";
|
package/dist/index58.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getDefaultExportFromCjs as d } from "./
|
|
3
|
-
import { __module as v } from "./
|
|
2
|
+
import { getDefaultExportFromCjs as d } from "./index59.mjs";
|
|
3
|
+
import { __module as v } from "./index60.mjs";
|
|
4
4
|
v.exports = function(n) {
|
|
5
5
|
return g(m(n), n);
|
|
6
6
|
};
|
package/dist/index59.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return e(r);
|
|
2
|
+
function e(t) {
|
|
3
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
5
4
|
}
|
|
6
5
|
export {
|
|
7
|
-
|
|
6
|
+
e as getDefaultExportFromCjs
|
|
8
7
|
};
|
package/dist/index60.mjs
CHANGED
package/dist/index61.mjs
CHANGED
package/dist/index81.mjs
CHANGED
package/dist/index83.mjs
CHANGED
package/dist/index84.mjs
CHANGED
package/dist/index88.mjs
CHANGED
package/dist/index93.mjs
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
});
|
|
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("&");
|
|
13
31
|
};
|
|
14
32
|
export {
|
|
15
|
-
|
|
33
|
+
a as default
|
|
16
34
|
};
|
package/dist/index94.mjs
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
11
|
+
}
|
|
4
12
|
export {
|
|
5
|
-
|
|
6
|
-
n as hasStandardBrowserEnv,
|
|
7
|
-
t as hasStandardBrowserWebWorkerEnv,
|
|
8
|
-
o as navigator,
|
|
9
|
-
r as origin
|
|
13
|
+
h as default
|
|
10
14
|
};
|
package/dist/index95.mjs
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
function e(t) {
|
|
3
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
16
4
|
}
|
|
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
5
|
export {
|
|
33
|
-
|
|
6
|
+
e as default
|
|
34
7
|
};
|
package/dist/index96.mjs
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
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 n(e, c) {
|
|
3
|
+
return c ? e.replace(/\/?\/$/, "") + "/" + c.replace(/^\/+/, "") : e;
|
|
11
4
|
}
|
|
12
5
|
export {
|
|
13
|
-
|
|
6
|
+
n as default
|
|
14
7
|
};
|
package/dist/index97.mjs
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
};
|
|
5
14
|
export {
|
|
6
|
-
|
|
15
|
+
l as default
|
|
7
16
|
};
|
package/dist/index98.mjs
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
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";
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
e as hasBrowserEnv,
|
|
6
|
+
n as hasStandardBrowserEnv,
|
|
7
|
+
t as hasStandardBrowserWebWorkerEnv,
|
|
8
|
+
o as navigator,
|
|
9
|
+
r as origin
|
|
7
10
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides fake cart data for UI prototyping without needing a real backend.
|
|
5
5
|
*/
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
|
-
import type { Cart } from '@
|
|
7
|
+
import type { Cart } from '@instockng/api-client';
|
|
8
8
|
import type { ShoppingCartProps } from '../components/ShoppingCart';
|
|
9
9
|
interface MockCartProviderProps {
|
|
10
10
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockCartProvider.d.ts","sourceRoot":"","sources":["../../src/test-utils/MockCartProvider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,IAAI,EAAuB,MAAM,
|
|
1
|
+
{"version":3,"file":"MockCartProvider.d.ts","sourceRoot":"","sources":["../../src/test-utils/MockCartProvider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,IAAI,EAAuB,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAiHpE,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC;IAClE,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,IAAI,EAAE,YAAY,EAClB,SAAiB,EACjB,KAAY,EACZ,iBAAiB,EACjB,UAAiB,GAClB,EAAE,qBAAqB,2CAkSvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instockng/storefront-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
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",
|
|
@@ -34,10 +34,12 @@
|
|
|
34
34
|
"author": "Ola Wale",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@instockng/api-client": "^1.0.0",
|
|
37
38
|
"class-variance-authority": "^0.7.1",
|
|
38
39
|
"clsx": "^2.1.0",
|
|
39
40
|
"tailwind-merge": "^2.2.0",
|
|
40
|
-
"yup": "^1.7.1"
|
|
41
|
+
"yup": "^1.7.1",
|
|
42
|
+
"@oms/shared": "1.0.0"
|
|
41
43
|
},
|
|
42
44
|
"peerDependencies": {
|
|
43
45
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -65,9 +67,7 @@
|
|
|
65
67
|
"storybook": "^9.1.12",
|
|
66
68
|
"tailwindcss": "^4.1.14",
|
|
67
69
|
"typescript": "^5.3.3",
|
|
68
|
-
"vite": "^5.4.20"
|
|
69
|
-
"@oms/api-client": "1.0.0",
|
|
70
|
-
"@oms/shared": "1.0.0"
|
|
70
|
+
"vite": "^5.4.20"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"type-check": "tsc --noEmit",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import { CartItem } from './CartItem';
|
|
3
|
-
import type {CartItem as CartItemType} from '@
|
|
3
|
+
import type {CartItem as CartItemType} from '@instockng/api-client';
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'Components/CartItem',
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { Trash2, Package } from 'lucide-react';
|
|
8
8
|
import { formatCurrency, cn } from '../lib/utils';
|
|
9
|
-
import type { CartItem as CartItemType } from '@
|
|
9
|
+
import type { CartItem as CartItemType } from '@instockng/api-client';
|
|
10
10
|
import { useCart } from '@/contexts/CartContext';
|
|
11
11
|
import { useCallback, useState } from 'react';
|
|
12
12
|
|
|
@@ -11,7 +11,7 @@ import { Checkout, type CheckoutProps } from './Checkout';
|
|
|
11
11
|
import { Button } from './ui/button';
|
|
12
12
|
import { MockCartProvider } from '../test-utils/MockCartProvider';
|
|
13
13
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
14
|
-
import type { Cart } from '@
|
|
14
|
+
import type { Cart } from '@instockng/api-client';
|
|
15
15
|
|
|
16
16
|
// Mock delivery zones data
|
|
17
17
|
const mockDeliveryZones = [
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
11
11
|
import * as Yup from 'yup';
|
|
12
|
-
import { useGetDeliveryZones } from '@
|
|
13
|
-
import type { Order } from '@
|
|
12
|
+
import { useGetDeliveryZones } from '@instockng/api-client';
|
|
13
|
+
import type { Order } from '@instockng/api-client';
|
|
14
14
|
import { useCart } from '../contexts/CartContext';
|
|
15
15
|
import { Modal } from './ui/modal';
|
|
16
16
|
import { FormInput } from './ui/form-input';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { useState } from 'react';
|
|
9
|
-
import { useGetOrder, useConfirmOrder } from '@
|
|
9
|
+
import { useGetOrder, useConfirmOrder } from '@instockng/api-client';
|
|
10
10
|
import { WHATSAPP_HELP_LINK, WHATSAPP_HELP_NUMBER_FORMATTED } from '@oms/shared';
|
|
11
11
|
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
|
|
12
12
|
import { Button } from './ui/button';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Handles loading, empty states, and integrates with useGetProducts hook.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { useGetProducts } from '@
|
|
8
|
+
import { useGetProducts } from '@instockng/api-client';
|
|
9
9
|
import { ProductCard, type ProductCardProduct } from './ProductCard';
|
|
10
10
|
import { Loader2, Package } from 'lucide-react';
|
|
11
11
|
import { cn } from '../lib/utils';
|
|
@@ -10,7 +10,7 @@ import { MockCartProvider } from '../test-utils/MockCartProvider';
|
|
|
10
10
|
import { fn } from '@storybook/test';
|
|
11
11
|
import { Button } from './ui/button';
|
|
12
12
|
import { ShoppingCart as ShoppingCartIcon } from 'lucide-react';
|
|
13
|
-
import type { Cart } from '@
|
|
13
|
+
import type { Cart } from '@instockng/api-client';
|
|
14
14
|
|
|
15
15
|
// Demo component showing how to use the cart context
|
|
16
16
|
const CartDemo = ({ title, description }: { title?: string; description?: string }) => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Cart Context Provider
|
|
5
5
|
*
|
|
6
6
|
* Manages cart state with localStorage persistence and auto-creation.
|
|
7
|
-
* Uses @
|
|
7
|
+
* Uses @instockng/api-client hooks for all cart operations.
|
|
8
8
|
* Includes built-in ShoppingCart modal that can be opened/closed from anywhere.
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
useRemoveDiscount,
|
|
21
21
|
useCheckoutCart,
|
|
22
22
|
type Cart,
|
|
23
|
-
} from '@
|
|
23
|
+
} from '@instockng/api-client';
|
|
24
24
|
import { ShoppingCart } from '../components/ShoppingCart';
|
|
25
25
|
|
|
26
26
|
const CART_ID_KEY = 'oms_cart_id';
|
package/src/index.ts
CHANGED
|
@@ -47,5 +47,6 @@ export type { FormSelectProps } from './components/ui/form-select';
|
|
|
47
47
|
// Export utilities
|
|
48
48
|
export { cn, formatCurrency, formatDate, formatDateTime, getStatusColor } from './lib/utils';
|
|
49
49
|
|
|
50
|
-
// Re-export API client hooks for convenience
|
|
51
|
-
|
|
50
|
+
// Re-export API client hooks and fetchers for convenience
|
|
51
|
+
// This includes all hooks (useGetProducts, useGetCart, etc.) and fetchers (fetchProductsByBrand, fetchCartById, etc.)
|
|
52
|
+
export * from '@instockng/api-client';
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import { ReactNode } from 'react';
|
|
29
|
-
import { ApiClientProvider } from '@
|
|
29
|
+
import { ApiClientProvider } from '@instockng/api-client';
|
|
30
30
|
import { CartProvider, CartProviderProps } from '../contexts/CartContext';
|
|
31
31
|
|
|
32
32
|
export interface StorefrontProviderProps {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { ReactNode, useState, useCallback } from 'react';
|
|
8
8
|
import { CartContext } from '../contexts/CartContext';
|
|
9
9
|
import { ShoppingCart } from '../components/ShoppingCart';
|
|
10
|
-
import type { Cart, PublicOrderResponse } from '@
|
|
10
|
+
import type { Cart, PublicOrderResponse } from '@instockng/api-client';
|
|
11
11
|
import type { ShoppingCartProps } from '../components/ShoppingCart';
|
|
12
12
|
|
|
13
13
|
// Use the proper type from the API client
|