@fayz-ai/storefront 0.64.0 → 0.65.0

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.
@@ -0,0 +1,30 @@
1
+ /**
2
+ * What the store can honestly say about free delivery to THIS buyer.
3
+ *
4
+ * Free-above is a property of the region (shop zones), so before an address
5
+ * resolves there is no number to promise: a banner reading «grátis acima de
6
+ * R$ 150» was false for an address in a region that frees at R$ 250.
7
+ *
8
+ * - `unknown` no address quoted yet;
9
+ * - `none` the address's region has no free-delivery rule;
10
+ * - `missing` it does, and the cart is `remaining` short of `freeAbove`;
11
+ * - `free` the cart already reaches it.
12
+ */
13
+ export type DeliveryFreeShipping = {
14
+ state: 'unknown';
15
+ } | {
16
+ state: 'none';
17
+ } | {
18
+ state: 'missing';
19
+ freeAbove: number;
20
+ remaining: number;
21
+ } | {
22
+ state: 'free';
23
+ freeAbove: number;
24
+ };
25
+ export declare function freeShippingFor(options: Array<{
26
+ zoneId: string;
27
+ freeAbove?: number | null;
28
+ }>, selectedZoneId: string | null, status: string, subtotal: number): DeliveryFreeShipping;
29
+ export declare function useDeliveryFreeShipping(): DeliveryFreeShipping;
30
+ //# sourceMappingURL=free-shipping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"free-shipping.d.ts","sourceRoot":"","sources":["../../src/lib/free-shipping.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GACpB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAExC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,EAC7D,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,oBAAoB,CAOtB;AAED,wBAAgB,uBAAuB,IAAI,oBAAoB,CAM9D"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "fayz": {
4
4
  "status": "beta"
5
5
  },
6
- "version": "0.64.0",
6
+ "version": "0.65.0",
7
7
  "description": "Fayz SDK storefront kit — Shopify-style customer-facing ecommerce template components",
8
8
  "type": "module",
9
9
  "sideEffects": false,
@@ -40,11 +40,11 @@
40
40
  "dist"
41
41
  ],
42
42
  "dependencies": {
43
+ "@fayz-ai/auth": "^0.63.0",
43
44
  "@fayz-ai/core": "^0.63.0",
44
45
  "@fayz-ai/sdk": "^0.61.0",
45
46
  "@fayz-ai/shop": "^0.63.0",
46
- "@fayz-ai/ui": "^0.63.0",
47
- "@fayz-ai/auth": "^0.63.0"
47
+ "@fayz-ai/ui": "^0.63.0"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@supabase/supabase-js": "^2.45.0",