@fayz-ai/storefront 0.9.0 → 0.11.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 (391) hide show
  1. package/README.md +3 -3
  2. package/dist/app/createStorefrontApp.d.ts +65 -0
  3. package/dist/app/createStorefrontApp.d.ts.map +1 -0
  4. package/dist/{define.d.ts → app/define.d.ts} +3 -3
  5. package/dist/app/define.d.ts.map +1 -0
  6. package/dist/app/hydration.d.ts +37 -0
  7. package/dist/app/hydration.d.ts.map +1 -0
  8. package/dist/app/prerender.d.ts +57 -0
  9. package/dist/app/prerender.d.ts.map +1 -0
  10. package/dist/{router.d.ts → app/router.d.ts} +140 -113
  11. package/dist/app/router.d.ts.map +1 -0
  12. package/dist/{scaffold.d.ts → app/scaffold.d.ts} +2 -2
  13. package/dist/app/scaffold.d.ts.map +1 -0
  14. package/dist/app/serving.d.ts +70 -0
  15. package/dist/app/serving.d.ts.map +1 -0
  16. package/dist/app/static-render.d.ts +46 -0
  17. package/dist/app/static-render.d.ts.map +1 -0
  18. package/dist/blocks/block-at-path.d.ts +59 -0
  19. package/dist/blocks/block-at-path.d.ts.map +1 -0
  20. package/dist/blocks/page-blocks.d.ts +163 -0
  21. package/dist/blocks/page-blocks.d.ts.map +1 -0
  22. package/dist/blocks/page-data.d.ts +105 -0
  23. package/dist/blocks/page-data.d.ts.map +1 -0
  24. package/dist/{blocks.d.ts → blocks/registry.d.ts} +1 -1
  25. package/dist/blocks/registry.d.ts.map +1 -0
  26. package/dist/{sections.d.ts → blocks/sections.d.ts} +40 -2
  27. package/dist/blocks/sections.d.ts.map +1 -0
  28. package/dist/chunk-6IXTENLB.js +162 -0
  29. package/dist/chunk-6IXTENLB.js.map +1 -0
  30. package/dist/chunk-SX3J3QIT.js +11046 -0
  31. package/dist/chunk-SX3J3QIT.js.map +1 -0
  32. package/dist/components/PaymentTerms.d.ts +34 -0
  33. package/dist/components/PaymentTerms.d.ts.map +1 -0
  34. package/dist/components/Skeleton.d.ts +17 -0
  35. package/dist/components/Skeleton.d.ts.map +1 -0
  36. package/dist/components/SmoothImage.d.ts +1 -1
  37. package/dist/components/SmoothImage.d.ts.map +1 -1
  38. package/dist/components/account/CustomerAccountShell.d.ts +17 -0
  39. package/dist/components/account/CustomerAccountShell.d.ts.map +1 -0
  40. package/dist/components/account/SignInModal.d.ts.map +1 -0
  41. package/dist/components/account/section.d.ts +15 -0
  42. package/dist/components/account/section.d.ts.map +1 -0
  43. package/dist/components/cart/CartDrawer.d.ts.map +1 -0
  44. package/dist/components/cart/QuantityInput.d.ts.map +1 -0
  45. package/dist/components/checkout/CheckoutPayment.d.ts +17 -0
  46. package/dist/components/checkout/CheckoutPayment.d.ts.map +1 -0
  47. package/dist/components/checkout/CheckoutSteps.d.ts +9 -0
  48. package/dist/components/checkout/CheckoutSteps.d.ts.map +1 -0
  49. package/dist/components/checkout/DeliveryEstimator.d.ts.map +1 -0
  50. package/dist/components/collection/CategoryShowcase.d.ts +44 -0
  51. package/dist/components/collection/CategoryShowcase.d.ts.map +1 -0
  52. package/dist/components/collection/FiltersPanel.d.ts +19 -0
  53. package/dist/components/collection/FiltersPanel.d.ts.map +1 -0
  54. package/dist/components/collection/ProductGrid.d.ts.map +1 -0
  55. package/dist/components/layout/PageBodyBlocks.d.ts +40 -0
  56. package/dist/components/layout/PageBodyBlocks.d.ts.map +1 -0
  57. package/dist/components/layout/SearchOverlay.d.ts +13 -0
  58. package/dist/components/layout/SearchOverlay.d.ts.map +1 -0
  59. package/dist/components/layout/StorefrontErrorBoundary.d.ts.map +1 -0
  60. package/dist/components/layout/StorefrontFooter.d.ts.map +1 -0
  61. package/dist/components/layout/StorefrontHeader.d.ts.map +1 -0
  62. package/dist/components/layout/Toaster.d.ts.map +1 -0
  63. package/dist/components/marketing/CollectionSections.d.ts +463 -0
  64. package/dist/components/marketing/CollectionSections.d.ts.map +1 -0
  65. package/dist/components/marketing/ConversionSections.d.ts +221 -0
  66. package/dist/components/marketing/ConversionSections.d.ts.map +1 -0
  67. package/dist/components/marketing/EditorialSections.d.ts +248 -0
  68. package/dist/components/marketing/EditorialSections.d.ts.map +1 -0
  69. package/dist/components/marketing/EntityList.d.ts +97 -0
  70. package/dist/components/marketing/EntityList.d.ts.map +1 -0
  71. package/dist/components/marketing/FormBlock.d.ts +167 -0
  72. package/dist/components/marketing/FormBlock.d.ts.map +1 -0
  73. package/dist/components/marketing/HeroSection.d.ts +125 -0
  74. package/dist/components/marketing/HeroSection.d.ts.map +1 -0
  75. package/dist/components/marketing/MediaCarousel.d.ts +135 -0
  76. package/dist/components/marketing/MediaCarousel.d.ts.map +1 -0
  77. package/dist/components/marketing/MiscSections.d.ts +252 -0
  78. package/dist/components/marketing/MiscSections.d.ts.map +1 -0
  79. package/dist/components/order/OrderTrackingTimeline.d.ts.map +1 -0
  80. package/dist/components/order/SuccessMark.d.ts +10 -0
  81. package/dist/components/order/SuccessMark.d.ts.map +1 -0
  82. package/dist/components/product/ProductCard.d.ts +14 -0
  83. package/dist/components/product/ProductCard.d.ts.map +1 -0
  84. package/dist/components/product/ProductEnquiryForm.d.ts.map +1 -0
  85. package/dist/components/product/ProductGallery.d.ts +36 -0
  86. package/dist/components/product/ProductGallery.d.ts.map +1 -0
  87. package/dist/components/{ProductOptionSelector.d.ts → product/ProductOptionSelector.d.ts} +1 -1
  88. package/dist/components/product/ProductOptionSelector.d.ts.map +1 -0
  89. package/dist/components/product/ProductRail.d.ts +93 -0
  90. package/dist/components/product/ProductRail.d.ts.map +1 -0
  91. package/dist/components/product/ProductReviews.d.ts +39 -0
  92. package/dist/components/product/ProductReviews.d.ts.map +1 -0
  93. package/dist/components/product/ProductSlider.d.ts +169 -0
  94. package/dist/components/product/ProductSlider.d.ts.map +1 -0
  95. package/dist/components/product/ProductSpecs.d.ts.map +1 -0
  96. package/dist/components/product/RelatedProducts.d.ts.map +1 -0
  97. package/dist/{auth.d.ts → data/auth.d.ts} +9 -0
  98. package/dist/data/auth.d.ts.map +1 -0
  99. package/dist/data/facets.d.ts +39 -0
  100. package/dist/data/facets.d.ts.map +1 -0
  101. package/dist/data/loaders.d.ts +52 -0
  102. package/dist/data/loaders.d.ts.map +1 -0
  103. package/dist/data/local-orders.d.ts +5 -0
  104. package/dist/data/local-orders.d.ts.map +1 -0
  105. package/dist/data/order-status.d.ts.map +1 -0
  106. package/dist/data/product-options.d.ts +36 -0
  107. package/dist/data/product-options.d.ts.map +1 -0
  108. package/dist/data/shipping-items.d.ts +20 -0
  109. package/dist/data/shipping-items.d.ts.map +1 -0
  110. package/dist/diagnostics/seo-audit.d.ts +54 -0
  111. package/dist/diagnostics/seo-audit.d.ts.map +1 -0
  112. package/dist/diagnostics/seo-audit.js +3 -0
  113. package/dist/diagnostics/seo-audit.js.map +1 -0
  114. package/dist/document/change.d.ts +100 -0
  115. package/dist/document/change.d.ts.map +1 -0
  116. package/dist/document/config.d.ts +311 -0
  117. package/dist/document/config.d.ts.map +1 -0
  118. package/dist/document/describe.d.ts +135 -0
  119. package/dist/document/describe.d.ts.map +1 -0
  120. package/dist/document/overlay.d.ts +58 -0
  121. package/dist/document/overlay.d.ts.map +1 -0
  122. package/dist/{presets.d.ts → document/presets.d.ts} +2 -2
  123. package/dist/document/presets.d.ts.map +1 -0
  124. package/dist/document/render.d.ts +171 -0
  125. package/dist/document/render.d.ts.map +1 -0
  126. package/dist/document/round-trip.d.ts +46 -0
  127. package/dist/document/round-trip.d.ts.map +1 -0
  128. package/dist/document/sections.d.ts +194 -0
  129. package/dist/document/sections.d.ts.map +1 -0
  130. package/dist/document/store-policy.d.ts +29 -0
  131. package/dist/document/store-policy.d.ts.map +1 -0
  132. package/dist/document/upgrade.d.ts +112 -0
  133. package/dist/document/upgrade.d.ts.map +1 -0
  134. package/dist/document/validate.d.ts +24 -0
  135. package/dist/document/validate.d.ts.map +1 -0
  136. package/dist/{component-contracts.d.ts → extend/component-contracts.d.ts} +74 -22
  137. package/dist/extend/component-contracts.d.ts.map +1 -0
  138. package/dist/extend/component-override.d.ts +38 -0
  139. package/dist/extend/component-override.d.ts.map +1 -0
  140. package/dist/extend/component-selectors.d.ts.map +1 -0
  141. package/dist/extend/editor-bridge.d.ts +59 -0
  142. package/dist/extend/editor-bridge.d.ts.map +1 -0
  143. package/dist/extend/extension-points.d.ts +103 -0
  144. package/dist/extend/extension-points.d.ts.map +1 -0
  145. package/dist/extend/slots.d.ts +216 -0
  146. package/dist/extend/slots.d.ts.map +1 -0
  147. package/dist/hooks/index.d.ts +25 -6
  148. package/dist/hooks/index.d.ts.map +1 -1
  149. package/dist/hooks/use-address.d.ts +26 -0
  150. package/dist/hooks/use-address.d.ts.map +1 -0
  151. package/dist/hooks/use-cart.d.ts +3 -0
  152. package/dist/hooks/use-cart.d.ts.map +1 -0
  153. package/dist/hooks/use-catalog.d.ts +24 -0
  154. package/dist/hooks/use-catalog.d.ts.map +1 -0
  155. package/dist/hooks/use-categories.d.ts +19 -0
  156. package/dist/hooks/use-categories.d.ts.map +1 -0
  157. package/dist/hooks/use-checkout.d.ts +41 -0
  158. package/dist/hooks/use-checkout.d.ts.map +1 -0
  159. package/dist/hooks/use-discount-validator.d.ts +20 -0
  160. package/dist/hooks/use-discount-validator.d.ts.map +1 -0
  161. package/dist/hooks/use-enquiry.d.ts +7 -0
  162. package/dist/hooks/use-enquiry.d.ts.map +1 -0
  163. package/dist/hooks/{useMyOrders.d.ts → use-my-orders.d.ts} +1 -1
  164. package/dist/hooks/use-my-orders.d.ts.map +1 -0
  165. package/dist/hooks/use-order.d.ts +17 -0
  166. package/dist/hooks/use-order.d.ts.map +1 -0
  167. package/dist/hooks/use-payment-methods.d.ts +19 -0
  168. package/dist/hooks/use-payment-methods.d.ts.map +1 -0
  169. package/dist/hooks/use-policies.d.ts +25 -0
  170. package/dist/hooks/use-policies.d.ts.map +1 -0
  171. package/dist/hooks/use-product.d.ts +15 -0
  172. package/dist/hooks/use-product.d.ts.map +1 -0
  173. package/dist/hooks/{useProducts.d.ts → use-products.d.ts} +1 -1
  174. package/dist/hooks/use-products.d.ts.map +1 -0
  175. package/dist/hooks/use-region.d.ts +15 -0
  176. package/dist/hooks/use-region.d.ts.map +1 -0
  177. package/dist/hooks/use-shipping.d.ts +32 -0
  178. package/dist/hooks/use-shipping.d.ts.map +1 -0
  179. package/dist/hooks/use-storefront-actions.d.ts +12 -0
  180. package/dist/hooks/use-storefront-actions.d.ts.map +1 -0
  181. package/dist/hooks/use-storefront-head.d.ts +19 -0
  182. package/dist/hooks/use-storefront-head.d.ts.map +1 -0
  183. package/dist/hooks/use-storefront.d.ts +3 -0
  184. package/dist/hooks/use-storefront.d.ts.map +1 -0
  185. package/dist/index.d.ts +124 -54
  186. package/dist/index.d.ts.map +1 -1
  187. package/dist/index.js +1310 -5010
  188. package/dist/index.js.map +1 -1
  189. package/dist/lib/errors.d.ts +9 -0
  190. package/dist/lib/errors.d.ts.map +1 -0
  191. package/dist/lib/format.d.ts.map +1 -0
  192. package/dist/lib/motion.d.ts.map +1 -0
  193. package/dist/lib/seo.d.ts +26 -0
  194. package/dist/lib/seo.d.ts.map +1 -0
  195. package/dist/{testids.d.ts → lib/testids.d.ts} +33 -0
  196. package/dist/lib/testids.d.ts.map +1 -0
  197. package/dist/{theme.d.ts → lib/theme.d.ts} +41 -3
  198. package/dist/lib/theme.d.ts.map +1 -0
  199. package/dist/render.d.ts +5 -0
  200. package/dist/render.d.ts.map +1 -0
  201. package/dist/render.js +359 -0
  202. package/dist/render.js.map +1 -0
  203. package/dist/stores/cart.store.d.ts +34 -2
  204. package/dist/stores/cart.store.d.ts.map +1 -1
  205. package/dist/stores/catalog.store.d.ts +11 -0
  206. package/dist/stores/catalog.store.d.ts.map +1 -1
  207. package/dist/stores/delivery.store.d.ts +9 -0
  208. package/dist/stores/delivery.store.d.ts.map +1 -1
  209. package/dist/views/CatalogPage.d.ts.map +1 -0
  210. package/dist/views/CheckoutPage.d.ts.map +1 -0
  211. package/dist/views/ContentPage.d.ts +11 -0
  212. package/dist/views/ContentPage.d.ts.map +1 -0
  213. package/dist/views/HomePage.d.ts +9 -0
  214. package/dist/views/HomePage.d.ts.map +1 -0
  215. package/dist/views/MyPurchasesPage.d.ts.map +1 -0
  216. package/dist/views/NotFoundPage.d.ts.map +1 -0
  217. package/dist/views/OrderConfirmationPage.d.ts.map +1 -0
  218. package/dist/{pages → views}/PolicyPage.d.ts.map +1 -1
  219. package/dist/views/ProductDetailPage.d.ts.map +1 -0
  220. package/dist/views/StorefrontPage.d.ts +35 -0
  221. package/dist/views/StorefrontPage.d.ts.map +1 -0
  222. package/dist/workflows/checkout.d.ts +1 -1
  223. package/dist/workflows/checkout.d.ts.map +1 -1
  224. package/package.json +21 -14
  225. package/dist/auth.d.ts.map +0 -1
  226. package/dist/blocks.d.ts.map +0 -1
  227. package/dist/component-contracts.d.ts.map +0 -1
  228. package/dist/component-selectors.d.ts.map +0 -1
  229. package/dist/components/CartDrawer.d.ts.map +0 -1
  230. package/dist/components/CustomerAccountShell.d.ts +0 -13
  231. package/dist/components/CustomerAccountShell.d.ts.map +0 -1
  232. package/dist/components/DeliveryEstimator.d.ts.map +0 -1
  233. package/dist/components/FiltersPanel.d.ts +0 -3
  234. package/dist/components/FiltersPanel.d.ts.map +0 -1
  235. package/dist/components/OrderTrackingTimeline.d.ts.map +0 -1
  236. package/dist/components/ProductCard.d.ts +0 -4
  237. package/dist/components/ProductCard.d.ts.map +0 -1
  238. package/dist/components/ProductEnquiryForm.d.ts.map +0 -1
  239. package/dist/components/ProductGallery.d.ts +0 -22
  240. package/dist/components/ProductGallery.d.ts.map +0 -1
  241. package/dist/components/ProductGrid.d.ts.map +0 -1
  242. package/dist/components/ProductOptionSelector.d.ts.map +0 -1
  243. package/dist/components/ProductSpecs.d.ts.map +0 -1
  244. package/dist/components/QuantityInput.d.ts.map +0 -1
  245. package/dist/components/RelatedProducts.d.ts.map +0 -1
  246. package/dist/components/SignInModal.d.ts.map +0 -1
  247. package/dist/components/StorefrontErrorBoundary.d.ts.map +0 -1
  248. package/dist/components/StorefrontFooter.d.ts.map +0 -1
  249. package/dist/components/StorefrontHeader.d.ts.map +0 -1
  250. package/dist/components/Toaster.d.ts.map +0 -1
  251. package/dist/components/sections/CategoryShowcase.d.ts +0 -6
  252. package/dist/components/sections/CategoryShowcase.d.ts.map +0 -1
  253. package/dist/components/sections/HeroSection.d.ts +0 -9
  254. package/dist/components/sections/HeroSection.d.ts.map +0 -1
  255. package/dist/components/sections/MediaCarousel.d.ts +0 -11
  256. package/dist/components/sections/MediaCarousel.d.ts.map +0 -1
  257. package/dist/components/sections/MiscSections.d.ts +0 -33
  258. package/dist/components/sections/MiscSections.d.ts.map +0 -1
  259. package/dist/components/sections/ProductRail.d.ts +0 -9
  260. package/dist/components/sections/ProductRail.d.ts.map +0 -1
  261. package/dist/components/sections/ProductSlider.d.ts +0 -15
  262. package/dist/components/sections/ProductSlider.d.ts.map +0 -1
  263. package/dist/config.d.ts +0 -174
  264. package/dist/config.d.ts.map +0 -1
  265. package/dist/createStorefrontApp.d.ts +0 -28
  266. package/dist/createStorefrontApp.d.ts.map +0 -1
  267. package/dist/define.d.ts.map +0 -1
  268. package/dist/format.d.ts.map +0 -1
  269. package/dist/hooks/useCategories.d.ts +0 -6
  270. package/dist/hooks/useCategories.d.ts.map +0 -1
  271. package/dist/hooks/useDiscountValidator.d.ts +0 -14
  272. package/dist/hooks/useDiscountValidator.d.ts.map +0 -1
  273. package/dist/hooks/useMyOrders.d.ts.map +0 -1
  274. package/dist/hooks/useProduct.d.ts +0 -7
  275. package/dist/hooks/useProduct.d.ts.map +0 -1
  276. package/dist/hooks/useProducts.d.ts.map +0 -1
  277. package/dist/hooks/useStorefront.d.ts +0 -35
  278. package/dist/hooks/useStorefront.d.ts.map +0 -1
  279. package/dist/hooks/useStorefrontHead.d.ts +0 -11
  280. package/dist/hooks/useStorefrontHead.d.ts.map +0 -1
  281. package/dist/motion.d.ts.map +0 -1
  282. package/dist/order-status.d.ts.map +0 -1
  283. package/dist/pages/CatalogPage.d.ts.map +0 -1
  284. package/dist/pages/CheckoutPage.d.ts.map +0 -1
  285. package/dist/pages/HomePage.d.ts +0 -9
  286. package/dist/pages/HomePage.d.ts.map +0 -1
  287. package/dist/pages/MyPurchasesPage.d.ts.map +0 -1
  288. package/dist/pages/NotFoundPage.d.ts.map +0 -1
  289. package/dist/pages/OrderConfirmationPage.d.ts.map +0 -1
  290. package/dist/pages/ProductDetailPage.d.ts.map +0 -1
  291. package/dist/presets.d.ts.map +0 -1
  292. package/dist/product-options.d.ts +0 -12
  293. package/dist/product-options.d.ts.map +0 -1
  294. package/dist/router.d.ts.map +0 -1
  295. package/dist/scaffold.d.ts.map +0 -1
  296. package/dist/sections.d.ts.map +0 -1
  297. package/dist/testids.d.ts.map +0 -1
  298. package/dist/theme.d.ts.map +0 -1
  299. package/src/auth.ts +0 -227
  300. package/src/blocks.tsx +0 -51
  301. package/src/catalog.ts +0 -3
  302. package/src/component-contracts.ts +0 -154
  303. package/src/component-selectors.ts +0 -31
  304. package/src/components/CartDrawer.tsx +0 -279
  305. package/src/components/CustomerAccountShell.tsx +0 -102
  306. package/src/components/DeliveryEstimator.tsx +0 -157
  307. package/src/components/FiltersPanel.tsx +0 -109
  308. package/src/components/OrderTrackingTimeline.tsx +0 -135
  309. package/src/components/Price.tsx +0 -32
  310. package/src/components/ProductCard.tsx +0 -120
  311. package/src/components/ProductEnquiryForm.tsx +0 -175
  312. package/src/components/ProductGallery.tsx +0 -174
  313. package/src/components/ProductGrid.tsx +0 -43
  314. package/src/components/ProductOptionSelector.tsx +0 -50
  315. package/src/components/ProductSpecs.tsx +0 -75
  316. package/src/components/QuantityInput.tsx +0 -52
  317. package/src/components/RelatedProducts.tsx +0 -40
  318. package/src/components/SignInModal.tsx +0 -120
  319. package/src/components/SmoothImage.tsx +0 -59
  320. package/src/components/StorefrontErrorBoundary.tsx +0 -51
  321. package/src/components/StorefrontFooter.tsx +0 -110
  322. package/src/components/StorefrontHeader.tsx +0 -477
  323. package/src/components/Toaster.tsx +0 -60
  324. package/src/components/sections/CategoryShowcase.tsx +0 -80
  325. package/src/components/sections/HeroSection.tsx +0 -193
  326. package/src/components/sections/MediaCarousel.tsx +0 -141
  327. package/src/components/sections/MiscSections.tsx +0 -158
  328. package/src/components/sections/ProductRail.tsx +0 -81
  329. package/src/components/sections/ProductSlider.tsx +0 -119
  330. package/src/config.ts +0 -229
  331. package/src/createStorefrontApp.tsx +0 -247
  332. package/src/define.ts +0 -34
  333. package/src/format.ts +0 -7
  334. package/src/hooks/index.ts +0 -6
  335. package/src/hooks/useCategories.ts +0 -26
  336. package/src/hooks/useDiscountValidator.ts +0 -43
  337. package/src/hooks/useMyOrders.ts +0 -41
  338. package/src/hooks/useProduct.ts +0 -36
  339. package/src/hooks/useProducts.ts +0 -39
  340. package/src/hooks/useStorefront.ts +0 -58
  341. package/src/hooks/useStorefrontHead.ts +0 -25
  342. package/src/index.ts +0 -202
  343. package/src/motion.tsx +0 -94
  344. package/src/order-status.ts +0 -33
  345. package/src/pages/CatalogPage.tsx +0 -118
  346. package/src/pages/CheckoutPage.tsx +0 -689
  347. package/src/pages/HomePage.tsx +0 -16
  348. package/src/pages/MyPurchasesPage.tsx +0 -311
  349. package/src/pages/NotFoundPage.tsx +0 -25
  350. package/src/pages/OrderConfirmationPage.tsx +0 -190
  351. package/src/pages/PolicyPage.tsx +0 -47
  352. package/src/pages/ProductDetailPage.tsx +0 -264
  353. package/src/presets.ts +0 -324
  354. package/src/product-options.ts +0 -63
  355. package/src/router.ts +0 -49
  356. package/src/scaffold.tsx +0 -115
  357. package/src/sections.ts +0 -116
  358. package/src/shop.ts +0 -4
  359. package/src/stores/cart.store.ts +0 -185
  360. package/src/stores/catalog.store.ts +0 -39
  361. package/src/stores/delivery.store.ts +0 -152
  362. package/src/stores/session.store.ts +0 -28
  363. package/src/stores/toast.store.ts +0 -43
  364. package/src/testids.ts +0 -136
  365. package/src/theme.ts +0 -194
  366. package/src/ui.ts +0 -5
  367. package/src/workflows/checkout.ts +0 -119
  368. /package/dist/components/{SignInModal.d.ts → account/SignInModal.d.ts} +0 -0
  369. /package/dist/components/{CartDrawer.d.ts → cart/CartDrawer.d.ts} +0 -0
  370. /package/dist/components/{QuantityInput.d.ts → cart/QuantityInput.d.ts} +0 -0
  371. /package/dist/components/{DeliveryEstimator.d.ts → checkout/DeliveryEstimator.d.ts} +0 -0
  372. /package/dist/components/{ProductGrid.d.ts → collection/ProductGrid.d.ts} +0 -0
  373. /package/dist/components/{StorefrontErrorBoundary.d.ts → layout/StorefrontErrorBoundary.d.ts} +0 -0
  374. /package/dist/components/{StorefrontFooter.d.ts → layout/StorefrontFooter.d.ts} +0 -0
  375. /package/dist/components/{StorefrontHeader.d.ts → layout/StorefrontHeader.d.ts} +0 -0
  376. /package/dist/components/{Toaster.d.ts → layout/Toaster.d.ts} +0 -0
  377. /package/dist/components/{OrderTrackingTimeline.d.ts → order/OrderTrackingTimeline.d.ts} +0 -0
  378. /package/dist/components/{ProductEnquiryForm.d.ts → product/ProductEnquiryForm.d.ts} +0 -0
  379. /package/dist/components/{ProductSpecs.d.ts → product/ProductSpecs.d.ts} +0 -0
  380. /package/dist/components/{RelatedProducts.d.ts → product/RelatedProducts.d.ts} +0 -0
  381. /package/dist/{order-status.d.ts → data/order-status.d.ts} +0 -0
  382. /package/dist/{component-selectors.d.ts → extend/component-selectors.d.ts} +0 -0
  383. /package/dist/{format.d.ts → lib/format.d.ts} +0 -0
  384. /package/dist/{motion.d.ts → lib/motion.d.ts} +0 -0
  385. /package/dist/{pages → views}/CatalogPage.d.ts +0 -0
  386. /package/dist/{pages → views}/CheckoutPage.d.ts +0 -0
  387. /package/dist/{pages → views}/MyPurchasesPage.d.ts +0 -0
  388. /package/dist/{pages → views}/NotFoundPage.d.ts +0 -0
  389. /package/dist/{pages → views}/OrderConfirmationPage.d.ts +0 -0
  390. /package/dist/{pages → views}/PolicyPage.d.ts +0 -0
  391. /package/dist/{pages → views}/ProductDetailPage.d.ts +0 -0
