@fayz-ai/storefront 0.9.0 → 0.10.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/README.md +3 -3
- package/dist/app/createStorefrontApp.d.ts +65 -0
- package/dist/app/createStorefrontApp.d.ts.map +1 -0
- package/dist/{define.d.ts → app/define.d.ts} +3 -3
- package/dist/app/define.d.ts.map +1 -0
- package/dist/app/hydration.d.ts +37 -0
- package/dist/app/hydration.d.ts.map +1 -0
- package/dist/app/prerender.d.ts +57 -0
- package/dist/app/prerender.d.ts.map +1 -0
- package/dist/{router.d.ts → app/router.d.ts} +140 -113
- package/dist/app/router.d.ts.map +1 -0
- package/dist/{scaffold.d.ts → app/scaffold.d.ts} +2 -2
- package/dist/app/scaffold.d.ts.map +1 -0
- package/dist/app/serving.d.ts +70 -0
- package/dist/app/serving.d.ts.map +1 -0
- package/dist/app/static-render.d.ts +46 -0
- package/dist/app/static-render.d.ts.map +1 -0
- package/dist/blocks/block-at-path.d.ts +59 -0
- package/dist/blocks/block-at-path.d.ts.map +1 -0
- package/dist/blocks/page-blocks.d.ts +163 -0
- package/dist/blocks/page-blocks.d.ts.map +1 -0
- package/dist/blocks/page-data.d.ts +105 -0
- package/dist/blocks/page-data.d.ts.map +1 -0
- package/dist/{blocks.d.ts → blocks/registry.d.ts} +1 -1
- package/dist/blocks/registry.d.ts.map +1 -0
- package/dist/{sections.d.ts → blocks/sections.d.ts} +40 -2
- package/dist/blocks/sections.d.ts.map +1 -0
- package/dist/chunk-6B7H3IZ6.js +10232 -0
- package/dist/chunk-6B7H3IZ6.js.map +1 -0
- package/dist/chunk-6IXTENLB.js +162 -0
- package/dist/chunk-6IXTENLB.js.map +1 -0
- package/dist/components/PaymentTerms.d.ts +34 -0
- package/dist/components/PaymentTerms.d.ts.map +1 -0
- package/dist/components/SmoothImage.d.ts +1 -1
- package/dist/components/SmoothImage.d.ts.map +1 -1
- package/dist/components/account/CustomerAccountShell.d.ts.map +1 -0
- package/dist/components/account/SignInModal.d.ts.map +1 -0
- package/dist/components/cart/CartDrawer.d.ts.map +1 -0
- package/dist/components/cart/QuantityInput.d.ts.map +1 -0
- package/dist/components/checkout/DeliveryEstimator.d.ts.map +1 -0
- package/dist/components/collection/CategoryShowcase.d.ts +44 -0
- package/dist/components/collection/CategoryShowcase.d.ts.map +1 -0
- package/dist/components/collection/FiltersPanel.d.ts +19 -0
- package/dist/components/collection/FiltersPanel.d.ts.map +1 -0
- package/dist/components/collection/ProductGrid.d.ts.map +1 -0
- package/dist/components/layout/PageBodyBlocks.d.ts +40 -0
- package/dist/components/layout/PageBodyBlocks.d.ts.map +1 -0
- package/dist/components/layout/SearchOverlay.d.ts +13 -0
- package/dist/components/layout/SearchOverlay.d.ts.map +1 -0
- package/dist/components/layout/StorefrontErrorBoundary.d.ts.map +1 -0
- package/dist/components/layout/StorefrontFooter.d.ts.map +1 -0
- package/dist/components/layout/StorefrontHeader.d.ts.map +1 -0
- package/dist/components/layout/Toaster.d.ts.map +1 -0
- package/dist/components/marketing/CollectionSections.d.ts +463 -0
- package/dist/components/marketing/CollectionSections.d.ts.map +1 -0
- package/dist/components/marketing/ConversionSections.d.ts +221 -0
- package/dist/components/marketing/ConversionSections.d.ts.map +1 -0
- package/dist/components/marketing/EditorialSections.d.ts +248 -0
- package/dist/components/marketing/EditorialSections.d.ts.map +1 -0
- package/dist/components/marketing/EntityList.d.ts +97 -0
- package/dist/components/marketing/EntityList.d.ts.map +1 -0
- package/dist/components/marketing/FormBlock.d.ts +167 -0
- package/dist/components/marketing/FormBlock.d.ts.map +1 -0
- package/dist/components/marketing/HeroSection.d.ts +125 -0
- package/dist/components/marketing/HeroSection.d.ts.map +1 -0
- package/dist/components/marketing/MediaCarousel.d.ts +135 -0
- package/dist/components/marketing/MediaCarousel.d.ts.map +1 -0
- package/dist/components/marketing/MiscSections.d.ts +252 -0
- package/dist/components/marketing/MiscSections.d.ts.map +1 -0
- package/dist/components/order/OrderTrackingTimeline.d.ts.map +1 -0
- package/dist/components/product/ProductCard.d.ts +14 -0
- package/dist/components/product/ProductCard.d.ts.map +1 -0
- package/dist/components/product/ProductEnquiryForm.d.ts.map +1 -0
- package/dist/components/product/ProductGallery.d.ts +36 -0
- package/dist/components/product/ProductGallery.d.ts.map +1 -0
- package/dist/components/{ProductOptionSelector.d.ts → product/ProductOptionSelector.d.ts} +1 -1
- package/dist/components/product/ProductOptionSelector.d.ts.map +1 -0
- package/dist/components/product/ProductRail.d.ts +93 -0
- package/dist/components/product/ProductRail.d.ts.map +1 -0
- package/dist/components/product/ProductReviews.d.ts +39 -0
- package/dist/components/product/ProductReviews.d.ts.map +1 -0
- package/dist/components/product/ProductSlider.d.ts +169 -0
- package/dist/components/product/ProductSlider.d.ts.map +1 -0
- package/dist/components/product/ProductSpecs.d.ts.map +1 -0
- package/dist/components/product/RelatedProducts.d.ts.map +1 -0
- package/dist/{auth.d.ts → data/auth.d.ts} +9 -0
- package/dist/data/auth.d.ts.map +1 -0
- package/dist/data/facets.d.ts +39 -0
- package/dist/data/facets.d.ts.map +1 -0
- package/dist/data/loaders.d.ts +56 -0
- package/dist/data/loaders.d.ts.map +1 -0
- package/dist/data/order-status.d.ts.map +1 -0
- package/dist/data/product-options.d.ts +36 -0
- package/dist/data/product-options.d.ts.map +1 -0
- package/dist/diagnostics/seo-audit.d.ts +54 -0
- package/dist/diagnostics/seo-audit.d.ts.map +1 -0
- package/dist/diagnostics/seo-audit.js +3 -0
- package/dist/diagnostics/seo-audit.js.map +1 -0
- package/dist/document/change.d.ts +100 -0
- package/dist/document/change.d.ts.map +1 -0
- package/dist/{config.d.ts → document/config.d.ts} +126 -7
- package/dist/document/config.d.ts.map +1 -0
- package/dist/document/describe.d.ts +135 -0
- package/dist/document/describe.d.ts.map +1 -0
- package/dist/document/overlay.d.ts +58 -0
- package/dist/document/overlay.d.ts.map +1 -0
- package/dist/{presets.d.ts → document/presets.d.ts} +2 -2
- package/dist/document/presets.d.ts.map +1 -0
- package/dist/document/render.d.ts +171 -0
- package/dist/document/render.d.ts.map +1 -0
- package/dist/document/round-trip.d.ts +46 -0
- package/dist/document/round-trip.d.ts.map +1 -0
- package/dist/document/sections.d.ts +194 -0
- package/dist/document/sections.d.ts.map +1 -0
- package/dist/document/upgrade.d.ts +112 -0
- package/dist/document/upgrade.d.ts.map +1 -0
- package/dist/document/validate.d.ts +24 -0
- package/dist/document/validate.d.ts.map +1 -0
- package/dist/{component-contracts.d.ts → extend/component-contracts.d.ts} +74 -22
- package/dist/extend/component-contracts.d.ts.map +1 -0
- package/dist/extend/component-override.d.ts +38 -0
- package/dist/extend/component-override.d.ts.map +1 -0
- package/dist/extend/component-selectors.d.ts.map +1 -0
- package/dist/extend/editor-bridge.d.ts +59 -0
- package/dist/extend/editor-bridge.d.ts.map +1 -0
- package/dist/extend/extension-points.d.ts +103 -0
- package/dist/extend/extension-points.d.ts.map +1 -0
- package/dist/extend/slots.d.ts +216 -0
- package/dist/extend/slots.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +25 -6
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/use-address.d.ts +26 -0
- package/dist/hooks/use-address.d.ts.map +1 -0
- package/dist/hooks/use-cart.d.ts +3 -0
- package/dist/hooks/use-cart.d.ts.map +1 -0
- package/dist/hooks/use-catalog.d.ts +24 -0
- package/dist/hooks/use-catalog.d.ts.map +1 -0
- package/dist/hooks/use-categories.d.ts +19 -0
- package/dist/hooks/use-categories.d.ts.map +1 -0
- package/dist/hooks/use-checkout.d.ts +41 -0
- package/dist/hooks/use-checkout.d.ts.map +1 -0
- package/dist/hooks/use-discount-validator.d.ts +20 -0
- package/dist/hooks/use-discount-validator.d.ts.map +1 -0
- package/dist/hooks/use-enquiry.d.ts +7 -0
- package/dist/hooks/use-enquiry.d.ts.map +1 -0
- package/dist/hooks/{useMyOrders.d.ts → use-my-orders.d.ts} +1 -1
- package/dist/hooks/use-my-orders.d.ts.map +1 -0
- package/dist/hooks/use-order.d.ts +17 -0
- package/dist/hooks/use-order.d.ts.map +1 -0
- package/dist/hooks/use-payment-methods.d.ts +19 -0
- package/dist/hooks/use-payment-methods.d.ts.map +1 -0
- package/dist/hooks/use-policies.d.ts +25 -0
- package/dist/hooks/use-policies.d.ts.map +1 -0
- package/dist/hooks/use-product.d.ts +15 -0
- package/dist/hooks/use-product.d.ts.map +1 -0
- package/dist/hooks/{useProducts.d.ts → use-products.d.ts} +1 -1
- package/dist/hooks/use-products.d.ts.map +1 -0
- package/dist/hooks/use-region.d.ts +15 -0
- package/dist/hooks/use-region.d.ts.map +1 -0
- package/dist/hooks/use-shipping.d.ts +29 -0
- package/dist/hooks/use-shipping.d.ts.map +1 -0
- package/dist/hooks/use-storefront-actions.d.ts +12 -0
- package/dist/hooks/use-storefront-actions.d.ts.map +1 -0
- package/dist/hooks/use-storefront-head.d.ts +19 -0
- package/dist/hooks/use-storefront-head.d.ts.map +1 -0
- package/dist/hooks/use-storefront.d.ts +3 -0
- package/dist/hooks/use-storefront.d.ts.map +1 -0
- package/dist/index.d.ts +123 -54
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1311 -5012
- package/dist/index.js.map +1 -1
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/motion.d.ts.map +1 -0
- package/dist/lib/seo.d.ts +26 -0
- package/dist/lib/seo.d.ts.map +1 -0
- package/dist/{testids.d.ts → lib/testids.d.ts} +21 -0
- package/dist/lib/testids.d.ts.map +1 -0
- package/dist/{theme.d.ts → lib/theme.d.ts} +41 -3
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/render.d.ts +5 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +359 -0
- package/dist/render.js.map +1 -0
- package/dist/stores/cart.store.d.ts +6 -2
- package/dist/stores/cart.store.d.ts.map +1 -1
- package/dist/stores/catalog.store.d.ts +11 -0
- package/dist/stores/catalog.store.d.ts.map +1 -1
- package/dist/views/CatalogPage.d.ts.map +1 -0
- package/dist/views/CheckoutPage.d.ts.map +1 -0
- package/dist/views/ContentPage.d.ts +11 -0
- package/dist/views/ContentPage.d.ts.map +1 -0
- package/dist/views/HomePage.d.ts +9 -0
- package/dist/views/HomePage.d.ts.map +1 -0
- package/dist/views/MyPurchasesPage.d.ts.map +1 -0
- package/dist/views/NotFoundPage.d.ts.map +1 -0
- package/dist/{pages → views}/OrderConfirmationPage.d.ts.map +1 -1
- package/dist/{pages → views}/PolicyPage.d.ts.map +1 -1
- package/dist/views/ProductDetailPage.d.ts.map +1 -0
- package/dist/views/StorefrontPage.d.ts +35 -0
- package/dist/views/StorefrontPage.d.ts.map +1 -0
- package/dist/workflows/checkout.d.ts +1 -1
- package/dist/workflows/checkout.d.ts.map +1 -1
- package/package.json +21 -14
- package/dist/auth.d.ts.map +0 -1
- package/dist/blocks.d.ts.map +0 -1
- package/dist/component-contracts.d.ts.map +0 -1
- package/dist/component-selectors.d.ts.map +0 -1
- package/dist/components/CartDrawer.d.ts.map +0 -1
- package/dist/components/CustomerAccountShell.d.ts.map +0 -1
- package/dist/components/DeliveryEstimator.d.ts.map +0 -1
- package/dist/components/FiltersPanel.d.ts +0 -3
- package/dist/components/FiltersPanel.d.ts.map +0 -1
- package/dist/components/OrderTrackingTimeline.d.ts.map +0 -1
- package/dist/components/ProductCard.d.ts +0 -4
- package/dist/components/ProductCard.d.ts.map +0 -1
- package/dist/components/ProductEnquiryForm.d.ts.map +0 -1
- package/dist/components/ProductGallery.d.ts +0 -22
- package/dist/components/ProductGallery.d.ts.map +0 -1
- package/dist/components/ProductGrid.d.ts.map +0 -1
- package/dist/components/ProductOptionSelector.d.ts.map +0 -1
- package/dist/components/ProductSpecs.d.ts.map +0 -1
- package/dist/components/QuantityInput.d.ts.map +0 -1
- package/dist/components/RelatedProducts.d.ts.map +0 -1
- package/dist/components/SignInModal.d.ts.map +0 -1
- package/dist/components/StorefrontErrorBoundary.d.ts.map +0 -1
- package/dist/components/StorefrontFooter.d.ts.map +0 -1
- package/dist/components/StorefrontHeader.d.ts.map +0 -1
- package/dist/components/Toaster.d.ts.map +0 -1
- package/dist/components/sections/CategoryShowcase.d.ts +0 -6
- package/dist/components/sections/CategoryShowcase.d.ts.map +0 -1
- package/dist/components/sections/HeroSection.d.ts +0 -9
- package/dist/components/sections/HeroSection.d.ts.map +0 -1
- package/dist/components/sections/MediaCarousel.d.ts +0 -11
- package/dist/components/sections/MediaCarousel.d.ts.map +0 -1
- package/dist/components/sections/MiscSections.d.ts +0 -33
- package/dist/components/sections/MiscSections.d.ts.map +0 -1
- package/dist/components/sections/ProductRail.d.ts +0 -9
- package/dist/components/sections/ProductRail.d.ts.map +0 -1
- package/dist/components/sections/ProductSlider.d.ts +0 -15
- package/dist/components/sections/ProductSlider.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/createStorefrontApp.d.ts +0 -28
- package/dist/createStorefrontApp.d.ts.map +0 -1
- package/dist/define.d.ts.map +0 -1
- package/dist/format.d.ts.map +0 -1
- package/dist/hooks/useCategories.d.ts +0 -6
- package/dist/hooks/useCategories.d.ts.map +0 -1
- package/dist/hooks/useDiscountValidator.d.ts +0 -14
- package/dist/hooks/useDiscountValidator.d.ts.map +0 -1
- package/dist/hooks/useMyOrders.d.ts.map +0 -1
- package/dist/hooks/useProduct.d.ts +0 -7
- package/dist/hooks/useProduct.d.ts.map +0 -1
- package/dist/hooks/useProducts.d.ts.map +0 -1
- package/dist/hooks/useStorefront.d.ts +0 -35
- package/dist/hooks/useStorefront.d.ts.map +0 -1
- package/dist/hooks/useStorefrontHead.d.ts +0 -11
- package/dist/hooks/useStorefrontHead.d.ts.map +0 -1
- package/dist/motion.d.ts.map +0 -1
- package/dist/order-status.d.ts.map +0 -1
- package/dist/pages/CatalogPage.d.ts.map +0 -1
- package/dist/pages/CheckoutPage.d.ts.map +0 -1
- package/dist/pages/HomePage.d.ts +0 -9
- package/dist/pages/HomePage.d.ts.map +0 -1
- package/dist/pages/MyPurchasesPage.d.ts.map +0 -1
- package/dist/pages/NotFoundPage.d.ts.map +0 -1
- package/dist/pages/ProductDetailPage.d.ts.map +0 -1
- package/dist/presets.d.ts.map +0 -1
- package/dist/product-options.d.ts +0 -12
- package/dist/product-options.d.ts.map +0 -1
- package/dist/router.d.ts.map +0 -1
- package/dist/scaffold.d.ts.map +0 -1
- package/dist/sections.d.ts.map +0 -1
- package/dist/testids.d.ts.map +0 -1
- package/dist/theme.d.ts.map +0 -1
- package/src/auth.ts +0 -227
- package/src/blocks.tsx +0 -51
- package/src/catalog.ts +0 -3
- package/src/component-contracts.ts +0 -154
- package/src/component-selectors.ts +0 -31
- package/src/components/CartDrawer.tsx +0 -279
- package/src/components/CustomerAccountShell.tsx +0 -102
- package/src/components/DeliveryEstimator.tsx +0 -157
- package/src/components/FiltersPanel.tsx +0 -109
- package/src/components/OrderTrackingTimeline.tsx +0 -135
- package/src/components/Price.tsx +0 -32
- package/src/components/ProductCard.tsx +0 -120
- package/src/components/ProductEnquiryForm.tsx +0 -175
- package/src/components/ProductGallery.tsx +0 -174
- package/src/components/ProductGrid.tsx +0 -43
- package/src/components/ProductOptionSelector.tsx +0 -50
- package/src/components/ProductSpecs.tsx +0 -75
- package/src/components/QuantityInput.tsx +0 -52
- package/src/components/RelatedProducts.tsx +0 -40
- package/src/components/SignInModal.tsx +0 -120
- package/src/components/SmoothImage.tsx +0 -59
- package/src/components/StorefrontErrorBoundary.tsx +0 -51
- package/src/components/StorefrontFooter.tsx +0 -110
- package/src/components/StorefrontHeader.tsx +0 -477
- package/src/components/Toaster.tsx +0 -60
- package/src/components/sections/CategoryShowcase.tsx +0 -80
- package/src/components/sections/HeroSection.tsx +0 -193
- package/src/components/sections/MediaCarousel.tsx +0 -141
- package/src/components/sections/MiscSections.tsx +0 -158
- package/src/components/sections/ProductRail.tsx +0 -81
- package/src/components/sections/ProductSlider.tsx +0 -119
- package/src/config.ts +0 -229
- package/src/createStorefrontApp.tsx +0 -247
- package/src/define.ts +0 -34
- package/src/format.ts +0 -7
- package/src/hooks/index.ts +0 -6
- package/src/hooks/useCategories.ts +0 -26
- package/src/hooks/useDiscountValidator.ts +0 -43
- package/src/hooks/useMyOrders.ts +0 -41
- package/src/hooks/useProduct.ts +0 -36
- package/src/hooks/useProducts.ts +0 -39
- package/src/hooks/useStorefront.ts +0 -58
- package/src/hooks/useStorefrontHead.ts +0 -25
- package/src/index.ts +0 -202
- package/src/motion.tsx +0 -94
- package/src/order-status.ts +0 -33
- package/src/pages/CatalogPage.tsx +0 -118
- package/src/pages/CheckoutPage.tsx +0 -689
- package/src/pages/HomePage.tsx +0 -16
- package/src/pages/MyPurchasesPage.tsx +0 -311
- package/src/pages/NotFoundPage.tsx +0 -25
- package/src/pages/OrderConfirmationPage.tsx +0 -190
- package/src/pages/PolicyPage.tsx +0 -47
- package/src/pages/ProductDetailPage.tsx +0 -264
- package/src/presets.ts +0 -324
- package/src/product-options.ts +0 -63
- package/src/router.ts +0 -49
- package/src/scaffold.tsx +0 -115
- package/src/sections.ts +0 -116
- package/src/shop.ts +0 -4
- package/src/stores/cart.store.ts +0 -185
- package/src/stores/catalog.store.ts +0 -39
- package/src/stores/delivery.store.ts +0 -152
- package/src/stores/session.store.ts +0 -28
- package/src/stores/toast.store.ts +0 -43
- package/src/testids.ts +0 -136
- package/src/theme.ts +0 -194
- package/src/ui.ts +0 -5
- package/src/workflows/checkout.ts +0 -119
- /package/dist/components/{CustomerAccountShell.d.ts → account/CustomerAccountShell.d.ts} +0 -0
- /package/dist/components/{SignInModal.d.ts → account/SignInModal.d.ts} +0 -0
- /package/dist/components/{CartDrawer.d.ts → cart/CartDrawer.d.ts} +0 -0
- /package/dist/components/{QuantityInput.d.ts → cart/QuantityInput.d.ts} +0 -0
- /package/dist/components/{DeliveryEstimator.d.ts → checkout/DeliveryEstimator.d.ts} +0 -0
- /package/dist/components/{ProductGrid.d.ts → collection/ProductGrid.d.ts} +0 -0
- /package/dist/components/{StorefrontErrorBoundary.d.ts → layout/StorefrontErrorBoundary.d.ts} +0 -0
- /package/dist/components/{StorefrontFooter.d.ts → layout/StorefrontFooter.d.ts} +0 -0
- /package/dist/components/{StorefrontHeader.d.ts → layout/StorefrontHeader.d.ts} +0 -0
- /package/dist/components/{Toaster.d.ts → layout/Toaster.d.ts} +0 -0
- /package/dist/components/{OrderTrackingTimeline.d.ts → order/OrderTrackingTimeline.d.ts} +0 -0
- /package/dist/components/{ProductEnquiryForm.d.ts → product/ProductEnquiryForm.d.ts} +0 -0
- /package/dist/components/{ProductSpecs.d.ts → product/ProductSpecs.d.ts} +0 -0
- /package/dist/components/{RelatedProducts.d.ts → product/RelatedProducts.d.ts} +0 -0
- /package/dist/{order-status.d.ts → data/order-status.d.ts} +0 -0
- /package/dist/{component-selectors.d.ts → extend/component-selectors.d.ts} +0 -0
- /package/dist/{format.d.ts → lib/format.d.ts} +0 -0
- /package/dist/{motion.d.ts → lib/motion.d.ts} +0 -0
- /package/dist/{pages → views}/CatalogPage.d.ts +0 -0
- /package/dist/{pages → views}/CheckoutPage.d.ts +0 -0
- /package/dist/{pages → views}/MyPurchasesPage.d.ts +0 -0
- /package/dist/{pages → views}/NotFoundPage.d.ts +0 -0
- /package/dist/{pages → views}/OrderConfirmationPage.d.ts +0 -0
- /package/dist/{pages → views}/PolicyPage.d.ts +0 -0
- /package/dist/{pages → views}/ProductDetailPage.d.ts +0 -0
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { Lock, X } from 'lucide-react'
|
|
3
|
-
import { establishCustomerSession } from '../auth'
|
|
4
|
-
import { useSessionStore } from '../stores/session.store'
|
|
5
|
-
import { Link } from '../router'
|
|
6
|
-
|
|
7
|
-
interface SignInModalProps {
|
|
8
|
-
/** Prefill the email field (e.g. from a checkout contact field). */
|
|
9
|
-
defaultEmail?: string
|
|
10
|
-
onClose: () => void
|
|
11
|
-
/** Called after a successful sign-in, with the resolved session. */
|
|
12
|
-
onSignedIn?: (session: { email: string | null; name: string | null }) => void
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Customer sign-in as a focused modal dialog. Used from checkout ("Já tem
|
|
17
|
-
* conta? Entrar") so a returning buyer can authenticate without leaving the
|
|
18
|
-
* page. Auth goes through the shared establishCustomerSession path.
|
|
19
|
-
*/
|
|
20
|
-
export function SignInModal({ defaultEmail = '', onClose, onSignedIn }: SignInModalProps) {
|
|
21
|
-
const [email, setEmail] = useState(defaultEmail)
|
|
22
|
-
const [password, setPassword] = useState('')
|
|
23
|
-
const [busy, setBusy] = useState(false)
|
|
24
|
-
const [error, setError] = useState<string | null>(null)
|
|
25
|
-
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const onKey = (event: KeyboardEvent) => { if (event.key === 'Escape') onClose() }
|
|
28
|
-
document.addEventListener('keydown', onKey)
|
|
29
|
-
return () => document.removeEventListener('keydown', onKey)
|
|
30
|
-
}, [onClose])
|
|
31
|
-
|
|
32
|
-
async function submit(event: React.FormEvent) {
|
|
33
|
-
event.preventDefault()
|
|
34
|
-
if (!email.trim() || !password) return
|
|
35
|
-
setBusy(true)
|
|
36
|
-
setError(null)
|
|
37
|
-
try {
|
|
38
|
-
await establishCustomerSession(email, { password })
|
|
39
|
-
const session = useSessionStore.getState()
|
|
40
|
-
onSignedIn?.({ email: session.email, name: session.name })
|
|
41
|
-
onClose()
|
|
42
|
-
} catch {
|
|
43
|
-
setError('Não foi possível entrar. Verifique seu e-mail e senha.')
|
|
44
|
-
} finally {
|
|
45
|
-
setBusy(false)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div
|
|
51
|
-
className="fixed inset-0 z-[60] flex items-center justify-center p-4"
|
|
52
|
-
role="dialog"
|
|
53
|
-
aria-modal="true"
|
|
54
|
-
aria-label="Entrar na sua conta"
|
|
55
|
-
>
|
|
56
|
-
<div className="absolute inset-0 animate-fade-in bg-foreground/40 backdrop-blur-sm" onClick={onClose} />
|
|
57
|
-
<div
|
|
58
|
-
className="relative z-10 w-full max-w-sm animate-fade-up border bg-card p-6 shadow-2xl"
|
|
59
|
-
style={{ borderRadius: 'var(--sf-radius-card)' }}
|
|
60
|
-
>
|
|
61
|
-
<button
|
|
62
|
-
type="button"
|
|
63
|
-
onClick={onClose}
|
|
64
|
-
aria-label="Fechar"
|
|
65
|
-
className="absolute right-4 top-4 rounded-full p-1 text-muted-foreground transition hover:bg-muted hover:text-foreground"
|
|
66
|
-
>
|
|
67
|
-
<X className="h-5 w-5" />
|
|
68
|
-
</button>
|
|
69
|
-
|
|
70
|
-
<div className="flex items-center gap-2">
|
|
71
|
-
<span className="flex h-9 w-9 items-center justify-center rounded-full bg-primary/10 text-primary">
|
|
72
|
-
<Lock className="h-4 w-4" />
|
|
73
|
-
</span>
|
|
74
|
-
<div>
|
|
75
|
-
<h2 className="sf-heading text-lg font-semibold leading-tight">Entrar na sua conta</h2>
|
|
76
|
-
<p className="text-xs text-muted-foreground">Use seus dados salvos e acompanhe pedidos.</p>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<form onSubmit={submit} className="mt-5 space-y-3">
|
|
81
|
-
<input
|
|
82
|
-
type="email"
|
|
83
|
-
required
|
|
84
|
-
autoFocus
|
|
85
|
-
placeholder="voce@exemplo.com"
|
|
86
|
-
value={email}
|
|
87
|
-
onChange={(event) => setEmail(event.target.value)}
|
|
88
|
-
className="w-full border bg-background px-3 py-2.5 text-sm outline-none transition focus:border-primary focus:ring-2 focus:ring-primary/10"
|
|
89
|
-
style={{ borderRadius: 'var(--sf-radius-input)' }}
|
|
90
|
-
/>
|
|
91
|
-
<input
|
|
92
|
-
type="password"
|
|
93
|
-
required
|
|
94
|
-
placeholder="Senha"
|
|
95
|
-
value={password}
|
|
96
|
-
onChange={(event) => setPassword(event.target.value)}
|
|
97
|
-
className="w-full border bg-background px-3 py-2.5 text-sm outline-none transition focus:border-primary focus:ring-2 focus:ring-primary/10"
|
|
98
|
-
style={{ borderRadius: 'var(--sf-radius-input)' }}
|
|
99
|
-
/>
|
|
100
|
-
{error && <p className="text-sm text-destructive">{error}</p>}
|
|
101
|
-
<button
|
|
102
|
-
type="submit"
|
|
103
|
-
disabled={busy}
|
|
104
|
-
className="sf-cta w-full bg-primary py-3 font-semibold text-primary-foreground shadow-md transition-all hover:-translate-y-0.5 hover:shadow-lg disabled:opacity-60"
|
|
105
|
-
style={{ borderRadius: 'var(--sf-radius-button)' }}
|
|
106
|
-
>
|
|
107
|
-
{busy ? 'Entrando…' : 'Entrar'}
|
|
108
|
-
</button>
|
|
109
|
-
</form>
|
|
110
|
-
|
|
111
|
-
<p className="mt-4 text-center text-sm text-muted-foreground">
|
|
112
|
-
Não tem conta?{' '}
|
|
113
|
-
<Link to="/account" onClick={onClose} className="font-semibold text-primary hover:underline">
|
|
114
|
-
Criar conta
|
|
115
|
-
</Link>
|
|
116
|
-
</p>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
)
|
|
120
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { useStorefrontConfigOptional, type StorefrontImageLoadingConfig } from '../config'
|
|
3
|
-
|
|
4
|
-
export interface SmoothImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
5
|
-
imageLoading?: StorefrontImageLoadingConfig
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function SmoothImage({
|
|
9
|
-
imageLoading,
|
|
10
|
-
loading = 'lazy',
|
|
11
|
-
decoding = 'async',
|
|
12
|
-
onLoad,
|
|
13
|
-
style,
|
|
14
|
-
...props
|
|
15
|
-
}: SmoothImageProps) {
|
|
16
|
-
const config = useStorefrontConfigOptional()
|
|
17
|
-
const resolved = {
|
|
18
|
-
...config?.imageLoading,
|
|
19
|
-
...imageLoading,
|
|
20
|
-
}
|
|
21
|
-
const mode = resolved.mode ?? 'fade'
|
|
22
|
-
const durationMs = resolved.durationMs ?? 420
|
|
23
|
-
const easing = resolved.easing ?? 'cubic-bezier(0.22, 1, 0.36, 1)'
|
|
24
|
-
const blur = resolved.blur ?? true
|
|
25
|
-
const ref = React.useRef<HTMLImageElement | null>(null)
|
|
26
|
-
const [loaded, setLoaded] = React.useState(mode === 'none')
|
|
27
|
-
|
|
28
|
-
React.useEffect(() => {
|
|
29
|
-
if (mode === 'none') {
|
|
30
|
-
setLoaded(true)
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
if (ref.current?.complete && ref.current.naturalWidth > 0) setLoaded(true)
|
|
34
|
-
}, [mode, props.src])
|
|
35
|
-
|
|
36
|
-
const revealStyle: React.CSSProperties =
|
|
37
|
-
mode === 'none'
|
|
38
|
-
? {}
|
|
39
|
-
: {
|
|
40
|
-
opacity: loaded ? 1 : 0,
|
|
41
|
-
filter: blur && !loaded ? 'blur(10px)' : 'blur(0px)',
|
|
42
|
-
transition: `opacity ${durationMs}ms ${easing}, filter ${durationMs}ms ${easing}, transform ${durationMs}ms ${easing}`,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<img
|
|
47
|
-
{...props}
|
|
48
|
-
ref={ref}
|
|
49
|
-
loading={loading}
|
|
50
|
-
decoding={decoding}
|
|
51
|
-
data-sf-image-loaded={loaded ? 'true' : 'false'}
|
|
52
|
-
style={{ ...style, ...revealStyle }}
|
|
53
|
-
onLoad={(event) => {
|
|
54
|
-
setLoaded(true)
|
|
55
|
-
onLoad?.(event)
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
interface Props {
|
|
4
|
-
children: React.ReactNode
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface State {
|
|
8
|
-
error: Error | null
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Catches render/runtime errors in the storefront tree so a single thrown
|
|
13
|
-
* error (e.g. a provider failure) shows a recoverable fallback instead of a
|
|
14
|
-
* blank white screen. Key it by route to auto-clear on navigation.
|
|
15
|
-
*/
|
|
16
|
-
export class StorefrontErrorBoundary extends React.Component<Props, State> {
|
|
17
|
-
state: State = { error: null }
|
|
18
|
-
|
|
19
|
-
static getDerivedStateFromError(error: Error): State {
|
|
20
|
-
return { error }
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
componentDidCatch(error: Error, info: React.ErrorInfo): void {
|
|
24
|
-
// eslint-disable-next-line no-console
|
|
25
|
-
console.error('[storefront] render error:', error, info.componentStack)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
render(): React.ReactNode {
|
|
29
|
-
if (!this.state.error) return this.props.children
|
|
30
|
-
return (
|
|
31
|
-
<div className="flex min-h-[60vh] flex-col items-center justify-center gap-4 px-4 py-16 text-center">
|
|
32
|
-
<h1 className="sf-heading text-xl font-semibold">Algo deu errado</h1>
|
|
33
|
-
<p className="max-w-md text-sm text-muted-foreground">
|
|
34
|
-
Ocorreu um erro ao carregar esta parte da loja. Tente recarregar a página.
|
|
35
|
-
</p>
|
|
36
|
-
<div className="flex flex-wrap justify-center gap-3">
|
|
37
|
-
<button
|
|
38
|
-
type="button"
|
|
39
|
-
onClick={() => window.location.reload()}
|
|
40
|
-
className="rounded-lg bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground transition hover:opacity-90"
|
|
41
|
-
>
|
|
42
|
-
Recarregar
|
|
43
|
-
</button>
|
|
44
|
-
<a href="#/" className="rounded-lg border px-5 py-2.5 text-sm font-semibold transition hover:bg-muted">
|
|
45
|
-
Voltar ao início
|
|
46
|
-
</a>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { useStorefrontConfig } from '../config'
|
|
3
|
-
import { useCategories } from '../hooks/useCategories'
|
|
4
|
-
import { useCatalogStore } from '../stores/catalog.store'
|
|
5
|
-
import { Link, navigateTo } from '../router'
|
|
6
|
-
|
|
7
|
-
export function StorefrontFooter() {
|
|
8
|
-
const config = useStorefrontConfig()
|
|
9
|
-
const { categories } = useCategories()
|
|
10
|
-
const visibleCategories = categories.slice(0, 8)
|
|
11
|
-
const hiddenCategoryCount = Math.max(categories.length - visibleCategories.length, 0)
|
|
12
|
-
const labels = {
|
|
13
|
-
categories: 'Departamentos',
|
|
14
|
-
navigation: 'Navegação',
|
|
15
|
-
contact: 'Contato',
|
|
16
|
-
viewAll: 'Ver todos',
|
|
17
|
-
purchases: 'Minhas compras',
|
|
18
|
-
privacy: 'Privacidade',
|
|
19
|
-
terms: 'Termos',
|
|
20
|
-
returns: 'Trocas e devoluções',
|
|
21
|
-
...config.footer?.labels,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const goCategory = (categoryId: string) => {
|
|
25
|
-
useCatalogStore.getState().reset()
|
|
26
|
-
useCatalogStore.getState().setCategoryId(categoryId)
|
|
27
|
-
navigateTo(config.catalogPath)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<footer className="mt-16 border-t bg-card">
|
|
32
|
-
<div className="mx-auto grid max-w-7xl gap-10 px-4 py-12 sm:grid-cols-2 sm:px-6 lg:grid-cols-4">
|
|
33
|
-
<div>
|
|
34
|
-
<p className="sf-heading text-lg font-bold">{config.name}</p>
|
|
35
|
-
{config.footer?.about && (
|
|
36
|
-
<p className="mt-3 text-sm leading-relaxed text-muted-foreground">{config.footer.about}</p>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<div>
|
|
41
|
-
<h3 className="mb-3 text-sm font-semibold uppercase tracking-wide text-muted-foreground">{labels.categories}</h3>
|
|
42
|
-
<ul className="space-y-2 text-sm">
|
|
43
|
-
{visibleCategories.map((c) => (
|
|
44
|
-
<li key={c.id}>
|
|
45
|
-
<button
|
|
46
|
-
type="button"
|
|
47
|
-
onClick={() => goCategory(c.id)}
|
|
48
|
-
className="max-w-full truncate text-left transition-opacity hover:opacity-70"
|
|
49
|
-
>
|
|
50
|
-
{c.name}
|
|
51
|
-
</button>
|
|
52
|
-
</li>
|
|
53
|
-
))}
|
|
54
|
-
{hiddenCategoryCount > 0 && (
|
|
55
|
-
<li>
|
|
56
|
-
<Link to={config.catalogPath} className="font-medium underline-offset-2 transition-opacity hover:underline">
|
|
57
|
-
{labels.viewAll} ({categories.length})
|
|
58
|
-
</Link>
|
|
59
|
-
</li>
|
|
60
|
-
)}
|
|
61
|
-
</ul>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<div>
|
|
65
|
-
<h3 className="mb-3 text-sm font-semibold uppercase tracking-wide text-muted-foreground">{labels.navigation}</h3>
|
|
66
|
-
<ul className="space-y-2 text-sm">
|
|
67
|
-
{config.nav.map((link) => (
|
|
68
|
-
<li key={link.to}>
|
|
69
|
-
<Link to={link.to} className="transition-opacity hover:opacity-70">{link.label}</Link>
|
|
70
|
-
</li>
|
|
71
|
-
))}
|
|
72
|
-
{config.features.accounts && (
|
|
73
|
-
<li>
|
|
74
|
-
<Link to="/account" className="transition-opacity hover:opacity-70">{labels.purchases}</Link>
|
|
75
|
-
</li>
|
|
76
|
-
)}
|
|
77
|
-
</ul>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div>
|
|
81
|
-
<h3 className="mb-3 text-sm font-semibold uppercase tracking-wide text-muted-foreground">{labels.contact}</h3>
|
|
82
|
-
<ul className="space-y-2 text-sm text-muted-foreground">
|
|
83
|
-
{config.footer?.contact?.phone && <li>{config.footer.contact.phone}</li>}
|
|
84
|
-
{config.footer?.contact?.email && <li>{config.footer.contact.email}</li>}
|
|
85
|
-
{config.footer?.contact?.address && <li>{config.footer.contact.address}</li>}
|
|
86
|
-
{config.footer?.social?.map((s) => (
|
|
87
|
-
<li key={s.href}>
|
|
88
|
-
<a href={s.href} target="_blank" rel="noreferrer" className="transition-opacity hover:opacity-70">
|
|
89
|
-
{s.label}
|
|
90
|
-
</a>
|
|
91
|
-
</li>
|
|
92
|
-
))}
|
|
93
|
-
</ul>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
<div className="border-t">
|
|
97
|
-
<div className="mx-auto flex max-w-7xl flex-col items-center gap-3 px-4 py-5 text-xs text-muted-foreground sm:flex-row sm:justify-between sm:px-6">
|
|
98
|
-
<nav className="flex flex-wrap items-center justify-center gap-x-5 gap-y-2">
|
|
99
|
-
<Link to="/privacy" className="transition-colors hover:text-foreground">{labels.privacy}</Link>
|
|
100
|
-
<Link to="/terms" className="transition-colors hover:text-foreground">{labels.terms}</Link>
|
|
101
|
-
<Link to="/refunds" className="transition-colors hover:text-foreground">{labels.returns}</Link>
|
|
102
|
-
</nav>
|
|
103
|
-
<p className="text-center">
|
|
104
|
-
{config.footer?.credit ?? <>© {config.name} — powered by Fayz</>}
|
|
105
|
-
</p>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
</footer>
|
|
109
|
-
)
|
|
110
|
-
}
|