@fayz-ai/storefront 0.6.0 → 0.7.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.
- package/dist/auth.d.ts +12 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/blocks.d.ts +3 -3
- package/dist/blocks.d.ts.map +1 -1
- package/dist/component-contracts.d.ts +124 -0
- package/dist/component-contracts.d.ts.map +1 -0
- package/dist/component-selectors.d.ts +61 -0
- package/dist/component-selectors.d.ts.map +1 -0
- package/dist/components/CartDrawer.d.ts.map +1 -1
- package/dist/components/ProductCard.d.ts +2 -5
- package/dist/components/ProductCard.d.ts.map +1 -1
- package/dist/components/ProductEnquiryForm.d.ts +8 -0
- package/dist/components/ProductEnquiryForm.d.ts.map +1 -0
- package/dist/components/ProductGrid.d.ts.map +1 -1
- package/dist/components/RelatedProducts.d.ts +1 -1
- package/dist/components/RelatedProducts.d.ts.map +1 -1
- package/dist/components/SmoothImage.d.ts +7 -0
- package/dist/components/SmoothImage.d.ts.map +1 -0
- package/dist/components/StorefrontFooter.d.ts.map +1 -1
- package/dist/components/StorefrontHeader.d.ts.map +1 -1
- package/dist/components/sections/CategoryShowcase.d.ts.map +1 -1
- package/dist/components/sections/HeroSection.d.ts.map +1 -1
- package/dist/components/sections/MediaCarousel.d.ts +11 -0
- package/dist/components/sections/MediaCarousel.d.ts.map +1 -0
- package/dist/components/sections/MiscSections.d.ts.map +1 -1
- package/dist/components/sections/ProductRail.d.ts.map +1 -1
- package/dist/components/sections/ProductSlider.d.ts +15 -0
- package/dist/components/sections/ProductSlider.d.ts.map +1 -0
- package/dist/config.d.ts +38 -21
- package/dist/config.d.ts.map +1 -1
- package/dist/createStorefrontApp.d.ts +12 -0
- package/dist/createStorefrontApp.d.ts.map +1 -1
- package/dist/define.d.ts +17 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useStorefront.d.ts +35 -0
- package/dist/hooks/useStorefront.d.ts.map +1 -0
- package/dist/index.cjs +904 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +20 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +797 -95
- package/dist/index.js.map +1 -1
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/HomePage.d.ts +5 -2
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/MyPurchasesPage.d.ts.map +1 -1
- package/dist/pages/OrderConfirmationPage.d.ts.map +1 -1
- package/dist/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/sections.d.ts +45 -2
- package/dist/sections.d.ts.map +1 -1
- package/dist/testids.d.ts +20 -0
- package/dist/testids.d.ts.map +1 -1
- package/dist/theme.d.ts +4 -0
- package/dist/theme.d.ts.map +1 -1
- package/package.json +7 -9
- package/src/auth.ts +47 -10
- package/src/blocks.tsx +7 -3
- package/src/component-contracts.ts +140 -0
- package/src/component-selectors.ts +31 -0
- package/src/components/CartDrawer.tsx +2 -1
- package/src/components/ProductCard.tsx +39 -23
- package/src/components/ProductEnquiryForm.tsx +175 -0
- package/src/components/ProductGrid.tsx +12 -3
- package/src/components/RelatedProducts.tsx +13 -4
- package/src/components/SmoothImage.tsx +59 -0
- package/src/components/StorefrontFooter.tsx +24 -14
- package/src/components/StorefrontHeader.tsx +43 -38
- package/src/components/sections/CategoryShowcase.tsx +3 -2
- package/src/components/sections/HeroSection.tsx +18 -2
- package/src/components/sections/MediaCarousel.tsx +141 -0
- package/src/components/sections/MiscSections.tsx +2 -1
- package/src/components/sections/ProductRail.tsx +11 -3
- package/src/components/sections/ProductSlider.tsx +119 -0
- package/src/config.ts +65 -24
- package/src/createStorefrontApp.tsx +62 -9
- package/src/define.ts +34 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useStorefront.ts +58 -0
- package/src/index.ts +61 -11
- package/src/pages/CheckoutPage.tsx +2 -1
- package/src/pages/HomePage.tsx +6 -2
- package/src/pages/MyPurchasesPage.tsx +2 -1
- package/src/pages/OrderConfirmationPage.tsx +2 -1
- package/src/pages/ProductDetailPage.tsx +138 -62
- package/src/scaffold.tsx +1 -1
- package/src/sections.ts +49 -2
- package/src/testids.ts +20 -0
- package/src/theme.ts +4 -0
- package/src/workflows/checkout.ts +1 -1
- package/dist/slot-contracts.d.ts +0 -34
- package/dist/slot-contracts.d.ts.map +0 -1
- package/src/slot-contracts.ts +0 -20
package/src/theme.ts
CHANGED
|
@@ -56,6 +56,10 @@ export interface StorefrontTheme {
|
|
|
56
56
|
variant?: HeaderVariant
|
|
57
57
|
/** Uppercase nav links (premium retail tone) */
|
|
58
58
|
uppercaseNav?: boolean
|
|
59
|
+
/** Show category shortcuts after primary nav links. Default true. */
|
|
60
|
+
showCategories?: boolean
|
|
61
|
+
/** Show the storefront search input in the header. Default true. */
|
|
62
|
+
showSearch?: boolean
|
|
59
63
|
}
|
|
60
64
|
productCard?: {
|
|
61
65
|
style?: CardStyle
|
|
@@ -67,7 +67,7 @@ export async function placeStorefrontOrder({
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Trusted placement: send only product ids + quantities. The provider
|
|
70
|
-
// (shop_place_order RPC on Supabase, in-memory
|
|
70
|
+
// (shop_place_order RPC on Supabase, in-memory provider in mock) re-reads
|
|
71
71
|
// prices, validates the discount, and decrements inventory server-side.
|
|
72
72
|
const order = await provider.placeOrder({
|
|
73
73
|
customerId: customerId ?? undefined,
|
package/dist/slot-contracts.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stable selectors that custom storefront slots must preserve.
|
|
3
|
-
*
|
|
4
|
-
* Apps can fully customize the visual tree, but catalog/product-rail slots still
|
|
5
|
-
* need these anchors so checkout smoke tests, QA, and agents can operate stores.
|
|
6
|
-
*/
|
|
7
|
-
export declare const productCardSlotContract: {
|
|
8
|
-
readonly root: {
|
|
9
|
-
readonly 'data-testid': "product-card";
|
|
10
|
-
};
|
|
11
|
-
readonly name: {
|
|
12
|
-
readonly 'data-testid': "product-card-name";
|
|
13
|
-
};
|
|
14
|
-
readonly priceTestId: "product-card-price";
|
|
15
|
-
readonly addButton: {
|
|
16
|
-
readonly 'data-testid': "product-card-add";
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare const storefrontSlotContracts: {
|
|
20
|
-
readonly productCard: {
|
|
21
|
-
readonly root: {
|
|
22
|
-
readonly 'data-testid': "product-card";
|
|
23
|
-
};
|
|
24
|
-
readonly name: {
|
|
25
|
-
readonly 'data-testid': "product-card-name";
|
|
26
|
-
};
|
|
27
|
-
readonly priceTestId: "product-card-price";
|
|
28
|
-
readonly addButton: {
|
|
29
|
-
readonly 'data-testid': "product-card-add";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export type ProductCardSlotContract = typeof productCardSlotContract;
|
|
34
|
-
//# sourceMappingURL=slot-contracts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slot-contracts.d.ts","sourceRoot":"","sources":["../src/slot-contracts.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;CAK1B,CAAA;AAEV,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAE1B,CAAA;AAEV,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA"}
|
package/src/slot-contracts.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TID } from './testids'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Stable selectors that custom storefront slots must preserve.
|
|
5
|
-
*
|
|
6
|
-
* Apps can fully customize the visual tree, but catalog/product-rail slots still
|
|
7
|
-
* need these anchors so checkout smoke tests, QA, and agents can operate stores.
|
|
8
|
-
*/
|
|
9
|
-
export const productCardSlotContract = {
|
|
10
|
-
root: { 'data-testid': TID.productCard },
|
|
11
|
-
name: { 'data-testid': TID.productCardName },
|
|
12
|
-
priceTestId: TID.productCardPrice,
|
|
13
|
-
addButton: { 'data-testid': TID.productCardAdd },
|
|
14
|
-
} as const
|
|
15
|
-
|
|
16
|
-
export const storefrontSlotContracts = {
|
|
17
|
-
productCard: productCardSlotContract,
|
|
18
|
-
} as const
|
|
19
|
-
|
|
20
|
-
export type ProductCardSlotContract = typeof productCardSlotContract
|