@fayz-ai/storefront 0.6.0 → 0.8.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 (102) hide show
  1. package/README.md +3 -1
  2. package/dist/auth.d.ts +12 -2
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/blocks.d.ts +3 -3
  5. package/dist/blocks.d.ts.map +1 -1
  6. package/dist/component-contracts.d.ts +124 -0
  7. package/dist/component-contracts.d.ts.map +1 -0
  8. package/dist/component-selectors.d.ts +61 -0
  9. package/dist/component-selectors.d.ts.map +1 -0
  10. package/dist/components/CartDrawer.d.ts.map +1 -1
  11. package/dist/components/ProductCard.d.ts +2 -5
  12. package/dist/components/ProductCard.d.ts.map +1 -1
  13. package/dist/components/ProductEnquiryForm.d.ts +8 -0
  14. package/dist/components/ProductEnquiryForm.d.ts.map +1 -0
  15. package/dist/components/ProductGrid.d.ts.map +1 -1
  16. package/dist/components/RelatedProducts.d.ts +1 -1
  17. package/dist/components/RelatedProducts.d.ts.map +1 -1
  18. package/dist/components/SmoothImage.d.ts +7 -0
  19. package/dist/components/SmoothImage.d.ts.map +1 -0
  20. package/dist/components/StorefrontFooter.d.ts.map +1 -1
  21. package/dist/components/StorefrontHeader.d.ts.map +1 -1
  22. package/dist/components/sections/CategoryShowcase.d.ts.map +1 -1
  23. package/dist/components/sections/HeroSection.d.ts.map +1 -1
  24. package/dist/components/sections/MediaCarousel.d.ts +11 -0
  25. package/dist/components/sections/MediaCarousel.d.ts.map +1 -0
  26. package/dist/components/sections/MiscSections.d.ts.map +1 -1
  27. package/dist/components/sections/ProductRail.d.ts.map +1 -1
  28. package/dist/components/sections/ProductSlider.d.ts +15 -0
  29. package/dist/components/sections/ProductSlider.d.ts.map +1 -0
  30. package/dist/config.d.ts +38 -21
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/createStorefrontApp.d.ts +12 -0
  33. package/dist/createStorefrontApp.d.ts.map +1 -1
  34. package/dist/define.d.ts +17 -0
  35. package/dist/define.d.ts.map +1 -0
  36. package/dist/hooks/index.d.ts +1 -0
  37. package/dist/hooks/index.d.ts.map +1 -1
  38. package/dist/hooks/useStorefront.d.ts +35 -0
  39. package/dist/hooks/useStorefront.d.ts.map +1 -0
  40. package/dist/index.cjs +1113 -277
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.ts +21 -11
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +1006 -188
  45. package/dist/index.js.map +1 -1
  46. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  47. package/dist/pages/HomePage.d.ts +5 -2
  48. package/dist/pages/HomePage.d.ts.map +1 -1
  49. package/dist/pages/MyPurchasesPage.d.ts.map +1 -1
  50. package/dist/pages/OrderConfirmationPage.d.ts.map +1 -1
  51. package/dist/pages/ProductDetailPage.d.ts.map +1 -1
  52. package/dist/presets.d.ts +5 -0
  53. package/dist/presets.d.ts.map +1 -1
  54. package/dist/sections.d.ts +45 -2
  55. package/dist/sections.d.ts.map +1 -1
  56. package/dist/stores/cart.store.d.ts +5 -0
  57. package/dist/stores/cart.store.d.ts.map +1 -1
  58. package/dist/testids.d.ts +21 -0
  59. package/dist/testids.d.ts.map +1 -1
  60. package/dist/theme.d.ts +21 -1
  61. package/dist/theme.d.ts.map +1 -1
  62. package/dist/workflows/checkout.d.ts.map +1 -1
  63. package/package.json +10 -6
  64. package/src/auth.ts +47 -10
  65. package/src/blocks.tsx +7 -3
  66. package/src/component-contracts.ts +140 -0
  67. package/src/component-selectors.ts +31 -0
  68. package/src/components/CartDrawer.tsx +2 -1
  69. package/src/components/ProductCard.tsx +39 -23
  70. package/src/components/ProductEnquiryForm.tsx +175 -0
  71. package/src/components/ProductGrid.tsx +12 -3
  72. package/src/components/RelatedProducts.tsx +13 -4
  73. package/src/components/SmoothImage.tsx +59 -0
  74. package/src/components/StorefrontFooter.tsx +24 -14
  75. package/src/components/StorefrontHeader.tsx +74 -42
  76. package/src/components/sections/CategoryShowcase.tsx +3 -2
  77. package/src/components/sections/HeroSection.tsx +18 -2
  78. package/src/components/sections/MediaCarousel.tsx +141 -0
  79. package/src/components/sections/MiscSections.tsx +2 -1
  80. package/src/components/sections/ProductRail.tsx +11 -3
  81. package/src/components/sections/ProductSlider.tsx +119 -0
  82. package/src/config.ts +65 -24
  83. package/src/createStorefrontApp.tsx +80 -10
  84. package/src/define.ts +34 -0
  85. package/src/hooks/index.ts +1 -0
  86. package/src/hooks/useStorefront.ts +58 -0
  87. package/src/index.ts +62 -11
  88. package/src/pages/CheckoutPage.tsx +2 -1
  89. package/src/pages/HomePage.tsx +6 -2
  90. package/src/pages/MyPurchasesPage.tsx +2 -1
  91. package/src/pages/OrderConfirmationPage.tsx +2 -1
  92. package/src/pages/ProductDetailPage.tsx +138 -62
  93. package/src/presets.ts +66 -0
  94. package/src/scaffold.tsx +1 -1
  95. package/src/sections.ts +49 -2
  96. package/src/stores/cart.store.ts +16 -1
  97. package/src/testids.ts +21 -0
  98. package/src/theme.ts +36 -2
  99. package/src/workflows/checkout.ts +5 -2
  100. package/dist/slot-contracts.d.ts +0 -34
  101. package/dist/slot-contracts.d.ts.map +0 -1
  102. package/src/slot-contracts.ts +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AA+FlD,wBAAgB,YAAY,sBAke3B"}