@@ -1,43 +0,0 @@
1
- import { useCallback } from 'react'
2
- import { validateDiscount } from '@fayz-ai/shop'
3
- import { useStorefrontConfig } from '../config'
4
-
5
- export interface DiscountValidation {
6
- valid: boolean
7
- percent: number
8
- message?: string
9
- }
10
-
11
- const REASON_MESSAGE: Record<string, string> = {
12
- expired: 'Cupom expirado.',
13
- not_started: 'Cupom ainda não está ativo.',
14
- usage_limit: 'Cupom esgotado.',
15
- not_found: 'Cupom inválido ou expirado.',
16
- }
17
-
18
- /**
19
- * Storefront coupon validator. The store's own config.discounts (simple percent
20
- * codes) are trusted directly; everything else goes through the provider-backed
21
- * validateDiscount primitive, which enforces status/date-window/usage-limit.
22
- * The storefront cart models discounts as a percentage, so non-percentage codes
23
- * are rejected for client-side preview (the server still honors them at checkout).
24
- */
25
- export function useDiscountValidator(): (code: string) => Promise<DiscountValidation> {
26
- const config = useStorefrontConfig()
27
- return useCallback(async (code: string) => {
28
- const normalized = code.trim().toUpperCase()
29
- if (!normalized) return { valid: false, percent: 0, message: 'Informe um cupom.' }
30
-
31
- const configDiscount = config.discounts?.find((d) => d.code.trim().toUpperCase() === normalized)
32
- if (configDiscount) return { valid: true, percent: configDiscount.percent }
33
-
34
- const validation = await validateDiscount({ code: normalized })
35
- if (!validation.valid) {
36
- return { valid: false, percent: 0, message: REASON_MESSAGE[validation.reason ?? 'not_found'] ?? 'Cupom inválido ou expirado.' }
37
- }
38
- if (validation.type !== 'percentage') {
39
- return { valid: false, percent: 0, message: 'Este cupom não é suportado na loja.' }
40
- }
41
- return { valid: true, percent: validation.value }
42
- }, [config.discounts])
43
- }
@@ -1,41 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react'
2
- import { getShopProvider } from '@fayz-ai/shop/runtime'
3
- import type { Order } from '@fayz-ai/shop/types'
4
- import { useSessionStore } from '../stores/session.store'
5
-
6
- export function useMyOrders(): { orders: Order[]; loading: boolean; refresh: () => void } {
7
- const customerId = useSessionStore((s) => s.customerId)
8
- const email = useSessionStore((s) => s.email)
9
- const [orders, setOrders] = useState<Order[]>([])
10
- const [loading, setLoading] = useState(true)
11
- const [tick, setTick] = useState(0)
12
-
13
- const refresh = useCallback(() => setTick((t) => t + 1), [])
14
-
15
- useEffect(() => {
16
- let cancelled = false
17
- if (!customerId && !email) {
18
- setOrders([])
19
- setLoading(false)
20
- return
21
- }
22
- setLoading(true)
23
- // Scope by customerId (RLS-enforced to the owner on Supabase) when available;
24
- // fall back to email only for legacy sessions without a linked customer.
25
- const query = customerId ? { customerId, limit: 50 } : { customerEmail: email!, limit: 50 }
26
- getShopProvider()
27
- .listOrders(query)
28
- .then((data) => {
29
- if (!cancelled) setOrders(data)
30
- })
31
- .catch(() => {})
32
- .finally(() => {
33
- if (!cancelled) setLoading(false)
34
- })
35
- return () => {
36
- cancelled = true
37
- }
38
- }, [customerId, email, tick])
39
-
40
- return { orders, loading, refresh }
41
- }
@@ -1,36 +0,0 @@
1
- import { useEffect, useState } from 'react'
2
- import { getShopProvider } from '@fayz-ai/shop/runtime'
3
- import type { Product } from '@fayz-ai/shop/types'
4
-
5
- export function useProduct(slug: string): {
6
- product: Product | null
7
- loading: boolean
8
- error: string | null
9
- } {
10
- const [product, setProduct] = useState<Product | null>(null)
11
- const [loading, setLoading] = useState(true)
12
- const [error, setError] = useState<string | null>(null)
13
-
14
- useEffect(() => {
15
- let cancelled = false
16
- setLoading(true)
17
- getShopProvider()
18
- .listProducts({ slug, status: 'active', limit: 1 })
19
- .then((data) => {
20
- if (cancelled) return
21
- setProduct(data[0] ?? null)
22
- setError(null)
23
- })
24
- .catch((e: unknown) => {
25
- if (!cancelled) setError(e instanceof Error ? e.message : String(e))
26
- })
27
- .finally(() => {
28
- if (!cancelled) setLoading(false)
29
- })
30
- return () => {
31
- cancelled = true
32
- }
33
- }, [slug])
34
-
35
- return { product, loading, error }
36
- }
@@ -1,39 +0,0 @@
1
- import { useEffect, useState } from 'react'
2
- import { getShopProvider } from '@fayz-ai/shop/runtime'
3
- import type { Product, ListProductsOptions } from '@fayz-ai/shop/types'
4
-
5
- export function useProducts(opts: ListProductsOptions): {
6
- products: Product[]
7
- loading: boolean
8
- error: string | null
9
- reload: () => void
10
- } {
11
- const [products, setProducts] = useState<Product[]>([])
12
- const [loading, setLoading] = useState(true)
13
- const [error, setError] = useState<string | null>(null)
14
- const [nonce, setNonce] = useState(0)
15
- const key = JSON.stringify(opts)
16
-
17
- useEffect(() => {
18
- let cancelled = false
19
- setLoading(true)
20
- getShopProvider()
21
- .listProducts(JSON.parse(key) as ListProductsOptions)
22
- .then((data) => {
23
- if (cancelled) return
24
- setProducts(data)
25
- setError(null)
26
- })
27
- .catch((e: unknown) => {
28
- if (!cancelled) setError(e instanceof Error ? e.message : String(e))
29
- })
30
- .finally(() => {
31
- if (!cancelled) setLoading(false)
32
- })
33
- return () => {
34
- cancelled = true
35
- }
36
- }, [key, nonce])
37
-
38
- return { products, loading, error, reload: () => setNonce((n) => n + 1) }
39
- }
@@ -1,58 +0,0 @@
1
- import { getShopProvider } from '@fayz-ai/shop/runtime'
2
- import type { CreateProductEnquiryInput } from '@fayz-ai/shop/types'
3
- import { useStorefrontConfig } from '../config'
4
- import { navigateTo } from '../router'
5
- import { useCatalogStore } from '../stores/catalog.store'
6
- import { useCartStore } from '../stores/cart.store'
7
- import type { ProductOptionSelection } from '../product-options'
8
- import type { Product } from '@fayz-ai/shop/types'
9
-
10
- export function useStorefront() {
11
- return useStorefrontConfig()
12
- }
13
-
14
- export function useCatalog() {
15
- const config = useStorefrontConfig()
16
- const catalog = useCatalogStore()
17
- return {
18
- ...catalog,
19
- catalogPath: config.catalogPath,
20
- config,
21
- }
22
- }
23
-
24
- export function useCart() {
25
- return useCartStore()
26
- }
27
-
28
- export function useEnquiry() {
29
- const config = useStorefrontConfig()
30
- const createProductEnquiry = async (input: CreateProductEnquiryInput) => {
31
- const provider = getShopProvider()
32
- if (!provider.createProductEnquiry) {
33
- throw new Error('The active shop provider does not support product enquiries.')
34
- }
35
- return provider.createProductEnquiry(input)
36
- }
37
-
38
- return {
39
- enquiry: config.enquiry,
40
- createProductEnquiry,
41
- }
42
- }
43
-
44
- export function useStorefrontActions() {
45
- const addItem = useCartStore((state) => state.addItem)
46
- const openDrawer = useCartStore((state) => state.openDrawer)
47
- const closeDrawer = useCartStore((state) => state.closeDrawer)
48
- const { createProductEnquiry } = useEnquiry()
49
-
50
- return {
51
- navigateTo,
52
- addToCart: (product: Product, quantity?: number, options?: ProductOptionSelection) =>
53
- addItem(product, quantity, options),
54
- openCart: openDrawer,
55
- closeCart: closeDrawer,
56
- createProductEnquiry,
57
- }
58
- }
@@ -1,25 +0,0 @@
1
- import { useEffect } from 'react'
2
-
3
- /**
4
- * Minimal per-route head manager: sets document.title and meta description so
5
- * each storefront page (product, catalog, account, checkout) has its own title
6
- * and shareable description instead of one static SPA title. A real SSR/prerender
7
- * pass (M12) layers OG/canonical on top; this covers the client-rendered baseline.
8
- */
9
- export function useStorefrontHead(input: { title?: string; description?: string | null }): void {
10
- const { title, description } = input
11
- useEffect(() => {
12
- if (title) document.title = title
13
- }, [title])
14
-
15
- useEffect(() => {
16
- if (!description) return
17
- let tag = document.head.querySelector<HTMLMetaElement>('meta[name="description"]')
18
- if (!tag) {
19
- tag = document.createElement('meta')
20
- tag.setAttribute('name', 'description')
21
- document.head.appendChild(tag)
22
- }
23
- tag.setAttribute('content', description.slice(0, 160))
24
- }, [description])
25
- }
package/src/index.ts DELETED
@@ -1,202 +0,0 @@
1
- // Factory
2
- export { createStorefront, createStorefrontApp, initStorefrontRuntime, StorefrontShell } from './createStorefrontApp'
3
- export type { CreateStorefrontOptions } from './createStorefrontApp'
4
- export {
5
- defineStorefrontConfig,
6
- defineStorefrontComponents,
7
- defineStorefrontRoutes,
8
- defineStorefrontSections,
9
- defineStorefrontApp,
10
- } from './define'
11
- export type {
12
- StorefrontConfig,
13
- ResolvedStorefrontConfig,
14
- StorefrontRouteComponentProps,
15
- StorefrontRouteChrome,
16
- StorefrontCommerceMode,
17
- StorefrontImageLoadingConfig,
18
- StorefrontImageLoadingMode,
19
- StorefrontRouteDefinition,
20
- StorefrontRouteKind,
21
- StorefrontRouteParams,
22
- StorefrontEnquiryConfig,
23
- } from './config'
24
- export type {
25
- StorefrontActions,
26
- StorefrontComponents,
27
- ProductCardProps,
28
- ProductDetailProps,
29
- ProductGalleryProps,
30
- ProductPriceProps,
31
- ProductActionsProps,
32
- ProductEnquiryFormContractProps,
33
- CategoryCardProps,
34
- CollectionSectionProps,
35
- HeroSectionContractProps,
36
- MediaCarouselProps as MediaCarouselContractProps,
37
- ProductSliderProps as ProductSliderContractProps,
38
- StorefrontChromeProps,
39
- StorefrontStateProps,
40
- } from './component-contracts'
41
- export { useStorefrontConfig, useStorefrontConfigOptional } from './config'
42
-
43
- // Manifest path (renderApp(defineStorefront(config)) / storefront scaffold)
44
- export { defineStorefront, StorefrontScaffold } from './scaffold'
45
-
46
- // Block system (storefront sections as registry blocks)
47
- export { registerStorefrontBlocks, sectionsToBlocks } from './blocks'
48
-
49
- // Routing
50
- export { Link, navigateTo, useHashPath, matchPath } from './router'
51
- export type { LinkProps } from './router'
52
-
53
- // Stores
54
- export {
55
- useCartStore,
56
- selectCount,
57
- selectSubtotal,
58
- selectDiscountTotal,
59
- selectShipping,
60
- selectTotal,
61
- } from './stores/cart.store'
62
- export type { CartLine, CartState } from './stores/cart.store'
63
- export { useSessionStore } from './stores/session.store'
64
- export type { SessionState } from './stores/session.store'
65
- export {
66
- signInByEmail,
67
- signUpCustomer,
68
- establishCustomerSession,
69
- signOutCustomer,
70
- getCustomerAuthAdapter,
71
- resolveAuthAdapter,
72
- } from './auth'
73
- export type { StorefrontAuthAdapter, StorefrontAuthConfig, EstablishSessionOptions } from './auth'
74
- export { useCatalogStore } from './stores/catalog.store'
75
- export type { CatalogState, CatalogSort } from './stores/catalog.store'
76
-
77
- // Hooks
78
- export {
79
- useProducts,
80
- useProduct,
81
- useCategories,
82
- useStorefront,
83
- useCatalog,
84
- useCart,
85
- useEnquiry,
86
- useStorefrontActions,
87
- useMyOrders,
88
- useDiscountValidator,
89
- } from './hooks'
90
-
91
- // Components (for custom layouts)
92
- export { StorefrontHeader } from './components/StorefrontHeader'
93
- export { SmoothImage } from './components/SmoothImage'
94
- export type { SmoothImageProps } from './components/SmoothImage'
95
- export { ProductCard } from './components/ProductCard'
96
- export { ProductEnquiryForm } from './components/ProductEnquiryForm'
97
- export type { ProductEnquiryFormProps } from './components/ProductEnquiryForm'
98
- export { OrderTrackingTimeline } from './components/OrderTrackingTimeline'
99
- export { ProductGrid } from './components/ProductGrid'
100
- export { FiltersPanel } from './components/FiltersPanel'
101
- export { CartDrawer } from './components/CartDrawer'
102
- export { Price } from './components/Price'
103
- export { QuantityInput } from './components/QuantityInput'
104
- export { ProductOptionSelector } from './components/ProductOptionSelector'
105
- export type { ProductOptionSelectorProps } from './components/ProductOptionSelector'
106
- export {
107
- getProductOptionGroups,
108
- normalizeProductOptionSelection,
109
- formatProductOptionSelection,
110
- productOptionSelectionKey,
111
- } from './product-options'
112
- export type { ProductOptionGroup, ProductOptionSelection } from './product-options'
113
-
114
- // Pages (for custom routing)
115
- export { CatalogPage } from './pages/CatalogPage'
116
- export { ProductDetailPage } from './pages/ProductDetailPage'
117
- export { CheckoutPage } from './pages/CheckoutPage'
118
- export { OrderConfirmationPage } from './pages/OrderConfirmationPage'
119
- export { MyPurchasesPage } from './pages/MyPurchasesPage'
120
- export { placeStorefrontOrder } from './workflows/checkout'
121
- export type {
122
- PlaceStorefrontOrderInput,
123
- PlaceStorefrontOrderResult,
124
- StorefrontCheckoutAddress,
125
- StorefrontCheckoutCustomer,
126
- } from './workflows/checkout'
127
-
128
- // Theming + templates
129
- export { StorefrontThemeStyle, themeToCss } from './theme'
130
- export type {
131
- StorefrontTheme,
132
- StorefrontThemeColors,
133
- StorefrontThemeFont,
134
- StorefrontRadius,
135
- HeaderVariant,
136
- HeroVariant,
137
- CardStyle,
138
- } from './theme'
139
- export type { StorefrontSection, HomeSection, HomeConfig, HeroSlide, MediaCarouselItem, NavLink, FooterConfig } from './sections'
140
- export { bannerPlaceholder } from './sections'
141
- export {
142
- storefrontTemplates,
143
- mareTemplate,
144
- sertaoTemplate,
145
- voltTemplate,
146
- atelierTemplate,
147
- foodTemplate,
148
- } from './presets'
149
- export type { StorefrontTemplate, StorefrontTemplateId } from './presets'
150
-
151
- // Home sections (for custom compositions)
152
- export { HomePage, StorefrontSections } from './pages/HomePage'
153
- export { HeroSection } from './components/sections/HeroSection'
154
- export { MediaCarousel } from './components/sections/MediaCarousel'
155
- export type { MediaCarouselProps } from './components/sections/MediaCarousel'
156
- export { CategoryShowcase } from './components/sections/CategoryShowcase'
157
- export { ProductRail } from './components/sections/ProductRail'
158
- export { ProductSlider } from './components/sections/ProductSlider'
159
- export type { ProductSliderProps } from './components/sections/ProductSlider'
160
- export {
161
- BenefitsRow,
162
- PromoBanner,
163
- ManifestoBlock,
164
- Testimonials,
165
- NewsletterBand,
166
- } from './components/sections/MiscSections'
167
- export { StorefrontFooter } from './components/StorefrontFooter'
168
-
169
- // Motion (core animation primitives)
170
- export { Reveal, useInView, useScrolled, usePopOnChange, prefersReducedMotion } from './motion'
171
- export type { RevealProps } from './motion'
172
-
173
- // Utilities
174
- export { formatMoney, roundCents } from './format'
175
- export { TID } from './testids'
176
- export {
177
- productCardComponentContract,
178
- storefrontComponentContracts,
179
- } from './component-selectors'
180
- export type {
181
- ProductCardComponentContract,
182
- ProductDetailComponentContract,
183
- } from './component-selectors'
184
-
185
- // ---------------------------------------------------------------------------
186
- // Front-door re-exports: storefront apps depend on @fayz-ai/storefront alone.
187
- // Runtime helpers come from @fayz-ai/core; UI / shop catalog / shop provider
188
- // live on their own subpaths (./ui, ./catalog, ./shop) to keep module graphs
189
- // separate. Mirrors the @fayz-ai/saas front door.
190
- // ---------------------------------------------------------------------------
191
- // renderApp is wrapped (not re-exported) so the 'storefront' scaffold registers
192
- // on first render instead of at import time — keeps the barrel side-effect-free.
193
- import { renderApp as coreRenderApp } from '@fayz-ai/core'
194
- import { registerStorefrontScaffold } from './scaffold'
195
-
196
- export const renderApp: typeof coreRenderApp = (...args) => {
197
- registerStorefrontScaffold()
198
- return coreRenderApp(...args)
199
- }
200
-
201
- export { getSupabaseClientOptional } from '@fayz-ai/core'
202
- export { registerStorefrontScaffold } from './scaffold'
package/src/motion.tsx DELETED
@@ -1,94 +0,0 @@
1
- import React, { useEffect, useRef, useState } from 'react'
2
-
3
- // ---------------------------------------------------------------------------
4
- // Core motion primitives — every storefront inherits these; stores never
5
- // implement animation ad hoc. All effects respect prefers-reduced-motion.
6
- // ---------------------------------------------------------------------------
7
-
8
- export function prefersReducedMotion(): boolean {
9
- if (typeof window === 'undefined' || !window.matchMedia) return false
10
- return window.matchMedia('(prefers-reduced-motion: reduce)').matches
11
- }
12
-
13
- /** True once the element has entered the viewport (one-shot). */
14
- export function useInView<T extends HTMLElement>(margin = '0px 0px -8% 0px'): [React.RefObject<T>, boolean] {
15
- const ref = useRef<T>(null)
16
- const [inView, setInView] = useState(() => prefersReducedMotion())
17
-
18
- useEffect(() => {
19
- if (inView) return
20
- const el = ref.current
21
- if (!el || typeof IntersectionObserver === 'undefined') {
22
- setInView(true)
23
- return
24
- }
25
- const observer = new IntersectionObserver(
26
- (entries) => {
27
- if (entries.some((e) => e.isIntersecting)) {
28
- setInView(true)
29
- observer.disconnect()
30
- }
31
- },
32
- { rootMargin: margin },
33
- )
34
- observer.observe(el)
35
- return () => observer.disconnect()
36
- }, [inView, margin])
37
-
38
- return [ref, inView]
39
- }
40
-
41
- export interface RevealProps extends React.HTMLAttributes<HTMLDivElement> {
42
- /** Stagger delay in ms */
43
- delay?: number
44
- children: React.ReactNode
45
- }
46
-
47
- /** Plays a fade-up entrance when the element scrolls into view.
48
- * Content is VISIBLE by default — never pre-hidden — so screenshots,
49
- * crawlers and environments without IntersectionObserver always see it;
50
- * the animation's own from-state handles the fade. */
51
- export function Reveal({ delay = 0, children, className, style, ...rest }: RevealProps) {
52
- const [ref, inView] = useInView<HTMLDivElement>()
53
- return (
54
- <div
55
- ref={ref}
56
- className={`${inView ? 'animate-fade-up' : ''} ${className ?? ''}`}
57
- style={{ ...style, animationDelay: delay ? `${delay}ms` : undefined }}
58
- {...rest}
59
- >
60
- {children}
61
- </div>
62
- )
63
- }
64
-
65
- /** True after the window has scrolled past the threshold (header treatments). */
66
- export function useScrolled(threshold = 8): boolean {
67
- const [scrolled, setScrolled] = useState(false)
68
- useEffect(() => {
69
- const onScroll = () => setScrolled(window.scrollY > threshold)
70
- onScroll()
71
- window.addEventListener('scroll', onScroll, { passive: true })
72
- return () => window.removeEventListener('scroll', onScroll)
73
- }, [threshold])
74
- return scrolled
75
- }
76
-
77
- /** Re-triggers a CSS animation class whenever `value` changes (cart badge pop). */
78
- export function usePopOnChange(value: number): boolean {
79
- const [pop, setPop] = useState(false)
80
- const prev = useRef(value)
81
- useEffect(() => {
82
- if (prev.current !== value && value > 0) {
83
- setPop(true)
84
- const t = setTimeout(() => setPop(false), 400)
85
- return () => clearTimeout(t)
86
- }
87
- prev.current = value
88
- return undefined
89
- }, [value])
90
- useEffect(() => {
91
- prev.current = value
92
- })
93
- return pop
94
- }
@@ -1,33 +0,0 @@
1
- import type { FinancialStatus } from '@fayz-ai/shop/types'
2
-
3
- type Tone = 'positive' | 'pending' | 'negative'
4
-
5
- const FINANCIAL: Record<FinancialStatus, { label: string; tone: Tone }> = {
6
- pending: { label: 'Pendente', tone: 'pending' },
7
- paid: { label: 'Pago', tone: 'positive' },
8
- partially_paid: { label: 'Parcialmente pago', tone: 'pending' },
9
- partially_refunded: { label: 'Parcialmente reembolsado', tone: 'negative' },
10
- refunded: { label: 'Reembolsado', tone: 'negative' },
11
- voided: { label: 'Cancelado', tone: 'negative' },
12
- }
13
-
14
- const TONE_CLASS: Record<Tone, string> = {
15
- positive: 'bg-emerald-100 text-emerald-800',
16
- pending: 'bg-amber-100 text-amber-800',
17
- negative: 'bg-rose-100 text-rose-800',
18
- }
19
-
20
- /** One source of truth for a financial-status pill — label + color by status,
21
- * so a pending or refunded order never renders inside a green "success" pill. */
22
- export function financialStatusBadge(status: FinancialStatus): { label: string; className: string } {
23
- const entry = FINANCIAL[status] ?? { label: status, tone: 'pending' as Tone }
24
- return { label: entry.label, className: TONE_CLASS[entry.tone] }
25
- }
26
-
27
- export function isPaid(status: FinancialStatus): boolean {
28
- return status === 'paid' || status === 'partially_paid'
29
- }
30
-
31
- export function isRefunded(status: FinancialStatus): boolean {
32
- return status === 'refunded' || status === 'partially_refunded'
33
- }