@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.
Files changed (94) hide show
  1. package/dist/auth.d.ts +12 -2
  2. package/dist/auth.d.ts.map +1 -1
  3. package/dist/blocks.d.ts +3 -3
  4. package/dist/blocks.d.ts.map +1 -1
  5. package/dist/component-contracts.d.ts +124 -0
  6. package/dist/component-contracts.d.ts.map +1 -0
  7. package/dist/component-selectors.d.ts +61 -0
  8. package/dist/component-selectors.d.ts.map +1 -0
  9. package/dist/components/CartDrawer.d.ts.map +1 -1
  10. package/dist/components/ProductCard.d.ts +2 -5
  11. package/dist/components/ProductCard.d.ts.map +1 -1
  12. package/dist/components/ProductEnquiryForm.d.ts +8 -0
  13. package/dist/components/ProductEnquiryForm.d.ts.map +1 -0
  14. package/dist/components/ProductGrid.d.ts.map +1 -1
  15. package/dist/components/RelatedProducts.d.ts +1 -1
  16. package/dist/components/RelatedProducts.d.ts.map +1 -1
  17. package/dist/components/SmoothImage.d.ts +7 -0
  18. package/dist/components/SmoothImage.d.ts.map +1 -0
  19. package/dist/components/StorefrontFooter.d.ts.map +1 -1
  20. package/dist/components/StorefrontHeader.d.ts.map +1 -1
  21. package/dist/components/sections/CategoryShowcase.d.ts.map +1 -1
  22. package/dist/components/sections/HeroSection.d.ts.map +1 -1
  23. package/dist/components/sections/MediaCarousel.d.ts +11 -0
  24. package/dist/components/sections/MediaCarousel.d.ts.map +1 -0
  25. package/dist/components/sections/MiscSections.d.ts.map +1 -1
  26. package/dist/components/sections/ProductRail.d.ts.map +1 -1
  27. package/dist/components/sections/ProductSlider.d.ts +15 -0
  28. package/dist/components/sections/ProductSlider.d.ts.map +1 -0
  29. package/dist/config.d.ts +38 -21
  30. package/dist/config.d.ts.map +1 -1
  31. package/dist/createStorefrontApp.d.ts +12 -0
  32. package/dist/createStorefrontApp.d.ts.map +1 -1
  33. package/dist/define.d.ts +17 -0
  34. package/dist/define.d.ts.map +1 -0
  35. package/dist/hooks/index.d.ts +1 -0
  36. package/dist/hooks/index.d.ts.map +1 -1
  37. package/dist/hooks/useStorefront.d.ts +35 -0
  38. package/dist/hooks/useStorefront.d.ts.map +1 -0
  39. package/dist/index.cjs +904 -185
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.ts +20 -10
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +797 -95
  44. package/dist/index.js.map +1 -1
  45. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  46. package/dist/pages/HomePage.d.ts +5 -2
  47. package/dist/pages/HomePage.d.ts.map +1 -1
  48. package/dist/pages/MyPurchasesPage.d.ts.map +1 -1
  49. package/dist/pages/OrderConfirmationPage.d.ts.map +1 -1
  50. package/dist/pages/ProductDetailPage.d.ts.map +1 -1
  51. package/dist/sections.d.ts +45 -2
  52. package/dist/sections.d.ts.map +1 -1
  53. package/dist/testids.d.ts +20 -0
  54. package/dist/testids.d.ts.map +1 -1
  55. package/dist/theme.d.ts +4 -0
  56. package/dist/theme.d.ts.map +1 -1
  57. package/package.json +7 -9
  58. package/src/auth.ts +47 -10
  59. package/src/blocks.tsx +7 -3
  60. package/src/component-contracts.ts +140 -0
  61. package/src/component-selectors.ts +31 -0
  62. package/src/components/CartDrawer.tsx +2 -1
  63. package/src/components/ProductCard.tsx +39 -23
  64. package/src/components/ProductEnquiryForm.tsx +175 -0
  65. package/src/components/ProductGrid.tsx +12 -3
  66. package/src/components/RelatedProducts.tsx +13 -4
  67. package/src/components/SmoothImage.tsx +59 -0
  68. package/src/components/StorefrontFooter.tsx +24 -14
  69. package/src/components/StorefrontHeader.tsx +43 -38
  70. package/src/components/sections/CategoryShowcase.tsx +3 -2
  71. package/src/components/sections/HeroSection.tsx +18 -2
  72. package/src/components/sections/MediaCarousel.tsx +141 -0
  73. package/src/components/sections/MiscSections.tsx +2 -1
  74. package/src/components/sections/ProductRail.tsx +11 -3
  75. package/src/components/sections/ProductSlider.tsx +119 -0
  76. package/src/config.ts +65 -24
  77. package/src/createStorefrontApp.tsx +62 -9
  78. package/src/define.ts +34 -0
  79. package/src/hooks/index.ts +1 -0
  80. package/src/hooks/useStorefront.ts +58 -0
  81. package/src/index.ts +61 -11
  82. package/src/pages/CheckoutPage.tsx +2 -1
  83. package/src/pages/HomePage.tsx +6 -2
  84. package/src/pages/MyPurchasesPage.tsx +2 -1
  85. package/src/pages/OrderConfirmationPage.tsx +2 -1
  86. package/src/pages/ProductDetailPage.tsx +138 -62
  87. package/src/scaffold.tsx +1 -1
  88. package/src/sections.ts +49 -2
  89. package/src/testids.ts +20 -0
  90. package/src/theme.ts +4 -0
  91. package/src/workflows/checkout.ts +1 -1
  92. package/dist/slot-contracts.d.ts +0 -34
  93. package/dist/slot-contracts.d.ts.map +0 -1
  94. 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 parity in mock) re-reads
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,
@@ -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"}
@@ -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