1
+ {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAgGlD,wBAAgB,YAAY,sBAke3B"}
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
- import type { HomeSection } from '../sections';
2
+ import type { StorefrontSection } from '../sections';
3
+ export declare function StorefrontSections({ sections }: {
4
+ sections: readonly StorefrontSection[];
5
+ }): React.JSX.Element;
3
6
  export declare function HomePage({ sections }: {
4
- sections: HomeSection[];
7
+ sections: readonly StorefrontSection[];
5
8
  }): React.JSX.Element;
6
9
  //# sourceMappingURL=HomePage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAO9C,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,qBAEjE"}
1
+ {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAOpD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAAE,qBAE1F;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAAE,qBAEhF"}
@@ -1 +1 @@
1
- {"version":3,"file":"MyPurchasesPage.d.ts","sourceRoot":"","sources":["../../src/pages/MyPurchasesPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AA0RvC,wBAAgB,eAAe,sBA2B9B"}
1
+ {"version":3,"file":"MyPurchasesPage.d.ts","sourceRoot":"","sources":["../../src/pages/MyPurchasesPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AA2RvC,wBAAgB,eAAe,sBA2B9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"OrderConfirmationPage.d.ts","sourceRoot":"","sources":["../../src/pages/OrderConfirmationPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAmDlD,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,qBAyIrE"}
1
+ {"version":3,"file":"OrderConfirmationPage.d.ts","sourceRoot":"","sources":["../../src/pages/OrderConfirmationPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAoDlD,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,qBAyIrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../src/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAelD,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,qBAwK3D"}
1
+ {"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../src/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAmBlD,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,qBAgP3D"}
package/dist/presets.d.ts CHANGED
@@ -23,11 +23,16 @@ export declare const sertaoTemplate: StorefrontTemplate;
23
23
  export declare const voltTemplate: StorefrontTemplate;
24
24
  /** atelier — classic premium retail (Flex): white, near-black, gold accent, slider hero, trust badges. */
25
25
  export declare const atelierTemplate: StorefrontTemplate;
26
+ /** food — warm appetizing delivery (steakhouse / burger / comfort food): dark inviting
27
+ * header, ember CTA, cream canvas, rounded cards, menu-first home with "mais pedidos"
28
+ * rail and social proof. Built for restaurant/food stores — override to go fully dark. */
29
+ export declare const foodTemplate: StorefrontTemplate;
26
30
  export declare const storefrontTemplates: {
27
31
  readonly mare: StorefrontTemplate;
28
32
  readonly sertao: StorefrontTemplate;
29
33
  readonly volt: StorefrontTemplate;
30
34
  readonly atelier: StorefrontTemplate;
35
+ readonly food: StorefrontTemplate;
31
36
  };
32
37
  export type StorefrontTemplateId = keyof typeof storefrontTemplates;
33
38
  //# sourceMappingURL=presets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAS5C;qFACqF;AACrF,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,eAAe,CAAA;IACtB,0EAA0E;IAC1E,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,UAAU,CAAA;IAChE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,yFAAyF;AACzF,eAAO,MAAM,YAAY,EAAE,kBA0C1B,CAAA;AAED,gGAAgG;AAChG,eAAO,MAAM,cAAc,EAAE,kBA2D5B,CAAA;AAED,kHAAkH;AAClH,eAAO,MAAM,YAAY,EAAE,kBAkD1B,CAAA;AAED,0GAA0G;AAC1G,eAAO,MAAM,eAAe,EAAE,kBA4D7B,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,mBAAmB,CAAA"}
1
+ {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAS5C;qFACqF;AACrF,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,eAAe,CAAA;IACtB,0EAA0E;IAC1E,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,UAAU,CAAA;IAChE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,yFAAyF;AACzF,eAAO,MAAM,YAAY,EAAE,kBA0C1B,CAAA;AAED,gGAAgG;AAChG,eAAO,MAAM,cAAc,EAAE,kBA2D5B,CAAA;AAED,kHAAkH;AAClH,eAAO,MAAM,YAAY,EAAE,kBAkD1B,CAAA;AAED,0GAA0G;AAC1G,eAAO,MAAM,eAAe,EAAE,kBA4D7B,CAAA;AAED;;2FAE2F;AAC3F,eAAO,MAAM,YAAY,EAAE,kBA4D1B,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,mBAAmB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import type { HeroVariant } from './theme';
2
+ import type React from 'react';
2
3
  export interface HeroSlide {
3
4
  title: string;
4
5
  subtitle?: string;
@@ -10,11 +11,28 @@ export interface HeroSlide {
10
11
  /** Editorial boxed copy block (Uyuni) instead of free overlay */
11
12
  boxed?: boolean;
12
13
  }
13
- export type HomeSection = {
14
+ export interface MediaCarouselItem {
15
+ title: string;
16
+ subtitle?: string;
17
+ eyebrow?: string;
18
+ cta?: string;
19
+ href?: string;
20
+ image: string;
21
+ imageAlt?: string;
22
+ align?: 'start' | 'center' | 'end';
23
+ }
24
+ export type StorefrontSection = {
14
25
  type: 'hero';
15
26
  variant: HeroVariant;
16
27
  slides: HeroSlide[];
17
28
  height?: 'tall' | 'medium';
29
+ } | {
30
+ type: 'mediaCarousel';
31
+ items: MediaCarouselItem[];
32
+ height?: 'medium' | 'tall' | 'screen';
33
+ autoplayMs?: number;
34
+ overlay?: 'dark' | 'soft' | 'none';
35
+ className?: string;
18
36
  } | {
19
37
  type: 'categories';
20
38
  style: 'bubbles' | 'tiles';
@@ -28,6 +46,18 @@ export type HomeSection = {
28
46
  /** 'sale' = compareAtPrice set; 'new' = newest first; 'all' = catalog order */
29
47
  filter?: 'sale' | 'new' | 'all';
30
48
  limit?: number;
49
+ } | {
50
+ type: 'productSlider';
51
+ title: string;
52
+ subtitle?: string;
53
+ eyebrow?: string;
54
+ filter?: 'sale' | 'new' | 'all';
55
+ categoryName?: string;
56
+ collection?: string;
57
+ limit?: number;
58
+ cta?: string;
59
+ href?: string;
60
+ className?: string;
31
61
  } | {
32
62
  type: 'benefits';
33
63
  items: Array<{
@@ -60,8 +90,10 @@ export type HomeSection = {
60
90
  title?: string;
61
91
  subtitle?: string;
62
92
  };
93
+ /** @deprecated Use StorefrontSection. Kept for existing generated stores. */
94
+ export type HomeSection = StorefrontSection;
63
95
  export interface HomeConfig {
64
- sections: HomeSection[];
96
+ sections: readonly StorefrontSection[];
65
97
  }
66
98
  export interface NavLink {
67
99
  label: string;
@@ -78,6 +110,17 @@ export interface FooterConfig {
78
110
  label: string;
79
111
  href: string;
80
112
  }>;
113
+ credit?: React.ReactNode;
114
+ labels?: {
115
+ categories?: string;
116
+ navigation?: string;
117
+ contact?: string;
118
+ viewAll?: string;
119
+ purchases?: string;
120
+ privacy?: string;
121
+ terms?: string;
122
+ returns?: string;
123
+ };
81
124
  }
82
125
  /** Wide gradient SVG data-URI — deterministic hero/banner art, no network. */
83
126
  export declare function bannerPlaceholder(label: string, hueA: number, hueB: number, w?: number, h?: number): string;
@@ -1 +1 @@
1
- {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../src/sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAS1C,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,iEAAiE;IACjE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GACvF;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAClE;IACE,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GACD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,C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,CAAA;KAAE,CAAC,CAAA;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,SAAO,EAAE,CAAC,SAAM,GAAG,MAAM,CAYtG"}
@@ -30,6 +30,11 @@ export interface CartState {
30
30
  clear(): void;
31
31
  openDrawer(): void;
32
32
  closeDrawer(): void;
33
+ /** Drop persisted lines the active backend can no longer resolve (e.g. a cart
34
+ * built in an earlier mock-mode session, whose ids don't exist live). The
35
+ * resolver returns false only for a definitive "not found"; on error it must
36
+ * return true so a transient failure never discards a legit line. */
37
+ reconcile(resolve: (line: CartLine) => Promise<boolean>): Promise<void>;
33
38
  }
34
39
  export declare const useCartStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CartState>, "persist"> & {
35
40
  persist: {
@@ -1 +1 @@
1
- {"version":3,"file":"cart.store.d.ts","sourceRoot":"","sources":["../../src/stores/cart.store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAA;AAE3B,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,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ids.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export declare const TID: {
2
2
  readonly headerSearch: "header-search";
3
+ readonly headerSearchToggle: "header-search-toggle";
3
4
  readonly cartButton: "cart-button";
4
5
  readonly cartCount: "cart-count";
5
6
  readonly accountLink: "account-link";
@@ -11,6 +12,13 @@ export declare const TID: {
11
12
  readonly hero: "home-hero";
12
13
  readonly heroPrev: "hero-prev";
13
14
  readonly heroNext: "hero-next";
15
+ readonly mediaCarousel: "media-carousel";
16
+ readonly mediaCarouselPrev: "media-carousel-prev";
17
+ readonly mediaCarouselNext: "media-carousel-next";
18
+ readonly productSlider: "product-slider";
19
+ readonly productSliderViewport: "product-slider-viewport";
20
+ readonly productSliderPrev: "product-slider-prev";
21
+ readonly productSliderNext: "product-slider-next";
14
22
  readonly categoryShowcase: "category-showcase";
15
23
  readonly productRail: "product-rail";
16
24
  readonly benefits: "benefits-row";
@@ -42,6 +50,19 @@ export declare const TID: {
42
50
  readonly productOptionValue: (id: string, value: string) => string;
43
51
  readonly pdpQtyInput: "pdp-qty-input";
44
52
  readonly pdpAddToCart: "pdp-add-to-cart";
53
+ readonly pdpRoot: "pdp-root";
54
+ readonly pdpGallery: "pdp-gallery";
55
+ readonly pdpActions: "pdp-actions";
56
+ readonly pdpEnquiryButton: "pdp-enquiry-button";
57
+ readonly enquiryForm: "enquiry-form";
58
+ readonly enquiryName: "enquiry-name";
59
+ readonly enquiryEmail: "enquiry-email";
60
+ readonly enquiryPhone: "enquiry-phone";
61
+ readonly enquirySubject: "enquiry-subject";
62
+ readonly enquiryMessage: "enquiry-message";
63
+ readonly enquirySubmit: "enquiry-submit";
64
+ readonly enquirySuccess: "enquiry-success";
65
+ readonly enquiryError: "enquiry-error";
45
66
  readonly cartDrawer: "cart-drawer";
46
67
  readonly cartLine: "cart-line";
47
68
  readonly lineQty: "line-qty";
@@ -1 +1 @@
1
- {"version":3,"file":"testids.d.ts","sourceRoot":"","sources":["../src/testids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG;;;;;;;8BAQG,MAAM;iCACH,MAAM;;;;;;;;;;;;;;;;;;;;;;oCAyBH,MAAM;;;;;;;;;;sCAWJ,MAAM;sCACN,MAAM,SAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAoCpB,MAAM;;;;;;;;;;;;;;;;;CAkBxB,CAAA"}
1
+ {"version":3,"file":"testids.d.ts","sourceRoot":"","sources":["../src/testids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG;;;;;;;;8BASG,MAAM;iCACH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAgCH,MAAM;;;;;;;;;;sCAWJ,MAAM;sCACN,MAAM,SAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAiDpB,MAAM;;;;;;;;;;;;;;;;;CAkBxB,CAAA"}
package/dist/theme.d.ts CHANGED
@@ -20,13 +20,21 @@ export interface StorefrontThemeColors {
20
20
  /** Announcement bar */
21
21
  announcementBackground?: string;
22
22
  announcementForeground?: string;
23
+ /** Secondary brand accent (e.g. a gourmet gold beside the primary). Emitted
24
+ * as `--sf-accent` / `--sf-accent-foreground` and the `accent` tailwind token. */
25
+ accent?: string;
26
+ accentForeground?: string;
23
27
  }
24
28
  export interface StorefrontThemeFont {
25
29
  /** Display font for headings, e.g. 'Marcellus' */
26
30
  heading: string;
27
31
  /** Body font, e.g. 'Rubik' */
28
32
  body: string;
29
- /** Google Fonts families to load (defaults to heading+body) */
33
+ /** Optional oversized display face for hero words (emitted as `--sf-font-display`). */
34
+ display?: string;
35
+ /** Optional serif accent for quotes/editorial (emitted as `--sf-font-serif`). */
36
+ serif?: string;
37
+ /** Google Fonts families to load (defaults to heading+body+display+serif) */
30
38
  googleFonts?: string[];
31
39
  /** Fallback stack — default sans-serif; use 'serif' for editorial themes */
32
40
  fallback?: 'sans-serif' | 'serif';
@@ -41,6 +49,13 @@ export interface StorefrontTheme {
41
49
  variant?: HeaderVariant;
42
50
  /** Uppercase nav links (premium retail tone) */
43
51
  uppercaseNav?: boolean;
52
+ /** Show category shortcuts after primary nav links. Default true. */
53
+ showCategories?: boolean;
54
+ /** Show the storefront search in the header. Default true. */
55
+ showSearch?: boolean;
56
+ /** Header search presentation: a full input ('full', default) or a compact
57
+ * icon button that expands into an input on click ('icon'). */
58
+ searchStyle?: 'full' | 'icon';
44
59
  };
45
60
  productCard?: {
46
61
  style?: CardStyle;
@@ -48,6 +63,11 @@ export interface StorefrontTheme {
48
63
  };
49
64
  /** Uppercase CTA buttons with letter-spacing (Uyuni/Flex tone) */
50
65
  uppercaseButtons?: boolean;
66
+ /** Brand-token passthrough. Each entry is emitted verbatim as a `--<key>` CSS
67
+ * custom property, so a store can add gradients, glows, extra colors, or
68
+ * letter-spacing the fixed schema doesn't enumerate — without editing the SDK.
69
+ * e.g. { 'grad-ember': 'linear-gradient(...)', 'glow-ember': '0 0 0 1px ...' }. */
70
+ tokens?: Record<string, string>;
51
71
  }
52
72
  export declare function themeToCss(theme: StorefrontTheme): string;
53
73
  /** Injects theme CSS variables + Google Fonts. Mount once inside the app root. */
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAaxC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AACjE,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAA;AACzE,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;AACvD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,CAAA;AAE5C,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACn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Root":"","sources":["../../src/workflows/checkout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,wBAAwB,CAAA;IAChC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,GAAG,iBAAiB,CAAC,CAAA;IACnE,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,CAAA;IACpD,QAAQ,EAAE,0BAA0B,CAAA;IACpC,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,KAAK,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB;AAaD;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAgB,GACjB,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAiCjE"}
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/workflows/checkout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,wBAAwB,CAAA;IAChC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,GAAG,iBAAiB,CAAC,CAAA;IACnE,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,CAAA;IACpD,QAAQ,EAAE,0BAA0B,CAAA;IACpC,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,KAAK,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB;AAaD;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAgB,GACjB,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAoCjE"}
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@fayz-ai/storefront",
3
- "version": "0.6.0",
3
+ "fayz": {
4
+ "status": "beta"
5
+ },
6
+ "version": "0.8.0",
4
7
  "description": "Fayz SDK storefront kit — Shopify-style customer-facing ecommerce template components",
5
8
  "type": "module",
6
9
  "main": "./dist/index.cjs",
@@ -40,11 +43,12 @@
40
43
  "@supabase/supabase-js": "^2.45.0",
41
44
  "lucide-react": "^0.400.0",
42
45
  "zustand": "^4.5.0",
43
- "@fayz-ai/auth": "^0.6.0",
44
- "@fayz-ai/core": "^0.6.0",
45
- "@fayz-ai/sdk": "^0.6.0",
46
- "@fayz-ai/shop": "^0.6.0",
47
- "@fayz-ai/ui": "^0.6.0"
46
+ "@fayz-ai/auth": "^0.8.0",
47
+ "@fayz-ai/core": "^0.8.0",
48
+ "@fayz-ai/plugin-auth": "^0.8.0",
49
+ "@fayz-ai/shop": "^0.8.0",
50
+ "@fayz-ai/ui": "^0.8.0",
51
+ "@fayz-ai/sdk": "^0.8.0"
48
52
  },
49
53
  "peerDependencies": {
50
54
  "react": "^18.0.0 || ^19.0.0",
package/src/auth.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import type { AuthAdapter, AuthUser } from '@fayz-ai/core'
2
- import { createMockAuthAdapter } from '@fayz-ai/auth'
2
+ import {
3
+ createAuthRuntime,
4
+ createMockAuthAdapter,
5
+ type AuthPluginOptions,
6
+ } from '@fayz-ai/plugin-auth'
3
7
  import { getShopProvider } from '@fayz-ai/shop/runtime'
4
8
  import { useSessionStore } from './stores/session.store'
5
9
 
@@ -11,20 +15,53 @@ import { useSessionStore } from './stores/session.store'
11
15
  // and purchase history attach to a customer.
12
16
  // ---------------------------------------------------------------------------
13
17
 
14
- export type StorefrontAuthAdapter = AuthAdapter | 'mock' | 'supabase'
18
+ export type StorefrontAuthAdapter = AuthAdapter | 'mock' | 'supabase' | (string & {})
19
+
20
+ export interface StorefrontAuthConfig {
21
+ adapter?: AuthPluginOptions['adapter']
22
+ provider?: AuthPluginOptions['provider']
23
+ routes?: AuthPluginOptions['routes']
24
+ supabase?: AuthPluginOptions['supabase']
25
+ }
15
26
 
16
27
  let _adapter: AuthAdapter | null = null
17
28
 
29
+ function isAuthAdapter(value: unknown): value is AuthAdapter {
30
+ return Boolean(
31
+ value &&
32
+ typeof value === 'object' &&
33
+ 'getSession' in value &&
34
+ 'signIn' in value &&
35
+ 'signOut' in value,
36
+ )
37
+ }
38
+
39
+ function normalizeAuthConfig(
40
+ configured: StorefrontAuthAdapter | StorefrontAuthConfig | undefined,
41
+ ): StorefrontAuthConfig {
42
+ if (!configured) return {}
43
+ if (typeof configured === 'string' || isAuthAdapter(configured)) return { adapter: configured }
44
+ return configured
45
+ }
46
+
18
47
  export function resolveAuthAdapter(
19
- configured: StorefrontAuthAdapter | undefined,
48
+ configured: StorefrontAuthAdapter | StorefrontAuthConfig | undefined,
49
+ fallback?: { supabaseUrl?: string; supabaseAnonKey?: string },
20
50
  ): AuthAdapter {
21
- if (configured && configured !== 'mock' && configured !== 'supabase') return configured
22
- if (configured === 'supabase') {
23
- console.warn(
24
- '@fayz-ai/shop: auth.adapter="supabase" is legacy. Pass an explicit AuthAdapter or use the Fayz SDK broker path.',
25
- )
26
- }
27
- return createMockAuthAdapter()
51
+ const config = normalizeAuthConfig(configured)
52
+ return createAuthRuntime({
53
+ provider: config.provider ?? config.adapter ?? (fallback?.supabaseUrl ? 'supabase' : 'mock'),
54
+ adapter: config.adapter,
55
+ routes: config.routes,
56
+ requireAuth: false,
57
+ supabase: {
58
+ url: config.supabase?.url ?? fallback?.supabaseUrl,
59
+ anonKey: config.supabase?.anonKey ?? fallback?.supabaseAnonKey,
60
+ client: config.supabase?.client,
61
+ callbackUrl: config.supabase?.callbackUrl,
62
+ resetPasswordUrl: config.supabase?.resetPasswordUrl,
63
+ },
64
+ }).adapter
28
65
  }
29
66
 
30
67
  /** Called once by createStorefrontApp. Restores any persisted session. */
package/src/blocks.tsx CHANGED
@@ -1,9 +1,11 @@
1
1
  import { registerBlock } from '@fayz-ai/core'
2
2
  import type { BlockNode } from '@fayz-ai/core'
3
- import type { HomeSection } from './sections'
3
+ import type { StorefrontSection } from './sections'
4
4
  import { HeroSection } from './components/sections/HeroSection'
5
5
  import { CategoryShowcase } from './components/sections/CategoryShowcase'
6
6
  import { ProductRail } from './components/sections/ProductRail'
7
+ import { MediaCarousel } from './components/sections/MediaCarousel'
8
+ import { ProductSlider } from './components/sections/ProductSlider'
7
9
  import {
8
10
  BenefitsRow,
9
11
  PromoBanner,
@@ -26,8 +28,10 @@ export function registerStorefrontBlocks(): void {
26
28
  if (registered) return
27
29
  registered = true
28
30
  registerBlock('hero', HeroSection, { source: 'sdk', label: 'Hero' })
31
+ registerBlock('mediaCarousel', MediaCarousel, { source: 'sdk', label: 'Media carousel' })
29
32
  registerBlock('categories', CategoryShowcase, { source: 'sdk', label: 'Categories' })
30
33
  registerBlock('products', ProductRail, { source: 'sdk', label: 'Product rail' })
34
+ registerBlock('productSlider', ProductSlider, { source: 'sdk', label: 'Product slider' })
31
35
  registerBlock('benefits', BenefitsRow, { source: 'sdk', label: 'Benefits row' })
32
36
  registerBlock('banner', PromoBanner, { source: 'sdk', label: 'Promo banner' })
33
37
  registerBlock('manifesto', ManifestoBlock, { source: 'sdk', label: 'Manifesto' })
@@ -38,8 +42,8 @@ export function registerStorefrontBlocks(): void {
38
42
  // Register on import so any consumer of the storefront package has the blocks.
39
43
  registerStorefrontBlocks()
40
44
 
41
- /** Convert the legacy HomeSection[] blueprint into a generic block tree. */
42
- export function sectionsToBlocks(sections: HomeSection[]): BlockNode[] {
45
+ /** Convert the typed storefront section blueprint into a generic block tree. */
46
+ export function sectionsToBlocks(sections: readonly StorefrontSection[]): BlockNode[] {
43
47
  return sections.map((section, i) => {
44
48
  const { type, ...props } = section
45
49
  return { type, id: `${type}-${i}`, props: props as Record<string, unknown> }
@@ -0,0 +1,140 @@
1
+ import type React from 'react'
2
+ import type { Category, CreateProductEnquiryInput, Product, ProductEnquiry, ProductImage } from '@fayz-ai/shop/types'
3
+ import type { ProductOptionGroup, ProductOptionSelection } from './product-options'
4
+ import type { ResolvedStorefrontConfig, StorefrontCommerceMode } from './config'
5
+ import type { MediaCarouselItem } from './sections'
6
+
7
+ export interface StorefrontComponentBaseProps {
8
+ config: ResolvedStorefrontConfig
9
+ commerceMode: StorefrontCommerceMode
10
+ className?: string
11
+ testId?: string
12
+ }
13
+
14
+ export interface StorefrontActions {
15
+ navigateTo: (to: string) => void
16
+ addToCart: (product: Product, quantity?: number, options?: ProductOptionSelection) => void
17
+ openCart: () => void
18
+ closeCart: () => void
19
+ createProductEnquiry: (input: CreateProductEnquiryInput) => Promise<ProductEnquiry>
20
+ }
21
+
22
+ export interface ProductCardProps extends StorefrontComponentBaseProps {
23
+ product: Product
24
+ actions: Pick<StorefrontActions, 'navigateTo' | 'addToCart' | 'openCart'>
25
+ }
26
+
27
+ export interface ProductDetailProps extends StorefrontComponentBaseProps {
28
+ product: Product
29
+ primaryImage?: ProductImage
30
+ optionGroups: ProductOptionGroup[]
31
+ selectedOptions: ProductOptionSelection
32
+ setSelectedOptions: React.Dispatch<React.SetStateAction<ProductOptionSelection>>
33
+ quantity: number
34
+ setQuantity: React.Dispatch<React.SetStateAction<number>>
35
+ soldOut: boolean
36
+ lowStock: boolean
37
+ actions: Pick<StorefrontActions, 'addToCart' | 'createProductEnquiry' | 'navigateTo'>
38
+ addToCart: () => void
39
+ openEnquiry: () => void
40
+ }
41
+
42
+ export interface ProductGalleryProps extends StorefrontComponentBaseProps {
43
+ product: Product
44
+ images: ProductImage[]
45
+ primaryImage?: ProductImage
46
+ }
47
+
48
+ export interface ProductPriceProps extends StorefrontComponentBaseProps {
49
+ product: Product
50
+ value: number
51
+ compareAt?: number | null
52
+ }
53
+
54
+ export interface ProductActionsProps extends StorefrontComponentBaseProps {
55
+ product: Product
56
+ quantity: number
57
+ setQuantity: React.Dispatch<React.SetStateAction<number>>
58
+ soldOut: boolean
59
+ actions: Pick<StorefrontActions, 'addToCart' | 'createProductEnquiry' | 'navigateTo'>
60
+ addToCart: () => void
61
+ openEnquiry: () => void
62
+ }
63
+
64
+ export interface ProductEnquiryFormContractProps extends StorefrontComponentBaseProps {
65
+ product: Product
66
+ onSuccess?: () => void
67
+ }
68
+
69
+ export interface CategoryCardProps extends StorefrontComponentBaseProps {
70
+ category: Category
71
+ actions: Pick<StorefrontActions, 'navigateTo'>
72
+ }
73
+
74
+ export interface CollectionSectionProps extends StorefrontComponentBaseProps {
75
+ title: string
76
+ subtitle?: string
77
+ products: Product[]
78
+ category?: Category
79
+ children?: React.ReactNode
80
+ }
81
+
82
+ export interface HeroSectionContractProps extends StorefrontComponentBaseProps {
83
+ title: string
84
+ subtitle?: string
85
+ eyebrow?: string
86
+ image?: string
87
+ cta?: string
88
+ href?: string
89
+ children?: React.ReactNode
90
+ }
91
+
92
+ export interface MediaCarouselProps extends StorefrontComponentBaseProps {
93
+ items: MediaCarouselItem[]
94
+ height?: 'medium' | 'tall' | 'screen'
95
+ autoplayMs?: number
96
+ overlay?: 'dark' | 'soft' | 'none'
97
+ }
98
+
99
+ export interface ProductSliderProps extends StorefrontComponentBaseProps {
100
+ title: string
101
+ subtitle?: string
102
+ eyebrow?: string
103
+ filter?: 'sale' | 'new' | 'all'
104
+ categoryName?: string
105
+ collection?: string
106
+ limit?: number
107
+ cta?: string
108
+ href?: string
109
+ }
110
+
111
+ export interface StorefrontChromeProps extends StorefrontComponentBaseProps {
112
+ children?: React.ReactNode
113
+ }
114
+
115
+ export interface StorefrontStateProps extends StorefrontComponentBaseProps {
116
+ title?: string
117
+ message?: string
118
+ children?: React.ReactNode
119
+ }
120
+
121
+ export interface StorefrontComponents {
122
+ ProductCard?: React.ComponentType<ProductCardProps>
123
+ ProductDetail?: React.ComponentType<ProductDetailProps>
124
+ ProductGallery?: React.ComponentType<ProductGalleryProps>
125
+ ProductPrice?: React.ComponentType<ProductPriceProps>
126
+ ProductActions?: React.ComponentType<ProductActionsProps>
127
+ ProductEnquiryForm?: React.ComponentType<ProductEnquiryFormContractProps>
128
+ CategoryCard?: React.ComponentType<CategoryCardProps>
129
+ CollectionSection?: React.ComponentType<CollectionSectionProps>
130
+ HeroSection?: React.ComponentType<HeroSectionContractProps>
131
+ MediaCarousel?: React.ComponentType<MediaCarouselProps>
132
+ ProductSlider?: React.ComponentType<ProductSliderProps>
133
+ Header?: React.ComponentType<StorefrontChromeProps>
134
+ Footer?: React.ComponentType<StorefrontChromeProps>
135
+ Shell?: React.ComponentType<StorefrontChromeProps>
136
+ EmptyState?: React.ComponentType<StorefrontStateProps>
137
+ LoadingState?: React.ComponentType<StorefrontStateProps>
138
+ ErrorState?: React.ComponentType<StorefrontStateProps>
139
+
140
+ }
@@ -0,0 +1,31 @@
1
+ import { TID } from './testids'
2
+
3
+ /**
4
+ * Stable selectors that custom storefront components must preserve.
5
+ *
6
+ * Apps can fully customize the visual tree, but replacement components still
7
+ * need these anchors so smoke tests, QA, and agents can operate stores.
8
+ */
9
+ export const productCardComponentContract = {
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 storefrontComponentContracts = {
17
+ productCard: productCardComponentContract,
18
+ productDetail: {
19
+ root: { 'data-testid': TID.pdpRoot },
20
+ gallery: { 'data-testid': TID.pdpGallery },
21
+ name: { 'data-testid': TID.pdpName },
22
+ description: { 'data-testid': TID.pdpDescription },
23
+ actions: { 'data-testid': TID.pdpActions },
24
+ addButton: { 'data-testid': TID.pdpAddToCart },
25
+ enquiryButton: { 'data-testid': TID.pdpEnquiryButton },
26
+ enquiryForm: { 'data-testid': TID.enquiryForm },
27
+ },
28
+ } as const
29
+
30
+ export type ProductCardComponentContract = typeof productCardComponentContract
31
+ export type ProductDetailComponentContract = typeof storefrontComponentContracts.productDetail
@@ -14,6 +14,7 @@ import { navigateTo } from '../router'
14
14
  import { formatMoney } from '../format'
15
15
  import { QuantityInput } from './QuantityInput'
16
16
  import { TID } from '../testids'
17
+ import { SmoothImage } from './SmoothImage'
17
18
 
18
19
  export function CartDrawer() {
19
20
  const config = useStorefrontConfig()
@@ -127,7 +128,7 @@ export function CartDrawer() {
127
128
  }`}
128
129
  >
129
130
  {line.imageUrl && (
130
- <img src={line.imageUrl} alt={line.name} className="h-20 w-20 shrink-0 rounded-lg border object-cover" />
131
+ <SmoothImage src={line.imageUrl} alt={line.name} className="h-20 w-20 shrink-0 rounded-lg border object-cover" />
131
132
  )}
132
133
  <div className="flex flex-1 flex-col">
133
134
  <div className="flex items-start justify-between gap-2">