storefront-layouts 1.0.9 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/shipping/ProductDeliveryInfoSection.d.ts.map +1 -1
- package/dist/components/shipping/ProductDeliveryInfoSection.js +10 -3
- package/dist/components/ui/address-selector.d.ts.map +1 -1
- package/dist/components/ui/address-selector.js +4 -3
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkout-button.d.ts.map +1 -1
- package/dist/components/ui/checkout-button.js +2 -1
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +15 -4
- package/dist/components/ui/route-skeleton-loader.d.ts.map +1 -1
- package/dist/components/ui/route-skeleton-loader.js +6 -2
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +2 -2
- package/dist/components/ui/skeletons/checkout-skeleton.js +1 -1
- package/dist/editor/blocks/defaults/clothing-minimal-home.js +1 -1
- package/dist/editor/blocks/migrate-clothing-minimal.js +1 -1
- package/dist/hooks/use-pdp-variation.d.ts +57 -0
- package/dist/hooks/use-pdp-variation.d.ts.map +1 -0
- package/dist/hooks/use-pdp-variation.js +69 -0
- package/dist/hooks/use-product-by-slug.d.ts.map +1 -1
- package/dist/hooks/use-product-by-slug.js +0 -5
- package/dist/hooks/use-product-variation-selection.js +1 -1
- package/dist/hooks/use-shipping-quote.d.ts +1 -0
- package/dist/hooks/use-shipping-quote.d.ts.map +1 -1
- package/dist/hooks/use-shipping-quote.js +3 -0
- package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking/pages/ProductDetailPage.js +130 -223
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +130 -223
- package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
- package/dist/layouts/clothing/components/ClothingHomePage.js +40 -2
- package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductDetailPage.js +127 -209
- package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing/pages/ProductsPage.js +2 -5
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +5 -3
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +13 -4
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +130 -223
- package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/clothing-minimal/pages/ProductsPage.js +2 -5
- package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +1 -1
- package/dist/layouts/electronics/components/ElectronicsStoreHeader.d.ts.map +1 -1
- package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +10 -9
- package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductDetailPage.js +130 -223
- package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics/pages/ProductsPage.js +2 -5
- package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +1 -1
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +4 -5
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +130 -223
- package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/electronics-grid/pages/ProductsPage.js +2 -5
- package/dist/layouts/food/pages/MenuPage.js +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductDetailPage.js +37 -140
- package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food/pages/ProductsPage.js +2 -5
- package/dist/layouts/food-modern/pages/MenuPage.js +1 -1
- package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductDetailPage.js +130 -223
- package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/food-modern/pages/ProductsPage.js +2 -5
- package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
- package/dist/layouts/motivational-speaker/pages/ProductsPage.js +2 -5
- package/dist/layouts/shared/components/PdpColorSwatch.d.ts +11 -0
- package/dist/layouts/shared/components/PdpColorSwatch.d.ts.map +1 -0
- package/dist/layouts/shared/components/PdpColorSwatch.js +29 -0
- package/dist/layouts/shared/components/PdpVariationSelectors.d.ts +13 -0
- package/dist/layouts/shared/components/PdpVariationSelectors.d.ts.map +1 -0
- package/dist/layouts/shared/components/PdpVariationSelectors.js +65 -0
- package/dist/layouts/shared/components/StoreCartSheet.d.ts +8 -0
- package/dist/layouts/shared/components/StoreCartSheet.d.ts.map +1 -0
- package/dist/layouts/shared/components/StoreCartSheet.js +16 -0
- package/dist/layouts/shared/components/StoreHeader.d.ts.map +1 -1
- package/dist/layouts/shared/components/StoreHeader.js +13 -12
- package/dist/layouts/shared/components/headers/ClothingMinimalHeader.d.ts.map +1 -1
- package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +5 -7
- package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/CartPage.js +6 -5
- package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/layouts/shared/pages/CheckoutPage.js +209 -107
- package/dist/layouts/shared/product-category-filter-chip.d.ts +2 -0
- package/dist/layouts/shared/product-category-filter-chip.d.ts.map +1 -0
- package/dist/layouts/shared/product-category-filter-chip.js +6 -0
- package/dist/lib/pdp-cart-actions.d.ts +5 -0
- package/dist/lib/pdp-cart-actions.d.ts.map +1 -0
- package/dist/lib/pdp-cart-actions.js +19 -0
- package/dist/lib/product-variation-utils.d.ts +17 -0
- package/dist/lib/product-variation-utils.d.ts.map +1 -1
- package/dist/lib/product-variation-utils.js +193 -14
- package/dist/lib/services/checkout.service.d.ts +11 -0
- package/dist/lib/services/checkout.service.d.ts.map +1 -1
- package/dist/lib/services/shipping.service.d.ts +3 -0
- package/dist/lib/services/shipping.service.d.ts.map +1 -1
- package/dist/lib/store-config-utils.d.ts.map +1 -1
- package/dist/lib/store-config-utils.js +104 -11
- package/dist/lib/store-context.d.ts.map +1 -1
- package/dist/lib/store-context.js +23 -8
- package/dist/lib/utils/asset-helpers.d.ts +2 -0
- package/dist/lib/utils/asset-helpers.d.ts.map +1 -1
- package/dist/lib/utils/asset-helpers.js +24 -0
- package/dist/styles/index.css +143 -45
- package/package.json +8 -2
|
@@ -20,6 +20,7 @@ import { filterActiveProducts } from '../../../lib/utils/index.js';
|
|
|
20
20
|
import { getAllCategoryIds, flattenCategoryTree, buildCategoryTree } from '../../../lib/utils/category-tree.js';
|
|
21
21
|
import { getBannerImage, getLayoutText } from '../../../lib/utils/asset-helpers.js';
|
|
22
22
|
import { shouldUseAPI } from '../../../lib/utils/demo-detection.js';
|
|
23
|
+
import { productCategoryFilterChipClass } from '../../shared/product-category-filter-chip';
|
|
23
24
|
import { useCatalogPriceRange } from '../../../hooks/use-catalog-price-range.js';
|
|
24
25
|
import { getApiPriceFilterActive, isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds.js';
|
|
25
26
|
import { buildFilteredProductQuery, getFilteredProductQueryKey, productMatchesCategoryIds, productMatchesCategorySlug, } from '../../../lib/utils/filtered-product-query.js';
|
|
@@ -310,11 +311,7 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
|
|
|
310
311
|
element?.scrollIntoView({ behavior: 'smooth' });
|
|
311
312
|
}, children: primaryButtonText })), secondaryButtonText && secondaryButtonText.trim() !== '' && (_jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${categoryHeaderImage ? 'bg-white/10 backdrop-blur-md text-white border border-white/30 hover:bg-white/20' : 'bg-gray-100 text-gray-900 hover:bg-gray-200 border border-gray-200'}`, onClick: () => {
|
|
312
313
|
window.location.href = `/${storeConfig.slug}/categories`;
|
|
313
|
-
}, children: secondaryButtonText }))] })] }) }) })] }), _jsxs("div", { "data-content-ready": true, className: "container mx-auto px-4 sm:px-6 lg:px-8 py-8", children: [_jsxs("div", { className: "flex gap-3 mb-8 overflow-x-auto pb-2 scrollbar-hide", children: [_jsx("button", { onClick: () => setSelectedCategoryFilter(null), className: `
|
|
314
|
-
? 'bg-gray-900 text-white hover:bg-blue-600'
|
|
315
|
-
: 'bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600'}`, children: "All" }), categories.map((category) => (_jsx("button", { onClick: () => setSelectedCategoryFilter(selectedCategoryFilter === category.slug ? null : category.slug), className: `px-6 py-2.5 rounded-lg text-sm font-semibold whitespace-nowrap transition-all ${selectedCategoryFilter === category.slug
|
|
316
|
-
? 'bg-gray-900 text-white hover:bg-blue-600'
|
|
317
|
-
: 'bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600'}`, children: category.name }, category.id)))] }), _jsxs("div", { id: "product-grid", className: "grid grid-cols-1 lg:grid-cols-4 gap-8", children: [_jsxs("aside", { className: "hidden lg:block col-span-1 space-y-8 sticky top-24 h-fit max-h-[calc(100vh-8rem)] overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent", children: [_jsxs("div", { className: "flex items-center justify-between pb-4 border-b border-gray-100", children: [_jsx("h2", { className: "text-xl font-bold text-gray-900", children: "Filters" }), hasActiveFilters && (_jsxs("button", { onClick: clearAllFilters, className: "text-xs font-medium text-red-500 hover:text-red-700 flex items-center gap-1", children: [_jsx(RotateCcw, { className: "h-3 w-3" }), " Reset"] }))] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Availability" }), _jsxs("label", { className: "flex items-center gap-3 cursor-pointer group p-2 -ml-2 rounded-lg hover:bg-gray-50 transition-colors", children: [_jsx("div", { className: `w-5 h-5 rounded border flex items-center justify-center transition-colors ${showInStockOnly ? 'bg-black border-black' : 'border-gray-300 group-hover:border-black'}`, children: showInStockOnly && _jsx(Check, { className: "h-3 w-3 text-white" }) }), _jsx("input", { type: "checkbox", className: "hidden", checked: showInStockOnly, onChange: () => setShowInStockOnly(!showInStockOnly) }), _jsx("span", { className: "text-sm text-gray-700 font-medium", children: "In Stock Only" })] })] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide", children: "Brand" }), selectedBrands.length > 0 && (_jsx("button", { onClick: () => setSelectedBrands([]), className: "text-xs text-gray-600 hover:text-blue-600 font-medium transition-colors", children: "Clear" }))] }), brands.length > 0 ? (_jsxs("div", { className: "space-y-2", children: [(showMoreBrands ? brands : brands.slice(0, 6)).map((brand) => (_jsx("label", { className: "flex items-center justify-between cursor-pointer group hover:bg-blue-50 hover:text-blue-600 p-2 rounded-lg -ml-2 -mr-2 transition-colors", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("input", { type: "checkbox", checked: selectedBrands.includes(brand), onChange: () => setSelectedBrands(prev => prev.includes(brand) ? prev.filter(b => b !== brand) : [...prev, brand]), className: "w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" }), _jsx("span", { className: "text-sm text-gray-700 font-medium group-hover:text-blue-600", children: brand })] }) }, brand))), brands.length > 6 && (_jsx("button", { onClick: () => setShowMoreBrands(!showMoreBrands), className: "text-sm text-gray-600 hover:text-blue-600 font-medium mt-2 flex items-center gap-1 transition-colors", children: showMoreBrands ? _jsxs(_Fragment, { children: ["Show less ", _jsx(ChevronUp, { className: "h-4 w-4" })] }) : _jsxs(_Fragment, { children: ["Show more ", _jsx(ChevronDown, { className: "h-4 w-4" })] }) }))] })) : (_jsx("p", { className: "text-xs text-gray-500 italic", children: "No brands available" }))] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Category" }), _jsx(CategoryTree, { categories: categories, selectedCategoryIds: selectedCategories, onCategoryToggle: (categoryId, isSelected) => {
|
|
314
|
+
}, children: secondaryButtonText }))] })] }) }) })] }), _jsxs("div", { "data-content-ready": true, className: "container mx-auto px-4 sm:px-6 lg:px-8 py-8", children: [_jsxs("div", { className: "flex gap-3 mb-8 overflow-x-auto pb-2 scrollbar-hide", children: [_jsx("button", { onClick: () => setSelectedCategoryFilter(null), className: productCategoryFilterChipClass(!selectedCategoryFilter), children: "All" }), categories.map((category) => (_jsx("button", { onClick: () => setSelectedCategoryFilter(selectedCategoryFilter === category.slug ? null : category.slug), className: productCategoryFilterChipClass(selectedCategoryFilter === category.slug), children: category.name }, category.id)))] }), _jsxs("div", { id: "product-grid", className: "grid grid-cols-1 lg:grid-cols-4 gap-8", children: [_jsxs("aside", { className: "hidden lg:block col-span-1 space-y-8 sticky top-24 h-fit max-h-[calc(100vh-8rem)] overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent", children: [_jsxs("div", { className: "flex items-center justify-between pb-4 border-b border-gray-100", children: [_jsx("h2", { className: "text-xl font-bold text-gray-900", children: "Filters" }), hasActiveFilters && (_jsxs("button", { onClick: clearAllFilters, className: "text-xs font-medium text-red-500 hover:text-red-700 flex items-center gap-1", children: [_jsx(RotateCcw, { className: "h-3 w-3" }), " Reset"] }))] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Availability" }), _jsxs("label", { className: "flex items-center gap-3 cursor-pointer group p-2 -ml-2 rounded-lg hover:bg-gray-50 transition-colors", children: [_jsx("div", { className: `w-5 h-5 rounded border flex items-center justify-center transition-colors ${showInStockOnly ? 'bg-black border-black' : 'border-gray-300 group-hover:border-black'}`, children: showInStockOnly && _jsx(Check, { className: "h-3 w-3 text-white" }) }), _jsx("input", { type: "checkbox", className: "hidden", checked: showInStockOnly, onChange: () => setShowInStockOnly(!showInStockOnly) }), _jsx("span", { className: "text-sm text-gray-700 font-medium", children: "In Stock Only" })] })] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide", children: "Brand" }), selectedBrands.length > 0 && (_jsx("button", { onClick: () => setSelectedBrands([]), className: "text-xs text-gray-600 hover:text-blue-600 font-medium transition-colors", children: "Clear" }))] }), brands.length > 0 ? (_jsxs("div", { className: "space-y-2", children: [(showMoreBrands ? brands : brands.slice(0, 6)).map((brand) => (_jsx("label", { className: "flex items-center justify-between cursor-pointer group hover:bg-blue-50 hover:text-blue-600 p-2 rounded-lg -ml-2 -mr-2 transition-colors", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("input", { type: "checkbox", checked: selectedBrands.includes(brand), onChange: () => setSelectedBrands(prev => prev.includes(brand) ? prev.filter(b => b !== brand) : [...prev, brand]), className: "w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" }), _jsx("span", { className: "text-sm text-gray-700 font-medium group-hover:text-blue-600", children: brand })] }) }, brand))), brands.length > 6 && (_jsx("button", { onClick: () => setShowMoreBrands(!showMoreBrands), className: "text-sm text-gray-600 hover:text-blue-600 font-medium mt-2 flex items-center gap-1 transition-colors", children: showMoreBrands ? _jsxs(_Fragment, { children: ["Show less ", _jsx(ChevronUp, { className: "h-4 w-4" })] }) : _jsxs(_Fragment, { children: ["Show more ", _jsx(ChevronDown, { className: "h-4 w-4" })] }) }))] })) : (_jsx("p", { className: "text-xs text-gray-500 italic", children: "No brands available" }))] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Category" }), _jsx(CategoryTree, { categories: categories, selectedCategoryIds: selectedCategories, onCategoryToggle: (categoryId, isSelected) => {
|
|
318
315
|
setSelectedCategories(prev => isSelected
|
|
319
316
|
? [...prev, categoryId]
|
|
320
317
|
: prev.filter(id => id !== categoryId));
|
|
@@ -110,7 +110,7 @@ export function ElectronicsGridProductCard({ product, storeSlug, onAddToCart, in
|
|
|
110
110
|
if (!isOutOfStock) {
|
|
111
111
|
onAddToCart(product);
|
|
112
112
|
}
|
|
113
|
-
}, disabled: isOutOfStock, className: cn("w-full bg-gray-900 hover:bg-gray-800 text-white border-none rounded-none h-11 font-normal text-sm transition-colors", isOutOfStock && "opacity-50 cursor-not-allowed"), children: [_jsx(Plus, { className: "w-4 h-4 mr-2" }), "
|
|
113
|
+
}, disabled: isOutOfStock, className: cn("w-full bg-gray-900 hover:bg-gray-800 text-white border-none rounded-none h-11 font-normal text-sm transition-colors", isOutOfStock && "opacity-50 cursor-not-allowed"), children: [_jsx(Plus, { className: "w-4 h-4 mr-2" }), " Add to cart"] }) }), _jsx("button", { disabled: isOutOfStock, className: cn("lg:hidden absolute bottom-3 right-3 z-30 w-10 h-10 rounded-full bg-gray-900 text-white flex items-center justify-center hover:bg-gray-800 active:scale-95 transition-colors", isOutOfStock && "opacity-50 cursor-not-allowed"), onClick: (e) => {
|
|
114
114
|
e.preventDefault();
|
|
115
115
|
if (!isOutOfStock) {
|
|
116
116
|
onAddToCart(product);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronicsHomePageGrid.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/components/ElectronicsHomePageGrid.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAA+B,MAAM,mBAAmB,CAAC;AAuB7E,UAAU,4BAA4B;IACnC,WAAW,EAAE,WAAW,CAAC;CAC3B;AA+ED,wBAAgB,uBAAuB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,4BAA4B,+
|
|
1
|
+
{"version":3,"file":"ElectronicsHomePageGrid.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/components/ElectronicsHomePageGrid.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAA+B,MAAM,mBAAmB,CAAC;AAuB7E,UAAU,4BAA4B;IACnC,WAAW,EAAE,WAAW,CAAC;CAC3B;AA+ED,wBAAgB,uBAAuB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,4BAA4B,+BAwenG"}
|
|
@@ -3,16 +3,15 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useFeaturedProducts } from '../../../hooks/use-featured-products.js';
|
|
4
4
|
import { Button } from '../../../components/ui/button.js';
|
|
5
5
|
import { Sheet } from '../../../components/ui/sheet.js';
|
|
6
|
-
import {
|
|
6
|
+
import { StoreCartSheet } from '../../shared/components/StoreCartSheet.js';
|
|
7
7
|
import { CategoryTree } from '../../../components/ui/category-tree.js';
|
|
8
8
|
import { useStore } from '../../../lib/store-context.js';
|
|
9
|
-
import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
|
|
10
9
|
import { useToast } from '../../../components/ui/toast.js';
|
|
11
10
|
import { ShoppingCart, Star, Heart, Menu, Search, User, Smartphone, ChevronRight, ChevronDown, CheckCircle2, Package, Tag, Filter, X } from 'lucide-react';
|
|
12
11
|
import Link from 'next/link';
|
|
13
12
|
import Image from 'next/image';
|
|
14
13
|
import { useEffect, useState } from 'react';
|
|
15
|
-
import {
|
|
14
|
+
import { cn, filterActiveProducts } from '../../../lib/utils/index.js';
|
|
16
15
|
import { getLayoutText, getBannerImage, getLogoUrl } from '../../../lib/utils/asset-helpers.js';
|
|
17
16
|
import { toStoreHref } from '../../../lib/utils/url-helpers.js';
|
|
18
17
|
import { StoreLogo } from '../../../components/ui/store-logos.js';
|
|
@@ -23,7 +22,7 @@ import { productService } from '../../../lib/services/product.service.js';
|
|
|
23
22
|
import { transformProductToStoreProduct } from '../../../lib/store-config-utils.js';
|
|
24
23
|
const ElectronicsFilterContent = ({ categories, storeSlug }) => (_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "bg-white border-b border-gray-100 overflow-hidden", children: [_jsxs("div", { className: "bg-white px-4 py-3 border-b border-gray-100 font-normal text-sm text-gray-900 flex justify-between items-center", children: ["Browse by ", _jsx(ChevronDown, { className: "h-4 w-4 text-gray-400" })] }), _jsx("div", { className: "py-2", children: _jsx(CategoryTree, { categories: categories, mode: "link", storeSlug: storeSlug, linkBasePath: "" }) })] }), _jsxs("div", { className: "bg-white p-6 space-y-8", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-medium text-sm text-gray-900 mb-4", children: "Availability" }), _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-600 cursor-pointer hover:text-gray-900 p-2 -ml-2 transition-colors", children: [_jsx("input", { type: "checkbox", className: "rounded border-gray-300 text-gray-900 focus:ring-gray-400", defaultChecked: true }), "In Stock"] }), _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-600 cursor-pointer hover:text-gray-900 p-2 -ml-2 transition-colors mt-2", children: [_jsx("input", { type: "checkbox", className: "rounded border-gray-300 text-gray-900 focus:ring-gray-400" }), "On Sale"] })] }), _jsxs("div", { className: "border-t border-gray-100 pt-6", children: [_jsx("h3", { className: "font-medium text-sm text-gray-900 mb-4", children: "Price" }), _jsxs("div", { className: "flex items-center gap-2 mb-3", children: [_jsxs("div", { className: "relative flex-1", children: [_jsx("span", { className: "absolute left-2 top-1.5 text-gray-400 text-xs", children: "$" }), _jsx("input", { type: "number", className: "w-full pl-5 pr-2 py-1.5 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-gray-400 focus:border-gray-400", placeholder: "Min" })] }), _jsx("span", { className: "text-gray-400", children: "-" }), _jsxs("div", { className: "relative flex-1", children: [_jsx("span", { className: "absolute left-2 top-1.5 text-gray-400 text-xs", children: "$" }), _jsx("input", { type: "number", className: "w-full pl-5 pr-2 py-1.5 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-gray-400 focus:border-gray-400", placeholder: "Max" })] })] }), _jsx(Button, { size: "sm", variant: "outline", className: "w-full text-xs font-normal border-gray-300 text-gray-700 hover:bg-gray-50", children: "Apply Price" })] }), _jsxs("div", { className: "border-t border-gray-100 pt-6", children: [_jsx("h3", { className: "font-medium text-sm text-gray-900 mb-4", children: "Brands" }), _jsx("div", { className: "space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin scrollbar-thumb-gray-200", children: ['Apple'].map(brand => (_jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-600 cursor-pointer hover:text-gray-900 p-2 -ml-2 transition-colors", children: [_jsx("input", { type: "checkbox", className: "rounded border-gray-300 text-gray-900 focus:ring-gray-400", defaultChecked: true }), brand] }, brand))) })] }), _jsxs("div", { className: "border-t border-gray-100 pt-6", children: [_jsx("h3", { className: "font-medium text-sm text-gray-900 mb-4", children: "Rating" }), [4, 3, 2].map(stars => (_jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-600 cursor-pointer hover:text-gray-900 p-2 -ml-2 transition-colors mb-1.5", children: [_jsx("input", { type: "radio", name: "rating", className: "border-gray-300 text-gray-900 focus:ring-gray-400" }), _jsx("div", { className: "flex text-yellow-400", children: [...Array(5)].map((_, i) => (_jsx(Star, { className: `h-3 w-3 ${i < stars ? 'fill-current' : 'text-gray-200 fill-gray-200'}` }, i))) }), _jsx("span", { className: "text-xs", children: "& Up" })] }, stars)))] })] })] }));
|
|
25
24
|
export function ElectronicsHomePageGrid({ storeConfig: initialConfig }) {
|
|
26
|
-
const { store,
|
|
25
|
+
const { store, addToCart, setIsCartOpen, cartCount, wishlist } = useStore();
|
|
27
26
|
const storeConfig = store || initialConfig;
|
|
28
27
|
const layoutConfig = storeConfig.layoutConfig;
|
|
29
28
|
// In preview mode, use mock data if none are available
|
|
@@ -151,5 +150,5 @@ export function ElectronicsHomePageGrid({ storeConfig: initialConfig }) {
|
|
|
151
150
|
addToast('Thank you for subscribing!', 'success');
|
|
152
151
|
emailInput.value = '';
|
|
153
152
|
}
|
|
154
|
-
}, className: "flex flex-col gap-3", children: [_jsx("input", { type: "email", placeholder: "Enter email for deals", required: true, className: "rounded border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:border-gray-500 transition-colors bg-white" }), _jsx(Button, { type: "submit", size: "sm", className: "bg-gray-900 hover:bg-gray-800 text-white w-full font-normal", children: "Subscribe" })] })] })] }), _jsxs("div", { className: "border-t border-gray-100 pt-8 flex flex-col md:flex-row justify-between items-center gap-4 text-xs text-gray-400", children: [_jsxs("p", { children: ["\u00A9 2024 ", storeConfig.name, ". All rights reserved."] }), _jsxs("div", { className: "flex gap-6", children: [_jsx(Link, { href: `/${storeConfig.slug}/privacy`, className: "hover:text-gray-600 transition-colors", children: "Privacy Policy" }), _jsx(Link, { href: `/${storeConfig.slug}/terms`, className: "hover:text-gray-600 transition-colors", children: "Terms & Conditions" }), _jsx(Link, { href: `/${storeConfig.slug}/help-center`, className: "hover:text-gray-600 transition-colors", children: "Accessibility" })] })] })] }) }), _jsx(
|
|
153
|
+
}, className: "flex flex-col gap-3", children: [_jsx("input", { type: "email", placeholder: "Enter email for deals", required: true, className: "rounded border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:border-gray-500 transition-colors bg-white" }), _jsx(Button, { type: "submit", size: "sm", className: "bg-gray-900 hover:bg-gray-800 text-white w-full font-normal", children: "Subscribe" })] })] })] }), _jsxs("div", { className: "border-t border-gray-100 pt-8 flex flex-col md:flex-row justify-between items-center gap-4 text-xs text-gray-400", children: [_jsxs("p", { children: ["\u00A9 2024 ", storeConfig.name, ". All rights reserved."] }), _jsxs("div", { className: "flex gap-6", children: [_jsx(Link, { href: `/${storeConfig.slug}/privacy`, className: "hover:text-gray-600 transition-colors", children: "Privacy Policy" }), _jsx(Link, { href: `/${storeConfig.slug}/terms`, className: "hover:text-gray-600 transition-colors", children: "Terms & Conditions" }), _jsx(Link, { href: `/${storeConfig.slug}/help-center`, className: "hover:text-gray-600 transition-colors", children: "Accessibility" })] })] })] }) }), _jsx(StoreCartSheet, { storeConfig: storeConfig, title: `My Cart (${cartCount})` }), _jsx(Sheet, { isOpen: isMobileMenuOpen, onClose: () => setIsMobileMenuOpen(false), title: "Menu", side: "left", children: _jsx("div", { className: "py-2", children: categories.map(cat => (_jsx(Link, { href: `/${storeConfig.slug}/categories/${cat.slug}`, onClick: () => setIsMobileMenuOpen(false), className: "block px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-blue-600 border-b border-gray-100", children: cat.name }, cat.id))) }) }), _jsx(PromoBanner, { config: layoutConfig?.sections?.promoBanner, layoutStyle: "electronics" })] }));
|
|
155
154
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics-grid/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAiC5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BA+4BpG"}
|