@pradip1995/create-storefront 1.0.1
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/bin/create-storefront.js +239 -0
- package/lib/kit-next-config.js +84 -0
- package/package.json +32 -0
- package/templates/storefront/.eslintrc.json +3 -0
- package/templates/storefront/README.md +35 -0
- package/templates/storefront/check-env-variables.js +51 -0
- package/templates/storefront/kit-next-config.js +71 -0
- package/templates/storefront/next-env.d.ts +5 -0
- package/templates/storefront/next.config.js +25 -0
- package/templates/storefront/package.json +56 -0
- package/templates/storefront/postcss.config.js +6 -0
- package/templates/storefront/public/favicon.png +0 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/checkout/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/checkout/payment/page.tsx +47 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/layout.tsx +31 -0
- package/templates/storefront/src/app/[countryCode]/(checkout)/not-found.tsx +19 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/addresses/page.tsx +31 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/loading.tsx +9 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/details/[id]/page.tsx +35 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/exchange/[id]/page.tsx +47 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/page.tsx +28 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/return/[id]/page.tsx +66 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/page.tsx +22 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/payment-methods/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx +43 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@login/default.tsx +11 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/@login/page.tsx +18 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/guest-orders/page.tsx +13 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/layout.tsx +22 -0
- package/templates/storefront/src/app/[countryCode]/(main)/account/loading.tsx +9 -0
- package/templates/storefront/src/app/[countryCode]/(main)/cart/loading.tsx +5 -0
- package/templates/storefront/src/app/[countryCode]/(main)/cart/not-found.tsx +21 -0
- package/templates/storefront/src/app/[countryCode]/(main)/cart/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(main)/categories/[...category]/page.tsx +11 -0
- package/templates/storefront/src/app/[countryCode]/(main)/collections/[handle]/page.tsx +11 -0
- package/templates/storefront/src/app/[countryCode]/(main)/contact/page.tsx +21 -0
- package/templates/storefront/src/app/[countryCode]/(main)/guest-orders/page.tsx +12 -0
- package/templates/storefront/src/app/[countryCode]/(main)/help/page.tsx +28 -0
- package/templates/storefront/src/app/[countryCode]/(main)/layout.tsx +21 -0
- package/templates/storefront/src/app/[countryCode]/(main)/not-found.tsx +20 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/confirmed/loading.tsx +5 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/confirmed/page.tsx +23 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/accept/page.tsx +41 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/decline/page.tsx +41 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/page.tsx +38 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/exchange/[id]/page.tsx +47 -0
- package/templates/storefront/src/app/[countryCode]/(main)/order/return/[id]/page.tsx +61 -0
- package/templates/storefront/src/app/[countryCode]/(main)/orders/[id]/page.tsx +33 -0
- package/templates/storefront/src/app/[countryCode]/(main)/page.tsx +24 -0
- package/templates/storefront/src/app/[countryCode]/(main)/privacy-policy/page.tsx +173 -0
- package/templates/storefront/src/app/[countryCode]/(main)/products/[handle]/page.tsx +193 -0
- package/templates/storefront/src/app/[countryCode]/(main)/reset-password/page.tsx +192 -0
- package/templates/storefront/src/app/[countryCode]/(main)/store/page.tsx +72 -0
- package/templates/storefront/src/app/[countryCode]/(main)/terms-of-use/page.tsx +179 -0
- package/templates/storefront/src/app/[countryCode]/(main)/wishlist/page.tsx +19 -0
- package/templates/storefront/src/app/api/meta/event/route.ts +63 -0
- package/templates/storefront/src/app/auth/customer/google/callback/page.tsx +126 -0
- package/templates/storefront/src/app/layout.tsx +104 -0
- package/templates/storefront/src/app/not-found.tsx +30 -0
- package/templates/storefront/src/app/opengraph-image.jpg +0 -0
- package/templates/storefront/src/app/robots.ts +15 -0
- package/templates/storefront/src/app/sitemap.ts +65 -0
- package/templates/storefront/src/app/twitter-image.jpg +0 -0
- package/templates/storefront/src/modules/account/components/account-deletion/index.tsx +160 -0
- package/templates/storefront/src/modules/account/components/account-info/index.tsx +145 -0
- package/templates/storefront/src/modules/account/components/account-nav/icons.tsx +43 -0
- package/templates/storefront/src/modules/account/components/account-nav/index.tsx +318 -0
- package/templates/storefront/src/modules/account/components/account-nav/logout-modal.tsx +92 -0
- package/templates/storefront/src/modules/account/components/account-nav/payment-methods-icon.tsx +9 -0
- package/templates/storefront/src/modules/account/components/address-book/index.tsx +47 -0
- package/templates/storefront/src/modules/account/components/address-card/add-address.tsx +377 -0
- package/templates/storefront/src/modules/account/components/address-card/edit-address-modal.tsx +468 -0
- package/templates/storefront/src/modules/account/components/deletion-pending-modal/index.tsx +213 -0
- package/templates/storefront/src/modules/account/components/forgot-password/index.tsx +1 -0
- package/templates/storefront/src/modules/account/components/login/index.tsx +1 -0
- package/templates/storefront/src/modules/account/components/order-card/index.tsx +221 -0
- package/templates/storefront/src/modules/account/components/order-overview/index.tsx +159 -0
- package/templates/storefront/src/modules/account/components/overview/index.tsx +189 -0
- package/templates/storefront/src/modules/account/components/profile-billing-address/index.tsx +447 -0
- package/templates/storefront/src/modules/account/components/profile-email/index.tsx +75 -0
- package/templates/storefront/src/modules/account/components/profile-form/index.tsx +416 -0
- package/templates/storefront/src/modules/account/components/profile-name/index.tsx +76 -0
- package/templates/storefront/src/modules/account/components/profile-password/index.tsx +70 -0
- package/templates/storefront/src/modules/account/components/profile-phone/index.tsx +185 -0
- package/templates/storefront/src/modules/account/components/register/index.tsx +1 -0
- package/templates/storefront/src/modules/account/components/return-item-selector/index.tsx +187 -0
- package/templates/storefront/src/modules/account/components/return-shipping-selector/index.tsx +118 -0
- package/templates/storefront/src/modules/account/components/transfer-request-form/index.tsx +81 -0
- package/templates/storefront/src/modules/account/templates/account-layout.tsx +38 -0
- package/templates/storefront/src/modules/account/templates/exchange-request-template.tsx +389 -0
- package/templates/storefront/src/modules/account/templates/guest-orders-template.tsx +123 -0
- package/templates/storefront/src/modules/account/templates/login-template.tsx +44 -0
- package/templates/storefront/src/modules/account/templates/payment-methods-template.tsx +478 -0
- package/templates/storefront/src/modules/account/templates/return-request-template.tsx +300 -0
- package/templates/storefront/src/modules/cart/components/abandoned-carts/ScrollToPendingOrdersButton.tsx +21 -0
- package/templates/storefront/src/modules/cart/components/abandoned-carts/index.tsx +335 -0
- package/templates/storefront/src/modules/cart/components/applied-promotions/index.tsx +121 -0
- package/templates/storefront/src/modules/cart/components/cart-delivery-selection/index.tsx +203 -0
- package/templates/storefront/src/modules/cart/components/cart-item-card/index.tsx +476 -0
- package/templates/storefront/src/modules/cart/components/cart-item-select/index.tsx +73 -0
- package/templates/storefront/src/modules/cart/components/cart-view-tracker/index.tsx +44 -0
- package/templates/storefront/src/modules/cart/components/delivery-information/index.tsx +89 -0
- package/templates/storefront/src/modules/cart/components/empty-cart-message/index.tsx +38 -0
- package/templates/storefront/src/modules/cart/components/item/index.tsx +150 -0
- package/templates/storefront/src/modules/cart/components/pincode-checker/index.tsx +174 -0
- package/templates/storefront/src/modules/cart/components/sign-in-prompt/index.tsx +26 -0
- package/templates/storefront/src/modules/cart/components/you-may-also-like/index.tsx +137 -0
- package/templates/storefront/src/modules/cart/templates/index.tsx +88 -0
- package/templates/storefront/src/modules/cart/templates/items.tsx +49 -0
- package/templates/storefront/src/modules/cart/templates/preview.tsx +51 -0
- package/templates/storefront/src/modules/cart/templates/summary.tsx +29 -0
- package/templates/storefront/src/modules/checkout/components/add-address-modal/index.tsx +390 -0
- package/templates/storefront/src/modules/checkout/components/address-card/index.tsx +135 -0
- package/templates/storefront/src/modules/checkout/components/address-select/index.tsx +116 -0
- package/templates/storefront/src/modules/checkout/components/addresses/index.tsx +605 -0
- package/templates/storefront/src/modules/checkout/components/back-link/index.tsx +32 -0
- package/templates/storefront/src/modules/checkout/components/billing_address/index.tsx +301 -0
- package/templates/storefront/src/modules/checkout/components/checkout-begin-tracker/index.tsx +45 -0
- package/templates/storefront/src/modules/checkout/components/checkout-leave-guard/index.tsx +109 -0
- package/templates/storefront/src/modules/checkout/components/checkout-shipping-tracker/index.tsx +45 -0
- package/templates/storefront/src/modules/checkout/components/country-select/index.tsx +50 -0
- package/templates/storefront/src/modules/checkout/components/discount-code/index.tsx +220 -0
- package/templates/storefront/src/modules/checkout/components/error-message/index.tsx +13 -0
- package/templates/storefront/src/modules/checkout/components/payment/index.tsx +572 -0
- package/templates/storefront/src/modules/checkout/components/payment-button/index.tsx +257 -0
- package/templates/storefront/src/modules/checkout/components/payment-button/razorpay-payment-button.tsx +136 -0
- package/templates/storefront/src/modules/checkout/components/payment-container/index.tsx +129 -0
- package/templates/storefront/src/modules/checkout/components/payment-test/index.tsx +12 -0
- package/templates/storefront/src/modules/checkout/components/payment-wrapper/index.tsx +50 -0
- package/templates/storefront/src/modules/checkout/components/payment-wrapper/stripe-wrapper.tsx +54 -0
- package/templates/storefront/src/modules/checkout/components/processing-overlay/index.tsx +83 -0
- package/templates/storefront/src/modules/checkout/components/review/index.tsx +60 -0
- package/templates/storefront/src/modules/checkout/components/select-address-modal/index.tsx +103 -0
- package/templates/storefront/src/modules/checkout/components/shipping/index.tsx +533 -0
- package/templates/storefront/src/modules/checkout/components/shipping-address/index.tsx +521 -0
- package/templates/storefront/src/modules/checkout/components/submit-button/index.tsx +32 -0
- package/templates/storefront/src/modules/checkout/templates/checkout-form/index.tsx +38 -0
- package/templates/storefront/src/modules/checkout/templates/checkout-summary/index.tsx +274 -0
- package/templates/storefront/src/modules/common/components/breadcrumb/index.tsx +43 -0
- package/templates/storefront/src/modules/common/components/cart-totals/index.tsx +473 -0
- package/templates/storefront/src/modules/common/components/checkbox/index.tsx +98 -0
- package/templates/storefront/src/modules/common/components/delete-button/index.tsx +156 -0
- package/templates/storefront/src/modules/common/components/divider/index.tsx +9 -0
- package/templates/storefront/src/modules/common/components/filter-checkbox-group/index.tsx +134 -0
- package/templates/storefront/src/modules/common/components/filter-radio-group/index.tsx +62 -0
- package/templates/storefront/src/modules/common/components/input/index.tsx +79 -0
- package/templates/storefront/src/modules/common/components/interactive-link/index.tsx +33 -0
- package/templates/storefront/src/modules/common/components/line-item-options/index.tsx +26 -0
- package/templates/storefront/src/modules/common/components/line-item-price/index.tsx +64 -0
- package/templates/storefront/src/modules/common/components/line-item-unit-price/index.tsx +61 -0
- package/templates/storefront/src/modules/common/components/localized-client-link/index.tsx +32 -0
- package/templates/storefront/src/modules/common/components/login-popup/index.tsx +78 -0
- package/templates/storefront/src/modules/common/components/modal/index.tsx +123 -0
- package/templates/storefront/src/modules/common/components/native-select/index.tsx +75 -0
- package/templates/storefront/src/modules/common/components/obfuscated-email/index.tsx +30 -0
- package/templates/storefront/src/modules/common/components/product/product-rating/index.tsx +172 -0
- package/templates/storefront/src/modules/common/components/product/review-modal/index.tsx +333 -0
- package/templates/storefront/src/modules/common/components/product/share-button/index.tsx +227 -0
- package/templates/storefront/src/modules/common/components/product/wishlist-icon/index.tsx +46 -0
- package/templates/storefront/src/modules/common/components/radio/index.tsx +27 -0
- package/templates/storefront/src/modules/common/components/select/index.tsx +164 -0
- package/templates/storefront/src/modules/common/components/side-panel/index.tsx +65 -0
- package/templates/storefront/src/modules/common/icons/arrow-left.tsx +36 -0
- package/templates/storefront/src/modules/common/icons/back.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/bancontact.tsx +26 -0
- package/templates/storefront/src/modules/common/icons/chevron-down.tsx +30 -0
- package/templates/storefront/src/modules/common/icons/delivered.tsx +29 -0
- package/templates/storefront/src/modules/common/icons/envelope.tsx +27 -0
- package/templates/storefront/src/modules/common/icons/eye-off.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/eye.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/fast-delivery.tsx +65 -0
- package/templates/storefront/src/modules/common/icons/ideal.tsx +26 -0
- package/templates/storefront/src/modules/common/icons/lock.tsx +31 -0
- package/templates/storefront/src/modules/common/icons/map-pin.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/medusa.tsx +27 -0
- package/templates/storefront/src/modules/common/icons/menu.tsx +45 -0
- package/templates/storefront/src/modules/common/icons/nextjs.tsx +27 -0
- package/templates/storefront/src/modules/common/icons/package.tsx +44 -0
- package/templates/storefront/src/modules/common/icons/paypal.tsx +30 -0
- package/templates/storefront/src/modules/common/icons/phone.tsx +30 -0
- package/templates/storefront/src/modules/common/icons/placeholder-image.tsx +44 -0
- package/templates/storefront/src/modules/common/icons/refresh.tsx +51 -0
- package/templates/storefront/src/modules/common/icons/spinner.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/trash.tsx +51 -0
- package/templates/storefront/src/modules/common/icons/user.tsx +37 -0
- package/templates/storefront/src/modules/common/icons/x.tsx +37 -0
- package/templates/storefront/src/modules/contact/templates/index.tsx +272 -0
- package/templates/storefront/src/modules/help/templates/index.tsx +629 -0
- package/templates/storefront/src/modules/home/components/dynamic-banner/index.tsx +190 -0
- package/templates/storefront/src/modules/home/components/featured-products/index.tsx +16 -0
- package/templates/storefront/src/modules/home/components/featured-products/product-rail/index.tsx +51 -0
- package/templates/storefront/src/modules/home/components/features/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/hero/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/loved-by-moms/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/new-arrivals/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/shop-by-age/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/shop-by-category/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/testimonials/index.tsx +1 -0
- package/templates/storefront/src/modules/home/components/why-choose-us/dynamic-features.tsx +93 -0
- package/templates/storefront/src/modules/home/components/why-choose-us/index.tsx +1 -0
- package/templates/storefront/src/modules/layout/components/account-dropdown/index.tsx +56 -0
- package/templates/storefront/src/modules/layout/components/cart-button/index.tsx +8 -0
- package/templates/storefront/src/modules/layout/components/cart-dropdown/index.tsx +424 -0
- package/templates/storefront/src/modules/layout/components/cart-mismatch-banner/index.tsx +57 -0
- package/templates/storefront/src/modules/layout/components/cookie-consent/index.tsx +116 -0
- package/templates/storefront/src/modules/layout/components/country-select/index.tsx +135 -0
- package/templates/storefront/src/modules/layout/components/desktop-search/index.tsx +148 -0
- package/templates/storefront/src/modules/layout/components/dynamic-logo/index.tsx +27 -0
- package/templates/storefront/src/modules/layout/components/footer-categories/index.tsx +34 -0
- package/templates/storefront/src/modules/layout/components/footer-contact/index.tsx +87 -0
- package/templates/storefront/src/modules/layout/components/footer-description/index.tsx +12 -0
- package/templates/storefront/src/modules/layout/components/footer-logo/index.tsx +22 -0
- package/templates/storefront/src/modules/layout/components/footer-newsletter/index.tsx +100 -0
- package/templates/storefront/src/modules/layout/components/language-select/index.tsx +192 -0
- package/templates/storefront/src/modules/layout/components/medusa-cta/index.tsx +21 -0
- package/templates/storefront/src/modules/layout/components/mobile-menu/index.tsx +296 -0
- package/templates/storefront/src/modules/layout/components/nav-links/index.tsx +66 -0
- package/templates/storefront/src/modules/layout/components/nav-wrapper/index.tsx +14 -0
- package/templates/storefront/src/modules/layout/components/promo-bar/index.tsx +7 -0
- package/templates/storefront/src/modules/layout/components/promo-bar/promo-bar-content.tsx +174 -0
- package/templates/storefront/src/modules/layout/components/push-notification-manager/index.tsx +191 -0
- package/templates/storefront/src/modules/layout/components/search-panel/index.tsx +136 -0
- package/templates/storefront/src/modules/layout/components/side-menu/index.tsx +144 -0
- package/templates/storefront/src/modules/layout/components/verification-banner/index.tsx +217 -0
- package/templates/storefront/src/modules/layout/components/wishlist-counter/index.tsx +17 -0
- package/templates/storefront/src/modules/layout/templates/footer/index.tsx +7 -0
- package/templates/storefront/src/modules/layout/templates/nav/index.tsx +14 -0
- package/templates/storefront/src/modules/order/components/cancel-order-modal/index.tsx +168 -0
- package/templates/storefront/src/modules/order/components/help/index.tsx +25 -0
- package/templates/storefront/src/modules/order/components/item/index.tsx +62 -0
- package/templates/storefront/src/modules/order/components/items/index.tsx +44 -0
- package/templates/storefront/src/modules/order/components/onboarding-cta/index.tsx +28 -0
- package/templates/storefront/src/modules/order/components/order-confirmation-back-handler/index.tsx +28 -0
- package/templates/storefront/src/modules/order/components/order-details/index.tsx +63 -0
- package/templates/storefront/src/modules/order/components/order-purchase-tracker/index.tsx +48 -0
- package/templates/storefront/src/modules/order/components/order-redesign/index.tsx +887 -0
- package/templates/storefront/src/modules/order/components/order-summary/index.tsx +60 -0
- package/templates/storefront/src/modules/order/components/payment-details/index.tsx +63 -0
- package/templates/storefront/src/modules/order/components/shipping-details/index.tsx +73 -0
- package/templates/storefront/src/modules/order/components/transfer-actions/index.tsx +81 -0
- package/templates/storefront/src/modules/order/components/transfer-image/index.tsx +275 -0
- package/templates/storefront/src/modules/order/templates/order-completed-template.tsx +233 -0
- package/templates/storefront/src/modules/order/templates/order-details-template.tsx +128 -0
- package/templates/storefront/src/modules/products/components/image-gallery/index.tsx +297 -0
- package/templates/storefront/src/modules/products/components/product-actions/index.tsx +1400 -0
- package/templates/storefront/src/modules/products/components/product-actions/mobile-actions.tsx +217 -0
- package/templates/storefront/src/modules/products/components/product-actions/option-select.tsx +62 -0
- package/templates/storefront/src/modules/products/components/product-onboarding-cta/index.tsx +30 -0
- package/templates/storefront/src/modules/products/components/product-preview/index.tsx +5 -0
- package/templates/storefront/src/modules/products/components/product-preview/price.tsx +29 -0
- package/templates/storefront/src/modules/products/components/product-price/index.tsx +58 -0
- package/templates/storefront/src/modules/products/components/product-rating/index.tsx +1 -0
- package/templates/storefront/src/modules/products/components/product-tabs/accordion.tsx +100 -0
- package/templates/storefront/src/modules/products/components/product-tabs/index.tsx +127 -0
- package/templates/storefront/src/modules/products/components/product-tabs/ratings-tab.tsx +598 -0
- package/templates/storefront/src/modules/products/components/product-view-tracker/index.tsx +53 -0
- package/templates/storefront/src/modules/products/components/related-products/index.tsx +152 -0
- package/templates/storefront/src/modules/products/components/review-modal/index.tsx +1 -0
- package/templates/storefront/src/modules/products/components/share-button/index.tsx +1 -0
- package/templates/storefront/src/modules/products/components/thumbnail/index.tsx +91 -0
- package/templates/storefront/src/modules/products/components/wishlist-icon/index.tsx +1 -0
- package/templates/storefront/src/modules/products/context/product-context.tsx +52 -0
- package/templates/storefront/src/modules/products/templates/index.tsx +26 -0
- package/templates/storefront/src/modules/products/templates/product-actions-wrapper/index.tsx +1 -0
- package/templates/storefront/src/modules/products/templates/product-info/index.tsx +2 -0
- package/templates/storefront/src/modules/shipping/components/free-shipping-price-nudge/index.tsx +283 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-button/index.tsx +5 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-card-details/index.tsx +10 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-cart-item/index.tsx +35 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-cart-totals/index.tsx +30 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-code-form/index.tsx +13 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-line-item/index.tsx +35 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-confirmed-header/index.tsx +14 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-information/index.tsx +36 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-items/index.tsx +43 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-order-summary/index.tsx +15 -0
- package/templates/storefront/src/modules/skeletons/components/skeleton-product-preview/index.tsx +15 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-cart-page/index.tsx +65 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-order-confirmed/index.tsx +21 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-product-grid/index.tsx +23 -0
- package/templates/storefront/src/modules/skeletons/templates/skeleton-related-products/index.tsx +25 -0
- package/templates/storefront/src/modules/store/components/client-paginated-products.tsx +108 -0
- package/templates/storefront/src/modules/store/components/mobile-filters/index.tsx +135 -0
- package/templates/storefront/src/modules/store/components/pagination/index.tsx +118 -0
- package/templates/storefront/src/modules/store/components/product-list-view-tracker/index.tsx +43 -0
- package/templates/storefront/src/modules/store/components/refinement-list/index.tsx +299 -0
- package/templates/storefront/src/modules/store/components/refinement-list/sort-products/index.tsx +120 -0
- package/templates/storefront/src/modules/store/components/store-header/index.tsx +67 -0
- package/templates/storefront/src/modules/store/templates/index.tsx +1 -0
- package/templates/storefront/src/modules/store/templates/paginated-products.tsx +175 -0
- package/templates/storefront/src/modules/wishlist/components/wishlist-item/index.tsx +797 -0
- package/templates/storefront/src/modules/wishlist/templates/index.tsx +176 -0
- package/templates/storefront/src/storefront.config.ts +12 -0
- package/templates/storefront/src/styles/globals.css +326 -0
- package/templates/storefront/src/theme/valero/blocks/home/Features/index.tsx +61 -0
- package/templates/storefront/src/theme/valero/blocks/home/Hero/index.tsx +102 -0
- package/templates/storefront/src/theme/valero/blocks/home/LovedByMoms/index.tsx +407 -0
- package/templates/storefront/src/theme/valero/blocks/home/NewArrivals/index.tsx +48 -0
- package/templates/storefront/src/theme/valero/blocks/home/ShopByAge/index.tsx +128 -0
- package/templates/storefront/src/theme/valero/blocks/home/ShopByCategory/index.tsx +409 -0
- package/templates/storefront/src/theme/valero/blocks/home/Testimonials/index.tsx +697 -0
- package/templates/storefront/src/theme/valero/blocks/home/WhyChooseUs/index.tsx +62 -0
- package/templates/storefront/src/theme/valero/layouts/MainLayoutShell.tsx +14 -0
- package/templates/storefront/src/theme/valero/primitives/Button.tsx +28 -0
- package/templates/storefront/src/theme/valero/primitives/Card.tsx +32 -0
- package/templates/storefront/src/theme/valero/primitives/index.ts +2 -0
- package/templates/storefront/src/theme/valero/slots/account/ForgotPassword/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/account/Login/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/account/LoginTemplate/index.tsx +44 -0
- package/templates/storefront/src/theme/valero/slots/account/Register/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/cart/CartItem/index.tsx +11 -0
- package/templates/storefront/src/theme/valero/slots/cart/CartSummary/index.tsx +13 -0
- package/templates/storefront/src/theme/valero/slots/checkout/CheckoutForm/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/checkout/CheckoutSummary/index.tsx +1 -0
- package/templates/storefront/src/theme/valero/slots/layout/Footer/index.tsx +104 -0
- package/templates/storefront/src/theme/valero/slots/layout/Nav/index.tsx +97 -0
- package/templates/storefront/src/theme/valero/slots/layout/PromoBar/index.tsx +19 -0
- package/templates/storefront/src/theme/valero/slots/layout/PromoBar/promo-bar-content.tsx +174 -0
- package/templates/storefront/src/theme/valero/slots/order/OrderDetails/index.tsx +12 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductCTASection.tsx +191 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductDetailsSection.tsx +137 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductFeaturePanel.tsx +245 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductHighlightsSection.tsx +98 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductOptionsSection.tsx +233 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductPriceSection.tsx +53 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductTrustSection.tsx +84 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductActions/index.tsx +161 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductCard/index.tsx +132 -0
- package/templates/storefront/src/theme/valero/slots/product/ProductInfo/index.tsx +40 -0
- package/templates/storefront/src/theme/valero/templates/StorePage/index.tsx +154 -0
- package/templates/storefront/src/theme/valero/tokens/colors.js +16 -0
- package/templates/storefront/src/theme/valero/tokens/colors.ts +21 -0
- package/templates/storefront/src/theme/valero/tokens/fonts.ts +13 -0
- package/templates/storefront/src/theme/valero/tokens/index.ts +3 -0
- package/templates/storefront/src/theme/valero/tokens/spacing.ts +9 -0
- package/templates/storefront/src/theme/valero/tokens/theme.css +91 -0
- package/templates/storefront/tailwind.config.js +221 -0
- package/templates/storefront/tsconfig.json +30 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation"
|
|
4
|
+
|
|
5
|
+
export function Pagination({
|
|
6
|
+
page,
|
|
7
|
+
totalPages,
|
|
8
|
+
'data-testid': dataTestid
|
|
9
|
+
}: {
|
|
10
|
+
page: number
|
|
11
|
+
totalPages: number
|
|
12
|
+
'data-testid'?: string
|
|
13
|
+
}) {
|
|
14
|
+
const router = useRouter()
|
|
15
|
+
const pathname = usePathname()
|
|
16
|
+
const searchParams = useSearchParams()
|
|
17
|
+
|
|
18
|
+
const handlePageChange = (newPage: number) => {
|
|
19
|
+
const params = new URLSearchParams(searchParams)
|
|
20
|
+
params.set("page", newPage.toString())
|
|
21
|
+
router.push(`${pathname}?${params.toString()}`)
|
|
22
|
+
// Scroll to top smoothly
|
|
23
|
+
window.scrollTo({ top: 0, behavior: "smooth" })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Generate page numbers to display
|
|
27
|
+
const getPageNumbers = (): (number | "ellipsis")[] => {
|
|
28
|
+
const pages: (number | "ellipsis")[] = []
|
|
29
|
+
|
|
30
|
+
if (totalPages <= 7) {
|
|
31
|
+
for (let i = 1; i <= totalPages; i++) pages.push(i)
|
|
32
|
+
} else if (page <= 3) {
|
|
33
|
+
pages.push(1, 2, 3, 4, "ellipsis", totalPages)
|
|
34
|
+
} else if (page >= totalPages - 2) {
|
|
35
|
+
pages.push(1, "ellipsis", totalPages - 3, totalPages - 2, totalPages - 1, totalPages)
|
|
36
|
+
} else {
|
|
37
|
+
pages.push(1, "ellipsis", page - 1, page, page + 1, "ellipsis", totalPages)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return pages
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const pageNumbers = getPageNumbers()
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div className="flex flex-col items-center gap-5 mt-12 mb-4" data-testid={dataTestid}>
|
|
47
|
+
{/* Page Info */}
|
|
48
|
+
<p className="text-sm text-gray-400 font-medium tracking-wide">
|
|
49
|
+
Page <span className="text-gray-800 font-bold">{page}</span> of <span className="text-gray-800 font-bold">{totalPages}</span>
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
{/* Pagination Controls */}
|
|
53
|
+
<div className="flex items-center gap-1.5 sm:gap-2">
|
|
54
|
+
{/* Previous Button */}
|
|
55
|
+
<button
|
|
56
|
+
onClick={() => handlePageChange(page - 1)}
|
|
57
|
+
disabled={page <= 1}
|
|
58
|
+
className="group flex items-center justify-center w-10 h-10 sm:w-11 sm:h-11 rounded-xl border border-gray-200 bg-white text-gray-500 transition-all duration-200 hover:border-[#8B5AB1] hover:text-[#8B5AB1] hover:shadow-md hover:shadow-purple-100/50 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:border-gray-200 disabled:hover:text-gray-400 disabled:hover:shadow-none"
|
|
59
|
+
aria-label="Previous page"
|
|
60
|
+
>
|
|
61
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="transition-transform group-hover:-translate-x-0.5">
|
|
62
|
+
<path d="M15 18l-6-6 6-6" />
|
|
63
|
+
</svg>
|
|
64
|
+
</button>
|
|
65
|
+
|
|
66
|
+
{/* Page Numbers */}
|
|
67
|
+
<div className="flex items-center gap-1 sm:gap-1.5">
|
|
68
|
+
{pageNumbers.map((p, idx) => {
|
|
69
|
+
if (p === "ellipsis") {
|
|
70
|
+
return (
|
|
71
|
+
<span
|
|
72
|
+
key={`ellipsis-${idx}`}
|
|
73
|
+
className="w-8 h-10 sm:w-10 sm:h-11 flex items-center justify-center text-gray-300 text-lg font-medium select-none"
|
|
74
|
+
>
|
|
75
|
+
•••
|
|
76
|
+
</span>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const isCurrent = p === page
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<button
|
|
84
|
+
key={p}
|
|
85
|
+
onClick={() => handlePageChange(p)}
|
|
86
|
+
disabled={isCurrent}
|
|
87
|
+
className={`
|
|
88
|
+
relative w-10 h-10 sm:w-11 sm:h-11 rounded-xl text-sm font-bold transition-all duration-200
|
|
89
|
+
${isCurrent
|
|
90
|
+
? "bg-[#8B5AB1] text-white shadow-lg shadow-[#8B5AB1]/30 scale-105 cursor-default"
|
|
91
|
+
: "bg-white border border-gray-200 text-gray-600 hover:border-[#8B5AB1] hover:text-[#8B5AB1] hover:bg-purple-50/50 hover:shadow-sm"
|
|
92
|
+
}
|
|
93
|
+
`}
|
|
94
|
+
>
|
|
95
|
+
{p}
|
|
96
|
+
{isCurrent && (
|
|
97
|
+
<span className="absolute -bottom-0.5 left-1/2 -translate-x-1/2 w-4 h-1 bg-[#8B5AB1] rounded-full opacity-60" />
|
|
98
|
+
)}
|
|
99
|
+
</button>
|
|
100
|
+
)
|
|
101
|
+
})}
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
{/* Next Button */}
|
|
105
|
+
<button
|
|
106
|
+
onClick={() => handlePageChange(page + 1)}
|
|
107
|
+
disabled={page >= totalPages}
|
|
108
|
+
className="group flex items-center justify-center w-10 h-10 sm:w-11 sm:h-11 rounded-xl border border-gray-200 bg-white text-gray-500 transition-all duration-200 hover:border-[#8B5AB1] hover:text-[#8B5AB1] hover:shadow-md hover:shadow-purple-100/50 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:border-gray-200 disabled:hover:text-gray-400 disabled:hover:shadow-none"
|
|
109
|
+
aria-label="Next page"
|
|
110
|
+
>
|
|
111
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="transition-transform group-hover:translate-x-0.5">
|
|
112
|
+
<path d="M9 18l6-6-6-6" />
|
|
113
|
+
</svg>
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useEffect } from "react"
|
|
4
|
+
import { trackViewItemList } from "@core/analytics/ga4-ecommerce"
|
|
5
|
+
|
|
6
|
+
type ProductListViewTrackerProps = {
|
|
7
|
+
products: Array<{
|
|
8
|
+
id: string
|
|
9
|
+
title?: string
|
|
10
|
+
variants?: Array<{
|
|
11
|
+
id: string
|
|
12
|
+
calculated_price?: { calculated_amount?: number; currency_code?: string }
|
|
13
|
+
}>
|
|
14
|
+
}>
|
|
15
|
+
listId?: string
|
|
16
|
+
listName?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function ProductListViewTracker({
|
|
20
|
+
products,
|
|
21
|
+
listId,
|
|
22
|
+
listName,
|
|
23
|
+
}: ProductListViewTrackerProps) {
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!products?.length) return
|
|
26
|
+
|
|
27
|
+
const items = products.map((p, index) => {
|
|
28
|
+
const variant = p.variants?.[0]
|
|
29
|
+
const unitPrice = (variant as any)?.calculated_price?.calculated_amount ?? 0
|
|
30
|
+
return {
|
|
31
|
+
item_id: variant?.id ?? p.id,
|
|
32
|
+
item_name: p.title ?? "",
|
|
33
|
+
price: unitPrice / 100,
|
|
34
|
+
quantity: 1,
|
|
35
|
+
index,
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
trackViewItemList({ list_id: listId, list_name: listName, items })
|
|
40
|
+
}, [products, listId, listName])
|
|
41
|
+
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation"
|
|
4
|
+
import { useCallback, useState, useEffect, useTransition } from "react"
|
|
5
|
+
import { HttpTypes } from "@medusajs/types"
|
|
6
|
+
import { SortOptions } from "./sort-products"
|
|
7
|
+
import FilterCheckboxGroup from "@modules/common/components/filter-checkbox-group"
|
|
8
|
+
|
|
9
|
+
type RefinementListProps = {
|
|
10
|
+
sortBy: SortOptions
|
|
11
|
+
search?: boolean
|
|
12
|
+
'data-testid'?: string
|
|
13
|
+
collections?: HttpTypes.StoreCollection[]
|
|
14
|
+
collectionValue?: string | string[]
|
|
15
|
+
genderValue?: string | string[]
|
|
16
|
+
typeValue?: string | string[]
|
|
17
|
+
materialValue?: string | string[]
|
|
18
|
+
colorValue?: string | string[]
|
|
19
|
+
categoryValue?: string | string[]
|
|
20
|
+
minPrice?: string
|
|
21
|
+
maxPrice?: string
|
|
22
|
+
genderOptions?: { value: string; label: string }[]
|
|
23
|
+
typeOptions?: { value: string; label: string }[]
|
|
24
|
+
materialOptions?: { value: string; label: string }[]
|
|
25
|
+
colorOptions?: { value: string; label: string }[]
|
|
26
|
+
categoryOptions?: { value: string; label: string }[]
|
|
27
|
+
hideTitle?: boolean
|
|
28
|
+
q?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const RefinementList = ({
|
|
32
|
+
sortBy,
|
|
33
|
+
'data-testid': dataTestId,
|
|
34
|
+
collections,
|
|
35
|
+
collectionValue,
|
|
36
|
+
categoryValue,
|
|
37
|
+
genderValue,
|
|
38
|
+
typeValue,
|
|
39
|
+
materialValue,
|
|
40
|
+
colorValue,
|
|
41
|
+
minPrice,
|
|
42
|
+
maxPrice,
|
|
43
|
+
genderOptions,
|
|
44
|
+
typeOptions,
|
|
45
|
+
materialOptions,
|
|
46
|
+
colorOptions,
|
|
47
|
+
categoryOptions,
|
|
48
|
+
hideTitle = false,
|
|
49
|
+
q,
|
|
50
|
+
}: RefinementListProps) => {
|
|
51
|
+
const router = useRouter()
|
|
52
|
+
const pathname = usePathname()
|
|
53
|
+
const searchParams = useSearchParams()
|
|
54
|
+
const [isPending, startTransition] = useTransition()
|
|
55
|
+
|
|
56
|
+
const [minPriceLocal, setMinPriceLocal] = useState(parseInt(minPrice || "0"))
|
|
57
|
+
const [maxPriceLocal, setMaxPriceLocal] = useState(parseInt(maxPrice || "10000"))
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
setMinPriceLocal(parseInt(minPrice || "0"))
|
|
61
|
+
setMaxPriceLocal(parseInt(maxPrice || "10000"))
|
|
62
|
+
}, [minPrice, maxPrice])
|
|
63
|
+
|
|
64
|
+
const createQueryString = useCallback(
|
|
65
|
+
(name: string, value: string) => {
|
|
66
|
+
const params = new URLSearchParams(searchParams)
|
|
67
|
+
if (value) {
|
|
68
|
+
params.set(name, value)
|
|
69
|
+
} else {
|
|
70
|
+
params.delete(name)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return params.toString()
|
|
74
|
+
},
|
|
75
|
+
[searchParams]
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
const setQueryParams = (name: string, value: string) => {
|
|
79
|
+
const query = createQueryString(name, value)
|
|
80
|
+
startTransition(() => {
|
|
81
|
+
router.replace(`${pathname}?${query}`, { scroll: false })
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const handleFilterChange = (name: string, currentValues: string | string[] | undefined, value: string) => {
|
|
86
|
+
let values: string[] = []
|
|
87
|
+
if (typeof currentValues === "string") {
|
|
88
|
+
values = currentValues.split(",").filter(Boolean)
|
|
89
|
+
} else if (Array.isArray(currentValues)) {
|
|
90
|
+
values = currentValues
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const newValues = values.includes(value)
|
|
94
|
+
? values.filter((v) => v !== value)
|
|
95
|
+
: [...values, value]
|
|
96
|
+
|
|
97
|
+
setQueryParams(name, newValues.join(","))
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const handlePriceApply = () => {
|
|
101
|
+
const params = new URLSearchParams(searchParams)
|
|
102
|
+
params.set("min_price", minPriceLocal.toString())
|
|
103
|
+
params.set("max_price", maxPriceLocal.toString())
|
|
104
|
+
startTransition(() => {
|
|
105
|
+
router.replace(`${pathname}?${params.toString()}`, { scroll: false })
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const clearAllFilters = () => {
|
|
110
|
+
const params = new URLSearchParams(searchParams)
|
|
111
|
+
params.delete("collection")
|
|
112
|
+
params.delete("category")
|
|
113
|
+
params.delete("gender")
|
|
114
|
+
params.delete("type")
|
|
115
|
+
params.delete("material")
|
|
116
|
+
params.delete("color")
|
|
117
|
+
params.delete("min_price")
|
|
118
|
+
params.delete("max_price")
|
|
119
|
+
params.delete("q")
|
|
120
|
+
startTransition(() => {
|
|
121
|
+
router.replace(`${pathname}?${params.toString()}`, { scroll: false })
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const hasFilters = !!(collectionValue || categoryValue || genderValue || typeValue || materialValue || colorValue || minPrice || maxPrice || q)
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div className={`bg-white rounded-lg p-6 shadow-sm border border-gray-200 flex flex-col gap-y-8 transition-opacity duration-75 ${isPending ? 'opacity-90 pointer-events-none' : 'opacity-100'}`}>
|
|
129
|
+
{!hideTitle && (
|
|
130
|
+
<div className="flex items-center justify-between">
|
|
131
|
+
<h2 className="text-lg font-bold text-gray-900 uppercase tracking-tight">FILTERS</h2>
|
|
132
|
+
{hasFilters && (
|
|
133
|
+
<button
|
|
134
|
+
onClick={clearAllFilters}
|
|
135
|
+
className="text-xs font-semibold text-[#8B5AB1] hover:opacity-80 uppercase tracking-wider transition-colors"
|
|
136
|
+
data-ga-event="filter_clear_all_click"
|
|
137
|
+
data-ga-label="Clear All Filters"
|
|
138
|
+
>
|
|
139
|
+
Clear All
|
|
140
|
+
</button>
|
|
141
|
+
)}
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
|
|
145
|
+
{hideTitle && hasFilters && (
|
|
146
|
+
<div className="flex justify-end">
|
|
147
|
+
<button
|
|
148
|
+
onClick={clearAllFilters}
|
|
149
|
+
className="text-xs font-semibold text-[#8B5AB1] hover:opacity-80 uppercase tracking-wider transition-colors"
|
|
150
|
+
data-ga-event="filter_clear_all_click"
|
|
151
|
+
data-ga-label="Clear All Filters"
|
|
152
|
+
>
|
|
153
|
+
Clear All
|
|
154
|
+
</button>
|
|
155
|
+
</div>
|
|
156
|
+
)}
|
|
157
|
+
|
|
158
|
+
{/* SORT BY component has been removed as per requirement */}
|
|
159
|
+
|
|
160
|
+
{collections && collections.length > 0 && (
|
|
161
|
+
<FilterCheckboxGroup
|
|
162
|
+
title="Age Group"
|
|
163
|
+
items={collections.map(c => ({ value: c.id, label: c.title || "" }))}
|
|
164
|
+
values={typeof collectionValue === 'string' ? collectionValue.split(',') : collectionValue || []}
|
|
165
|
+
handleChange={(v) => handleFilterChange('collection', collectionValue, v)}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
168
|
+
|
|
169
|
+
{categoryOptions && categoryOptions.length > 0 && (
|
|
170
|
+
<FilterCheckboxGroup
|
|
171
|
+
title="Category"
|
|
172
|
+
items={categoryOptions}
|
|
173
|
+
values={typeof categoryValue === 'string' ? categoryValue.split(',') : categoryValue || []}
|
|
174
|
+
handleChange={(v) => handleFilterChange('category', categoryValue, v)}
|
|
175
|
+
/>
|
|
176
|
+
)}
|
|
177
|
+
|
|
178
|
+
{genderOptions && genderOptions.length > 0 && (
|
|
179
|
+
<FilterCheckboxGroup
|
|
180
|
+
title="Gender"
|
|
181
|
+
items={genderOptions}
|
|
182
|
+
values={typeof genderValue === 'string' ? genderValue.split(',') : genderValue || []}
|
|
183
|
+
handleChange={(v) => handleFilterChange('gender', genderValue, v)}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
186
|
+
|
|
187
|
+
{typeOptions && typeOptions.length > 0 && (
|
|
188
|
+
<FilterCheckboxGroup
|
|
189
|
+
title="Product Type"
|
|
190
|
+
items={typeOptions}
|
|
191
|
+
values={typeof typeValue === 'string' ? typeValue.split(',') : typeValue || []}
|
|
192
|
+
handleChange={(v) => handleFilterChange('type', typeValue, v)}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
195
|
+
|
|
196
|
+
{colorOptions && colorOptions.length > 0 && (
|
|
197
|
+
<FilterCheckboxGroup
|
|
198
|
+
title="Color"
|
|
199
|
+
items={colorOptions}
|
|
200
|
+
values={typeof colorValue === 'string' ? colorValue.split(',') : colorValue || []}
|
|
201
|
+
handleChange={(v) => handleFilterChange('color', colorValue, v)}
|
|
202
|
+
isColor={true}
|
|
203
|
+
/>
|
|
204
|
+
)}
|
|
205
|
+
|
|
206
|
+
{materialOptions && materialOptions.length > 0 && (
|
|
207
|
+
<FilterCheckboxGroup
|
|
208
|
+
title="Material"
|
|
209
|
+
items={materialOptions}
|
|
210
|
+
values={typeof materialValue === 'string' ? materialValue.split(',') : materialValue || []}
|
|
211
|
+
handleChange={(v) => handleFilterChange('material', materialValue, v)}
|
|
212
|
+
/>
|
|
213
|
+
)}
|
|
214
|
+
|
|
215
|
+
{/* Price Range Filter */}
|
|
216
|
+
<div className="flex flex-col border-b border-gray-100 pb-4 last:border-0 last:pb-0">
|
|
217
|
+
<div className="flex items-center justify-between w-full py-1">
|
|
218
|
+
<h3 className="text-sm font-bold text-gray-900 uppercase tracking-wider">Price</h3>
|
|
219
|
+
</div>
|
|
220
|
+
<div className="mt-6 px-2">
|
|
221
|
+
<div
|
|
222
|
+
className="relative h-1.5 w-full bg-gray-200 rounded-full cursor-pointer"
|
|
223
|
+
onClick={(e) => {
|
|
224
|
+
const rect = e.currentTarget.getBoundingClientRect()
|
|
225
|
+
const x = e.clientX - rect.left
|
|
226
|
+
const percentage = Math.max(0, Math.min(1, x / rect.width))
|
|
227
|
+
const value = Math.round((percentage * 10000) / 100) * 100
|
|
228
|
+
|
|
229
|
+
if (Math.abs(value - minPriceLocal) < Math.abs(value - maxPriceLocal)) {
|
|
230
|
+
setMinPriceLocal(Math.min(value, maxPriceLocal - 500))
|
|
231
|
+
} else {
|
|
232
|
+
setMaxPriceLocal(Math.max(value, minPriceLocal + 500))
|
|
233
|
+
}
|
|
234
|
+
}}
|
|
235
|
+
>
|
|
236
|
+
<div
|
|
237
|
+
className="absolute h-full bg-[#8B5AB1] rounded-full"
|
|
238
|
+
style={{
|
|
239
|
+
left: `${(minPriceLocal / 10000) * 100}%`,
|
|
240
|
+
right: `${100 - (maxPriceLocal / 10000) * 100}%`
|
|
241
|
+
}}
|
|
242
|
+
/>
|
|
243
|
+
<input
|
|
244
|
+
type="range"
|
|
245
|
+
min="0"
|
|
246
|
+
max="10000"
|
|
247
|
+
step="100"
|
|
248
|
+
value={minPriceLocal}
|
|
249
|
+
onChange={(e) => setMinPriceLocal(Math.min(parseInt(e.target.value), maxPriceLocal - 500))}
|
|
250
|
+
className={`absolute pointer-events-none appearance-none w-full h-1.5 bg-transparent [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:bg-[#8B5AB1] [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-[#8B5AB1] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-lg ${minPriceLocal > 5000 ? 'z-10' : 'z-20'}`}
|
|
251
|
+
onClick={(e) => e.stopPropagation()}
|
|
252
|
+
/>
|
|
253
|
+
<input
|
|
254
|
+
type="range"
|
|
255
|
+
min="0"
|
|
256
|
+
max="10000"
|
|
257
|
+
step="100"
|
|
258
|
+
value={maxPriceLocal}
|
|
259
|
+
onChange={(e) => setMaxPriceLocal(Math.max(parseInt(e.target.value), minPriceLocal + 500))}
|
|
260
|
+
className={`absolute pointer-events-none appearance-none w-full h-1.5 bg-transparent [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:bg-[#8B5AB1] [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-[#8B5AB1] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-lg ${minPriceLocal > 5000 ? 'z-20' : 'z-10'}`}
|
|
261
|
+
onClick={(e) => e.stopPropagation()}
|
|
262
|
+
/>
|
|
263
|
+
</div>
|
|
264
|
+
<div className="mt-6 flex items-center justify-between text-sm font-medium text-gray-700">
|
|
265
|
+
<span>₹{minPriceLocal.toLocaleString()}</span>
|
|
266
|
+
<span>₹{maxPriceLocal.toLocaleString()}+</span>
|
|
267
|
+
</div>
|
|
268
|
+
<div className="mt-4 flex gap-2">
|
|
269
|
+
<button
|
|
270
|
+
onClick={handlePriceApply}
|
|
271
|
+
className="flex-1 bg-[#8B5AB1] text-white py-1.5 rounded text-xs font-bold hover:bg-opacity-90 transition-all border-none outline-none"
|
|
272
|
+
data-ga-event="filter_price_apply_click"
|
|
273
|
+
data-ga-label="Apply Price Filter"
|
|
274
|
+
>
|
|
275
|
+
APPLY
|
|
276
|
+
</button>
|
|
277
|
+
<button
|
|
278
|
+
onClick={() => {
|
|
279
|
+
const params = new URLSearchParams(searchParams)
|
|
280
|
+
params.delete("min_price")
|
|
281
|
+
params.delete("max_price")
|
|
282
|
+
startTransition(() => {
|
|
283
|
+
router.replace(`${pathname}?${params.toString()}`, { scroll: false })
|
|
284
|
+
})
|
|
285
|
+
}}
|
|
286
|
+
className="px-3 border border-gray-200 py-1.5 rounded text-xs font-bold text-gray-500 hover:bg-gray-50 transition-all outline-none"
|
|
287
|
+
data-ga-event="filter_price_reset_click"
|
|
288
|
+
data-ga-label="Reset Price Filter"
|
|
289
|
+
>
|
|
290
|
+
RESET
|
|
291
|
+
</button>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
)
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export default RefinementList
|
package/templates/storefront/src/modules/store/components/refinement-list/sort-products/index.tsx
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Listbox, ListboxButton, ListboxOption, ListboxOptions, Transition } from "@headlessui/react"
|
|
4
|
+
import { Fragment, useMemo } from "react"
|
|
5
|
+
import ChevronDown from "@modules/common/icons/chevron-down"
|
|
6
|
+
import { clx } from "@medusajs/ui"
|
|
7
|
+
|
|
8
|
+
export type SortOptions = "price_asc" | "price_desc" | "created_at_desc" | "created_at_asc" | "bestsellers" | "created_at"
|
|
9
|
+
|
|
10
|
+
type SortProductsProps = {
|
|
11
|
+
sortBy: SortOptions
|
|
12
|
+
setQueryParams: (name: string, value: SortOptions) => void
|
|
13
|
+
"data-testid"?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const sortOptions = [
|
|
17
|
+
{
|
|
18
|
+
value: "created_at_desc",
|
|
19
|
+
label: "Latest Arrivals",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: "created_at_asc",
|
|
23
|
+
label: "Oldest First",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: "price_asc",
|
|
27
|
+
label: "Price: Low to High",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "price_desc",
|
|
31
|
+
label: "Price: High to Low",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: "bestsellers",
|
|
35
|
+
label: "Bestsellers",
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
const SortProducts = ({
|
|
40
|
+
"data-testid": dataTestId,
|
|
41
|
+
sortBy,
|
|
42
|
+
setQueryParams,
|
|
43
|
+
}: SortProductsProps) => {
|
|
44
|
+
const handleChange = (value: string) => {
|
|
45
|
+
setQueryParams("sortBy", value as SortOptions)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const selectedOption = useMemo(() => {
|
|
49
|
+
return sortOptions.find((o) => o.value === sortBy) || sortOptions[0]
|
|
50
|
+
}, [sortBy])
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="flex items-center w-full lg:w-auto">
|
|
54
|
+
<Listbox value={sortBy} onChange={handleChange}>
|
|
55
|
+
<div className="relative w-full">
|
|
56
|
+
<ListboxButton
|
|
57
|
+
className={clx(
|
|
58
|
+
"relative cursor-pointer rounded-full bg-white py-1.5 px-8 border transition-all duration-300 shadow-[0_2px_10px_-4px_rgba(0,0,0,0.1)] hover:bg-gray-50 hover:border-[#8B5AB1]/40 focus:outline-none focus:ring-2 focus:ring-[#8B5AB1]/20 focus:border-[#8B5AB1]",
|
|
59
|
+
"border-gray-200 w-full min-[450px]:w-auto flex items-center justify-center"
|
|
60
|
+
)}
|
|
61
|
+
data-testid={dataTestId}
|
|
62
|
+
>
|
|
63
|
+
<span className="flex items-center gap-1 truncate uppercase">
|
|
64
|
+
<span className="font-bold text-gray-400 text-[10px] tracking-wider whitespace-nowrap">Sort:</span>
|
|
65
|
+
<span className="text-sm font-bold text-gray-900 tracking-wider truncate">{selectedOption.label}</span>
|
|
66
|
+
</span>
|
|
67
|
+
<span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-4">
|
|
68
|
+
<ChevronDown
|
|
69
|
+
className="w-4 h-4 text-gray-400 transition-transform duration-300 ui-open:rotate-180 ui-open:text-[#8B5AB1]"
|
|
70
|
+
aria-hidden="true"
|
|
71
|
+
/>
|
|
72
|
+
</span>
|
|
73
|
+
</ListboxButton>
|
|
74
|
+
<Transition
|
|
75
|
+
as={Fragment}
|
|
76
|
+
enter="transition ease-out duration-200"
|
|
77
|
+
enterFrom="opacity-0 translate-y-1 scale-95"
|
|
78
|
+
enterTo="opacity-100 translate-y-0 scale-100"
|
|
79
|
+
leave="transition ease-in duration-150"
|
|
80
|
+
leaveFrom="opacity-100 translate-y-0 scale-100"
|
|
81
|
+
leaveTo="opacity-0 translate-y-1 scale-95"
|
|
82
|
+
>
|
|
83
|
+
<ListboxOptions className="absolute right-0 z-[100] mt-2 max-h-60 w-[200px] overflow-auto rounded-2xl bg-white py-2 text-base shadow-2xl ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm border border-gray-100">
|
|
84
|
+
{sortOptions.map((option, idx) => (
|
|
85
|
+
<ListboxOption
|
|
86
|
+
key={idx}
|
|
87
|
+
className={({ active, selected }) =>
|
|
88
|
+
clx(
|
|
89
|
+
"relative cursor-pointer select-none py-2.5 px-4 transition-colors mx-1.5 rounded-xl mb-0.5 last:mb-0",
|
|
90
|
+
active ? "bg-purple-50 text-[#8B5AB1]" : "text-gray-900",
|
|
91
|
+
selected ? "bg-purple-50/50" : ""
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
value={option.value}
|
|
95
|
+
>
|
|
96
|
+
{({ selected }) => (
|
|
97
|
+
<div className="flex items-center justify-between">
|
|
98
|
+
<span className={clx("block truncate", selected ? "font-bold text-[#8B5AB1]" : "font-medium")}>
|
|
99
|
+
{option.label}
|
|
100
|
+
</span>
|
|
101
|
+
{selected && (
|
|
102
|
+
<span className="text-[#8B5AB1]">
|
|
103
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round">
|
|
104
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
105
|
+
</svg>
|
|
106
|
+
</span>
|
|
107
|
+
)}
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
</ListboxOption>
|
|
111
|
+
))}
|
|
112
|
+
</ListboxOptions>
|
|
113
|
+
</Transition>
|
|
114
|
+
</div>
|
|
115
|
+
</Listbox>
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default SortProducts
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation"
|
|
4
|
+
import { useCallback, useTransition } from "react"
|
|
5
|
+
import { clx } from "@medusajs/ui"
|
|
6
|
+
import SortProducts, { SortOptions } from "../refinement-list/sort-products"
|
|
7
|
+
import MobileFilters from "../mobile-filters"
|
|
8
|
+
|
|
9
|
+
type StoreHeaderProps = {
|
|
10
|
+
sortBy: SortOptions
|
|
11
|
+
productCount?: number
|
|
12
|
+
q?: string
|
|
13
|
+
filterProps?: Record<string, unknown>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function StoreHeader({
|
|
17
|
+
sortBy,
|
|
18
|
+
productCount,
|
|
19
|
+
filterProps,
|
|
20
|
+
}: StoreHeaderProps) {
|
|
21
|
+
const router = useRouter()
|
|
22
|
+
const pathname = usePathname()
|
|
23
|
+
const searchParams = useSearchParams()
|
|
24
|
+
const [isPending, startTransition] = useTransition()
|
|
25
|
+
|
|
26
|
+
const createQueryString = useCallback(
|
|
27
|
+
(name: string, value: string) => {
|
|
28
|
+
const params = new URLSearchParams(searchParams)
|
|
29
|
+
params.set(name, value)
|
|
30
|
+
return params.toString()
|
|
31
|
+
},
|
|
32
|
+
[searchParams]
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
const setQueryParams = (name: string, value: string) => {
|
|
36
|
+
const query = createQueryString(name, value)
|
|
37
|
+
startTransition(() => {
|
|
38
|
+
router.replace(`${pathname}?${query}`, { scroll: false })
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={clx(
|
|
45
|
+
"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-8 pb-6 border-b border-[var(--color-header-border)] transition-opacity duration-200",
|
|
46
|
+
isPending ? "opacity-50 pointer-events-none" : "opacity-100"
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
{productCount !== undefined && (
|
|
50
|
+
<p className="text-sm text-[var(--color-text-muted)]">
|
|
51
|
+
<span className="font-semibold text-heading">{productCount}</span> products
|
|
52
|
+
</p>
|
|
53
|
+
)}
|
|
54
|
+
|
|
55
|
+
<div className="flex items-center gap-3 lg:hidden w-full sm:w-auto">
|
|
56
|
+
{filterProps && <MobileFilters {...filterProps} hideMargin={true} />}
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div className="flex items-center gap-3 ml-auto">
|
|
60
|
+
<span className="hidden lg:inline text-xs uppercase tracking-[var(--letter-spacing-nav)] text-[var(--color-text-muted)]">
|
|
61
|
+
Sort by
|
|
62
|
+
</span>
|
|
63
|
+
<SortProducts sortBy={sortBy} setQueryParams={setQueryParams} />
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@theme/templates/StorePage"
|