@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,38 @@
|
|
|
1
|
+
import { Heading, Text } from "@medusajs/ui"
|
|
2
|
+
import { ShoppingCart } from "@medusajs/icons"
|
|
3
|
+
import Link from "next/link"
|
|
4
|
+
|
|
5
|
+
const EmptyCartMessage = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="py-24 px-4 flex flex-col items-center justify-center text-center w-full max-w-lg mx-auto animate-in fade-in duration-700" data-testid="empty-cart-message">
|
|
8
|
+
{/* Small Cart Icon */}
|
|
9
|
+
<div className="relative mb-8">
|
|
10
|
+
<div className="relative w-20 h-20 bg-[#8B5AB1]/5 rounded-full flex items-center justify-center">
|
|
11
|
+
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className="text-[#8B5AB1]">
|
|
12
|
+
<path d="M3 3H5L5.4 5M5.4 5H21L19 13H7L5.4 5ZM7 13L4.707 15.293C4.077 15.293 4.523 17 5.414 17H19M17 17C15.8954 17 15 17.8954 15 19C15 20.1046 15.8954 21 17 21C18.1046 21 19 20.1046 19 19C19 17.8954 18.1046 17 17 17ZM9 17C7.89543 17 7 17.8954 7 19C7 20.1046 7.89543 21 9 21C10.1046 21 11 20.1046 11 19C11 17.8954 10.1046 17 9 17Z" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
|
13
|
+
</svg>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<Heading
|
|
18
|
+
level="h1"
|
|
19
|
+
className="text-3xl sm:text-4xl font-extrabold text-neutral-900 mb-3 tracking-tight"
|
|
20
|
+
>
|
|
21
|
+
Your bag is empty
|
|
22
|
+
</Heading>
|
|
23
|
+
|
|
24
|
+
<Text className="text-neutral-500 text-base sm:text-lg mb-10 max-w-[320px] leading-relaxed">
|
|
25
|
+
Let's find something amazing to fill your bag today!
|
|
26
|
+
</Text>
|
|
27
|
+
|
|
28
|
+
<Link
|
|
29
|
+
href="/store"
|
|
30
|
+
className="inline-flex items-center justify-center px-10 h-14 bg-[#8B5AB1] hover:bg-[#7a4f9b] text-white font-bold text-lg rounded-2xl shadow-[0_10px_25px_rgba(139,90,177,0.2)] hover:shadow-[0_15px_30px_rgba(139,90,177,0.3)] hover:-translate-y-0.5 transition-all duration-300 active:scale-[0.98]"
|
|
31
|
+
>
|
|
32
|
+
Start Shopping
|
|
33
|
+
</Link>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default EmptyCartMessage
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Table, Text, clx } from "@medusajs/ui"
|
|
4
|
+
import { updateLineItem } from "@core/data/cart"
|
|
5
|
+
import { HttpTypes } from "@medusajs/types"
|
|
6
|
+
import CartItemSelect from "@modules/cart/components/cart-item-select"
|
|
7
|
+
import ErrorMessage from "@modules/checkout/components/error-message"
|
|
8
|
+
import DeleteButton from "@modules/common/components/delete-button"
|
|
9
|
+
import LineItemOptions from "@modules/common/components/line-item-options"
|
|
10
|
+
import LineItemPrice from "@modules/common/components/line-item-price"
|
|
11
|
+
import LineItemUnitPrice from "@modules/common/components/line-item-unit-price"
|
|
12
|
+
import LocalizedClientLink from "@modules/common/components/localized-client-link"
|
|
13
|
+
import Spinner from "@modules/common/icons/spinner"
|
|
14
|
+
import Thumbnail from "@modules/products/components/thumbnail"
|
|
15
|
+
import { useState } from "react"
|
|
16
|
+
|
|
17
|
+
type ItemProps = {
|
|
18
|
+
item: HttpTypes.StoreCartLineItem
|
|
19
|
+
type?: "full" | "preview"
|
|
20
|
+
currencyCode: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const Item = ({ item, type = "full", currencyCode }: ItemProps) => {
|
|
24
|
+
const [updating, setUpdating] = useState(false)
|
|
25
|
+
const [error, setError] = useState<string | null>(null)
|
|
26
|
+
|
|
27
|
+
const changeQuantity = async (quantity: number) => {
|
|
28
|
+
setError(null)
|
|
29
|
+
setUpdating(true)
|
|
30
|
+
|
|
31
|
+
await updateLineItem({
|
|
32
|
+
lineId: item.id,
|
|
33
|
+
quantity,
|
|
34
|
+
})
|
|
35
|
+
.catch((err) => {
|
|
36
|
+
setError(err.message)
|
|
37
|
+
})
|
|
38
|
+
.finally(() => {
|
|
39
|
+
setUpdating(false)
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// TODO: Update this to grab the actual max inventory
|
|
44
|
+
const maxQtyFromInventory = 10
|
|
45
|
+
const maxQuantity = item.variant?.manage_inventory ? 10 : maxQtyFromInventory
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Table.Row className="w-full" data-testid="product-row">
|
|
49
|
+
<Table.Cell className="!pl-0 p-4 w-24">
|
|
50
|
+
<LocalizedClientLink
|
|
51
|
+
href={`/products/${item.product_handle}`}
|
|
52
|
+
className={clx("flex", {
|
|
53
|
+
"w-16": type === "preview",
|
|
54
|
+
"small:w-24 w-12": type === "full",
|
|
55
|
+
})}
|
|
56
|
+
>
|
|
57
|
+
<Thumbnail
|
|
58
|
+
thumbnail={item.thumbnail}
|
|
59
|
+
images={item.variant?.product?.images}
|
|
60
|
+
variantImages={item.variant?.images}
|
|
61
|
+
size="square"
|
|
62
|
+
/>
|
|
63
|
+
</LocalizedClientLink>
|
|
64
|
+
</Table.Cell>
|
|
65
|
+
|
|
66
|
+
<Table.Cell className="text-left">
|
|
67
|
+
<Text
|
|
68
|
+
className="txt-medium-plus text-ui-fg-base"
|
|
69
|
+
data-testid="product-title"
|
|
70
|
+
>
|
|
71
|
+
{item.product_title}
|
|
72
|
+
</Text>
|
|
73
|
+
<LineItemOptions variant={item.variant} data-testid="product-variant" />
|
|
74
|
+
</Table.Cell>
|
|
75
|
+
|
|
76
|
+
{type === "full" && (
|
|
77
|
+
<Table.Cell>
|
|
78
|
+
<div className="flex gap-2 items-center w-28">
|
|
79
|
+
<DeleteButton
|
|
80
|
+
id={item.id}
|
|
81
|
+
productId={item.product_id || ""}
|
|
82
|
+
thumbnail={item.thumbnail}
|
|
83
|
+
data-testid="product-delete-button"
|
|
84
|
+
/>
|
|
85
|
+
<CartItemSelect
|
|
86
|
+
value={item.quantity}
|
|
87
|
+
onChange={(value) => changeQuantity(parseInt(value.target.value))}
|
|
88
|
+
className="w-14 h-10 p-4"
|
|
89
|
+
data-testid="product-select-button"
|
|
90
|
+
>
|
|
91
|
+
{/* TODO: Update this with the v2 way of managing inventory */}
|
|
92
|
+
{Array.from(
|
|
93
|
+
{
|
|
94
|
+
length: Math.min(maxQuantity, 10),
|
|
95
|
+
},
|
|
96
|
+
(_, i) => (
|
|
97
|
+
<option value={i + 1} key={i}>
|
|
98
|
+
{i + 1}
|
|
99
|
+
</option>
|
|
100
|
+
)
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
<option value={1} key={1}>
|
|
104
|
+
1
|
|
105
|
+
</option>
|
|
106
|
+
</CartItemSelect>
|
|
107
|
+
{updating && <Spinner />}
|
|
108
|
+
</div>
|
|
109
|
+
<ErrorMessage error={error} data-testid="product-error-message" />
|
|
110
|
+
</Table.Cell>
|
|
111
|
+
)}
|
|
112
|
+
|
|
113
|
+
{type === "full" && (
|
|
114
|
+
<Table.Cell className="hidden small:table-cell">
|
|
115
|
+
<LineItemUnitPrice
|
|
116
|
+
item={item}
|
|
117
|
+
style="tight"
|
|
118
|
+
currencyCode={currencyCode}
|
|
119
|
+
/>
|
|
120
|
+
</Table.Cell>
|
|
121
|
+
)}
|
|
122
|
+
|
|
123
|
+
<Table.Cell className="!pr-0">
|
|
124
|
+
<span
|
|
125
|
+
className={clx("!pr-0", {
|
|
126
|
+
"flex flex-col items-end h-full justify-center": type === "preview",
|
|
127
|
+
})}
|
|
128
|
+
>
|
|
129
|
+
{type === "preview" && (
|
|
130
|
+
<span className="flex gap-x-1 ">
|
|
131
|
+
<Text className="text-ui-fg-muted">{item.quantity}x </Text>
|
|
132
|
+
<LineItemUnitPrice
|
|
133
|
+
item={item}
|
|
134
|
+
style="tight"
|
|
135
|
+
currencyCode={currencyCode}
|
|
136
|
+
/>
|
|
137
|
+
</span>
|
|
138
|
+
)}
|
|
139
|
+
<LineItemPrice
|
|
140
|
+
item={item}
|
|
141
|
+
style="tight"
|
|
142
|
+
currencyCode={currencyCode}
|
|
143
|
+
/>
|
|
144
|
+
</span>
|
|
145
|
+
</Table.Cell>
|
|
146
|
+
</Table.Row>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export default Item
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Button, Heading, Text, Input, clx } from "@medusajs/ui"
|
|
4
|
+
import { useState } from "react"
|
|
5
|
+
import { getShiprocketServiceability } from "@core/data/fulfillment"
|
|
6
|
+
import { MapPin, Truck, CheckCircle2, AlertCircle, X } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
const PincodeChecker = ({ variantId }: { variantId?: string }) => {
|
|
9
|
+
const [pincode, setPincode] = useState("")
|
|
10
|
+
const [isChecking, setIsChecking] = useState(false)
|
|
11
|
+
const [result, setResult] = useState<any>(null)
|
|
12
|
+
const [error, setError] = useState<string | null>(null)
|
|
13
|
+
const [showInput, setShowInput] = useState(false)
|
|
14
|
+
|
|
15
|
+
const handleCheck = async () => {
|
|
16
|
+
if (!variantId) {
|
|
17
|
+
setError("Please select a variant (size/color) first")
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (pincode.length !== 6) {
|
|
22
|
+
setError("Please enter a valid 6-digit pincode")
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
setIsChecking(true)
|
|
27
|
+
setError(null)
|
|
28
|
+
setResult(null)
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const data = await getShiprocketServiceability(pincode, variantId)
|
|
32
|
+
// Handle both wrapped list response and direct response format
|
|
33
|
+
if (data && (data.etd || data.data?.etd || (data.data?.available_courier_companies?.length > 0))) {
|
|
34
|
+
setResult(data)
|
|
35
|
+
} else {
|
|
36
|
+
setError("Delivery not available for this pincode")
|
|
37
|
+
}
|
|
38
|
+
} catch (err: any) {
|
|
39
|
+
setError(err.message || "Failed to check serviceability. Please try again.")
|
|
40
|
+
} finally {
|
|
41
|
+
setIsChecking(false)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const getDeliveryInfo = () => {
|
|
46
|
+
if (!result) return null
|
|
47
|
+
|
|
48
|
+
// If result is the courier object directly (new format)
|
|
49
|
+
if (result.etd) return { etd: result.etd, days: result.estimated_delivery_days }
|
|
50
|
+
|
|
51
|
+
// If it's wrapped in data (old format or variations)
|
|
52
|
+
if (result.data) {
|
|
53
|
+
if (result.data.etd) return { etd: result.data.etd, days: result.data.estimated_delivery_days }
|
|
54
|
+
|
|
55
|
+
if (result.data.available_courier_companies?.length > 0) {
|
|
56
|
+
const best = result.data.available_courier_companies[0]
|
|
57
|
+
return { etd: best.etd, days: best.estimated_delivery_days }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return null
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const deliveryInfo = getDeliveryInfo()
|
|
65
|
+
|
|
66
|
+
const handleReset = () => {
|
|
67
|
+
setPincode("")
|
|
68
|
+
setResult(null)
|
|
69
|
+
setError(null)
|
|
70
|
+
setShowInput(false)
|
|
71
|
+
setIsChecking(false)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div className="w-full bg-white border border-gray-200 rounded-xl p-4 min-[550px]:p-5 mb-0 shadow-sm overflow-hidden min-h-[80px] flex flex-col justify-center">
|
|
76
|
+
{/* Initial State */}
|
|
77
|
+
{!showInput && (
|
|
78
|
+
<div className="flex items-center justify-between gap-4">
|
|
79
|
+
<div className="flex items-center gap-3">
|
|
80
|
+
<div className="w-10 h-10 rounded-full bg-purple-50 flex items-center justify-center flex-shrink-0">
|
|
81
|
+
<Truck className="w-5 h-5 text-[#8B5AB1]" />
|
|
82
|
+
</div>
|
|
83
|
+
<Text className="text-sm min-[550px]:text-base font-medium text-gray-700">
|
|
84
|
+
Check delivery time & services
|
|
85
|
+
</Text>
|
|
86
|
+
</div>
|
|
87
|
+
<button
|
|
88
|
+
onClick={() => setShowInput(true)}
|
|
89
|
+
className="bg-[#8B5AB1] text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-[#764999] transition-colors shadow-sm whitespace-nowrap"
|
|
90
|
+
>
|
|
91
|
+
Enter Pincode
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
95
|
+
|
|
96
|
+
{/* Input & Error State */}
|
|
97
|
+
{showInput && !result && (
|
|
98
|
+
<div className="flex flex-col gap-3">
|
|
99
|
+
<div className="flex items-center justify-between">
|
|
100
|
+
<Text className="text-sm font-bold text-gray-900">Enter Delivery Pincode</Text>
|
|
101
|
+
<button onClick={handleReset} className="text-gray-400 hover:text-gray-600">
|
|
102
|
+
<X className="w-4 h-4" />
|
|
103
|
+
</button>
|
|
104
|
+
</div>
|
|
105
|
+
<div className="flex gap-2">
|
|
106
|
+
<Input
|
|
107
|
+
type="text"
|
|
108
|
+
maxLength={6}
|
|
109
|
+
placeholder="Ex: 380001"
|
|
110
|
+
value={pincode}
|
|
111
|
+
onChange={(e) => setPincode(e.target.value.replace(/\D/g, ""))}
|
|
112
|
+
className="flex-1"
|
|
113
|
+
/>
|
|
114
|
+
<Button
|
|
115
|
+
variant="primary"
|
|
116
|
+
onClick={handleCheck}
|
|
117
|
+
isLoading={isChecking}
|
|
118
|
+
className="bg-[#8B5AB1] hover:bg-[#764999]"
|
|
119
|
+
>
|
|
120
|
+
Check
|
|
121
|
+
</Button>
|
|
122
|
+
</div>
|
|
123
|
+
{error && !isChecking && (
|
|
124
|
+
<div className="flex items-center gap-3 bg-red-50 p-3 rounded-lg border border-red-100 mt-1">
|
|
125
|
+
<AlertCircle className="w-5 h-5 text-red-600 flex-shrink-0" />
|
|
126
|
+
<Text className="text-sm font-bold text-red-800">
|
|
127
|
+
{error}
|
|
128
|
+
</Text>
|
|
129
|
+
</div>
|
|
130
|
+
)}
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
|
|
134
|
+
{/* Success Result State */}
|
|
135
|
+
{showInput && result && !isChecking && (
|
|
136
|
+
<div className="flex flex-col gap-3">
|
|
137
|
+
<div className="flex items-center justify-between border-b border-gray-100 pb-2">
|
|
138
|
+
<div className="flex items-center gap-2">
|
|
139
|
+
<MapPin className="w-4 h-4 text-[#8B5AB1]" />
|
|
140
|
+
<Text className="text-sm font-bold text-gray-900">Results for {pincode}</Text>
|
|
141
|
+
</div>
|
|
142
|
+
<button
|
|
143
|
+
onClick={() => {
|
|
144
|
+
setResult(null)
|
|
145
|
+
setError(null)
|
|
146
|
+
setPincode("")
|
|
147
|
+
setShowInput(true)
|
|
148
|
+
}}
|
|
149
|
+
className="text-[#8B5AB1] text-xs font-bold hover:underline"
|
|
150
|
+
>
|
|
151
|
+
Change
|
|
152
|
+
</button>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div className="flex items-center gap-3 bg-green-50 p-3 rounded-lg border border-green-100">
|
|
156
|
+
<CheckCircle2 className="w-5 h-5 text-green-600 flex-shrink-0" />
|
|
157
|
+
<div>
|
|
158
|
+
<Text className="text-sm font-bold text-green-800">
|
|
159
|
+
Delivery available
|
|
160
|
+
</Text>
|
|
161
|
+
{deliveryInfo?.etd && (
|
|
162
|
+
<Text className="text-xs text-green-700">
|
|
163
|
+
Estimated delivery by <span className="font-bold">{new Date(deliveryInfo.etd).toDateString()}</span>
|
|
164
|
+
</Text>
|
|
165
|
+
)}
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
)}
|
|
170
|
+
</div>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export default PincodeChecker
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Button, Heading, Text } from "@medusajs/ui"
|
|
2
|
+
import LocalizedClientLink from "@modules/common/components/localized-client-link"
|
|
3
|
+
|
|
4
|
+
const SignInPrompt = () => {
|
|
5
|
+
return (
|
|
6
|
+
<div className="bg-white flex items-center justify-between">
|
|
7
|
+
<div>
|
|
8
|
+
<Heading level="h2" className="txt-xlarge">
|
|
9
|
+
Already have an account?
|
|
10
|
+
</Heading>
|
|
11
|
+
<Text className="txt-medium text-ui-fg-subtle mt-2">
|
|
12
|
+
Sign in for a better experience.
|
|
13
|
+
</Text>
|
|
14
|
+
</div>
|
|
15
|
+
<div>
|
|
16
|
+
<LocalizedClientLink href="/account">
|
|
17
|
+
<Button variant="secondary" className="h-10" data-testid="sign-in-button">
|
|
18
|
+
Sign in
|
|
19
|
+
</Button>
|
|
20
|
+
</LocalizedClientLink>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default SignInPrompt
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState, useEffect } from "react"
|
|
4
|
+
import { listProducts } from "@core/data/products"
|
|
5
|
+
import { getRegion } from "@core/data/regions"
|
|
6
|
+
import { HttpTypes } from "@medusajs/types"
|
|
7
|
+
import ProductCard from "@registry/components/product-card"
|
|
8
|
+
|
|
9
|
+
type YouMayAlsoLikeProps = {
|
|
10
|
+
cart: HttpTypes.StoreCart | null
|
|
11
|
+
countryCode: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function YouMayAlsoLike({
|
|
15
|
+
cart,
|
|
16
|
+
countryCode,
|
|
17
|
+
}: YouMayAlsoLikeProps) {
|
|
18
|
+
const [region, setRegion] = useState<HttpTypes.StoreRegion | null>(null)
|
|
19
|
+
const [allProducts, setAllProducts] = useState<HttpTypes.StoreProduct[]>([])
|
|
20
|
+
const [currentIndex, setCurrentIndex] = useState(0)
|
|
21
|
+
|
|
22
|
+
const cartProductIds = cart?.items?.map((item) => item.product_id) || []
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
async function fetchData() {
|
|
26
|
+
const fetchedRegion = await getRegion(countryCode)
|
|
27
|
+
if (!fetchedRegion) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
setRegion(fetchedRegion)
|
|
31
|
+
|
|
32
|
+
const queryParams: HttpTypes.StoreProductListParams = {
|
|
33
|
+
limit: 20,
|
|
34
|
+
is_giftcard: false,
|
|
35
|
+
region_id: fetchedRegion.id,
|
|
36
|
+
fields:
|
|
37
|
+
"*variants.calculated_price,*images,+variants.inventory_quantity,+metadata,+tags",
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const fetchedProducts = await listProducts({
|
|
41
|
+
queryParams,
|
|
42
|
+
countryCode,
|
|
43
|
+
}).then(({ response }) =>
|
|
44
|
+
response.products.filter(
|
|
45
|
+
(product) => !cartProductIds.includes(product.id)
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
setAllProducts(fetchedProducts)
|
|
50
|
+
}
|
|
51
|
+
fetchData()
|
|
52
|
+
}, [cart, countryCode, cartProductIds.join(",")])
|
|
53
|
+
|
|
54
|
+
const currentProducts = allProducts.slice(currentIndex, currentIndex + 4)
|
|
55
|
+
const maxIndex = Math.max(0, allProducts.length - 4)
|
|
56
|
+
|
|
57
|
+
const handlePrevious = () => {
|
|
58
|
+
setCurrentIndex((prev) => Math.max(0, prev - 4))
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const handleNext = () => {
|
|
62
|
+
setCurrentIndex((prev) => Math.min(maxIndex, prev + 4))
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!region || !allProducts.length) {
|
|
66
|
+
return null
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const canGoPrevious = currentIndex > 0
|
|
70
|
+
const canGoNext = currentIndex < maxIndex
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<section
|
|
74
|
+
className="mt-12 pt-10 border-t border-[var(--color-header-border)]"
|
|
75
|
+
aria-labelledby="cart-you-may-also-like"
|
|
76
|
+
>
|
|
77
|
+
<div className="flex items-center justify-between mb-8">
|
|
78
|
+
<h2
|
|
79
|
+
id="cart-you-may-also-like"
|
|
80
|
+
className="font-display text-2xl md:text-3xl text-heading"
|
|
81
|
+
>
|
|
82
|
+
You may also like
|
|
83
|
+
</h2>
|
|
84
|
+
{allProducts.length > 4 && (
|
|
85
|
+
<div className="flex items-center gap-2">
|
|
86
|
+
<button
|
|
87
|
+
onClick={handlePrevious}
|
|
88
|
+
disabled={!canGoPrevious}
|
|
89
|
+
className="w-10 h-10 border border-[var(--color-header-border)] flex items-center justify-center transition-colors hover:bg-surface-muted disabled:opacity-40 disabled:cursor-not-allowed"
|
|
90
|
+
aria-label="Previous products"
|
|
91
|
+
>
|
|
92
|
+
<svg
|
|
93
|
+
width="16"
|
|
94
|
+
height="16"
|
|
95
|
+
viewBox="0 0 24 24"
|
|
96
|
+
fill="none"
|
|
97
|
+
stroke="currentColor"
|
|
98
|
+
strokeWidth="2"
|
|
99
|
+
strokeLinecap="round"
|
|
100
|
+
strokeLinejoin="round"
|
|
101
|
+
>
|
|
102
|
+
<polyline points="15 18 9 12 15 6" />
|
|
103
|
+
</svg>
|
|
104
|
+
</button>
|
|
105
|
+
<button
|
|
106
|
+
onClick={handleNext}
|
|
107
|
+
disabled={!canGoNext}
|
|
108
|
+
className="w-10 h-10 bg-brand-accent text-inverse flex items-center justify-center transition-colors hover:bg-brand-accent-hover disabled:opacity-40 disabled:cursor-not-allowed"
|
|
109
|
+
aria-label="Next products"
|
|
110
|
+
>
|
|
111
|
+
<svg
|
|
112
|
+
width="16"
|
|
113
|
+
height="16"
|
|
114
|
+
viewBox="0 0 24 24"
|
|
115
|
+
fill="none"
|
|
116
|
+
stroke="currentColor"
|
|
117
|
+
strokeWidth="2"
|
|
118
|
+
strokeLinecap="round"
|
|
119
|
+
strokeLinejoin="round"
|
|
120
|
+
>
|
|
121
|
+
<polyline points="9 18 15 12 9 6" />
|
|
122
|
+
</svg>
|
|
123
|
+
</button>
|
|
124
|
+
</div>
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<ul className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 md:gap-6 lg:gap-8">
|
|
129
|
+
{currentProducts.map((product) => (
|
|
130
|
+
<li key={product.id} className="w-full min-w-0">
|
|
131
|
+
<ProductCard region={region} product={product} />
|
|
132
|
+
</li>
|
|
133
|
+
))}
|
|
134
|
+
</ul>
|
|
135
|
+
</section>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import ItemsTemplate from "./items"
|
|
2
|
+
import Summary from "./summary"
|
|
3
|
+
import EmptyCartMessage from "../components/empty-cart-message"
|
|
4
|
+
import SignInPrompt from "../components/sign-in-prompt"
|
|
5
|
+
import Divider from "@modules/common/components/divider"
|
|
6
|
+
import YouMayAlsoLike from "../components/you-may-also-like"
|
|
7
|
+
import CartViewTracker from "../components/cart-view-tracker"
|
|
8
|
+
import AbandonedCarts from "../components/abandoned-carts"
|
|
9
|
+
import ScrollToPendingOrdersButton from "../components/abandoned-carts/ScrollToPendingOrdersButton"
|
|
10
|
+
import { HttpTypes } from "@medusajs/types"
|
|
11
|
+
|
|
12
|
+
const CartTemplate = ({
|
|
13
|
+
cart,
|
|
14
|
+
customer,
|
|
15
|
+
countryCode,
|
|
16
|
+
abandonedCarts,
|
|
17
|
+
}: {
|
|
18
|
+
cart: HttpTypes.StoreCart | null
|
|
19
|
+
customer: HttpTypes.StoreCustomer | null
|
|
20
|
+
countryCode: string
|
|
21
|
+
abandonedCarts?: {
|
|
22
|
+
buyNowCarts: HttpTypes.StoreCart[]
|
|
23
|
+
reorderCarts: HttpTypes.StoreCart[]
|
|
24
|
+
}
|
|
25
|
+
}) => {
|
|
26
|
+
return (
|
|
27
|
+
<div className="bg-page-bg min-h-screen">
|
|
28
|
+
<div className="w-full max-w-[1360px] mx-auto px-3 min-[550px]:px-4 sm:px-6 md:px-8 min-[1023px]:px-4 min-[1150px]:px-6 min-[1360px]:px-8 pt-3 pb-4 min-[550px]:pt-4 min-[550px]:pb-6 sm:pt-5 sm:pb-8 md:pt-6 md:pb-12 min-[1023px]:pt-6 min-[1023px]:pb-10 min-[1150px]:pt-6 min-[1150px]:pb-12 min-[1360px]:pt-8 min-[1360px]:pb-12" data-testid="cart-container">
|
|
29
|
+
|
|
30
|
+
{cart?.items?.length ? (
|
|
31
|
+
<>
|
|
32
|
+
<CartViewTracker cart={cart} />
|
|
33
|
+
|
|
34
|
+
<div className="grid grid-cols-1 min-[1024px]:grid-cols-[1fr_380px] min-[1150px]:grid-cols-[1fr_420px] gap-4 min-[550px]:gap-5 sm:gap-6 md:gap-8 min-[768px]:gap-6 min-[1023px]:gap-4 min-[1150px]:gap-6 min-[1200px]:gap-10 min-[1360px]:gap-12 w-full">
|
|
35
|
+
<div className="flex flex-col gap-y-3 min-[550px]:gap-y-4 sm:gap-y-6 order-1 min-[768px]:order-1 min-[1024px]:order-1 w-full min-w-0">
|
|
36
|
+
<div className="w-full min-[1024px]:pr-2">
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
{!customer && (
|
|
40
|
+
<div className="mb-4">
|
|
41
|
+
<SignInPrompt />
|
|
42
|
+
<Divider />
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
|
|
46
|
+
<ItemsTemplate cart={cart} />
|
|
47
|
+
|
|
48
|
+
<div className="mt-4 min-[1024px]:mt-6">
|
|
49
|
+
<AbandonedCarts abandonedCarts={abandonedCarts} countryCode={countryCode} />
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div className="relative order-2 min-[768px]:order-2 min-[1024px]:order-2 w-full min-[1024px]:w-auto h-full">
|
|
54
|
+
<div className="flex flex-col gap-y-4 min-[550px]:gap-y-5 sm:gap-y-6 min-[768px]:gap-y-6 min-[1024px]:sticky min-[1024px]:top-20 w-full">
|
|
55
|
+
{cart && cart.region && (
|
|
56
|
+
<Summary cart={cart as any} customer={customer} />
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<YouMayAlsoLike cart={cart} countryCode={countryCode} />
|
|
63
|
+
</>
|
|
64
|
+
) : (
|
|
65
|
+
<div className="flex flex-col items-center justify-center w-full min-h-[50vh] pt-8 pb-16">
|
|
66
|
+
{abandonedCarts && (abandonedCarts.buyNowCarts.length > 0 || abandonedCarts.reorderCarts.length > 0) ? (
|
|
67
|
+
<div className="w-full max-w-4xl px-4 animate-in fade-in duration-500">
|
|
68
|
+
<div className="text-center mb-10">
|
|
69
|
+
<h1 className="text-3xl sm:text-4xl font-extrabold text-neutral-900 mb-3 tracking-tight">
|
|
70
|
+
You have pending orders
|
|
71
|
+
</h1>
|
|
72
|
+
<p className="text-neutral-500 text-base sm:text-lg max-w-md mx-auto">
|
|
73
|
+
Your main cart is empty, but you left some items behind. Complete your purchase below!
|
|
74
|
+
</p>
|
|
75
|
+
</div>
|
|
76
|
+
<AbandonedCarts abandonedCarts={abandonedCarts} countryCode={countryCode} />
|
|
77
|
+
</div>
|
|
78
|
+
) : (
|
|
79
|
+
<EmptyCartMessage />
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
)}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default CartTemplate
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import repeat from "@core/util/repeat"
|
|
2
|
+
import { HttpTypes } from "@medusajs/types"
|
|
3
|
+
import { Heading } from "@medusajs/ui"
|
|
4
|
+
|
|
5
|
+
import CartItemCard from "@modules/cart/components/cart-item-card"
|
|
6
|
+
import AppliedPromotions from "@modules/cart/components/applied-promotions"
|
|
7
|
+
import SkeletonLineItem from "@modules/skeletons/components/skeleton-line-item"
|
|
8
|
+
|
|
9
|
+
type ItemsTemplateProps = {
|
|
10
|
+
cart?: HttpTypes.StoreCart
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ItemsTemplate = ({ cart }: ItemsTemplateProps) => {
|
|
14
|
+
const items = cart?.items
|
|
15
|
+
return (
|
|
16
|
+
<div className="flex flex-col gap-y-4 min-[550px]:gap-y-6">
|
|
17
|
+
<div className="bg-white border border-gray-200 rounded-lg p-3 min-[550px]:p-4 sm:p-5 md:p-6 min-[1023px]:p-4 min-[1150px]:p-5 min-[1360px]:p-6 w-full overflow-hidden">
|
|
18
|
+
<div className="pb-2.5 min-[550px]:pb-3 sm:pb-4 min-[1023px]:pb-3 min-[1150px]:pb-4 min-[1360px]:pb-4 flex items-center justify-between border-b border-gray-200 mb-2.5 min-[550px]:mb-3 sm:mb-4 min-[1023px]:mb-3 min-[1150px]:mb-4 min-[1360px]:mb-4">
|
|
19
|
+
<Heading className="text-lg min-[550px]:text-xl sm:text-2xl min-[1023px]:text-xl min-[1150px]:text-2xl min-[1360px]:text-2xl font-bold text-heading">Your Bag</Heading>
|
|
20
|
+
{items && items.length > 0 && (
|
|
21
|
+
<span className="text-xs min-[550px]:text-xs sm:text-sm min-[1023px]:text-xs min-[1150px]:text-sm min-[1360px]:text-sm text-gray-600">{items.length} {items.length === 1 ? 'item' : 'items'}</span>
|
|
22
|
+
)}
|
|
23
|
+
</div>
|
|
24
|
+
<div className="w-full">
|
|
25
|
+
{items
|
|
26
|
+
? items
|
|
27
|
+
.sort((a, b) => {
|
|
28
|
+
return (a.created_at ?? "") > (b.created_at ?? "") ? -1 : 1
|
|
29
|
+
})
|
|
30
|
+
.map((item) => {
|
|
31
|
+
return (
|
|
32
|
+
<CartItemCard
|
|
33
|
+
key={item.id}
|
|
34
|
+
item={item}
|
|
35
|
+
currencyCode={cart?.currency_code || "INR"}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
})
|
|
39
|
+
: repeat(5).map((i) => {
|
|
40
|
+
return <SkeletonLineItem key={i} />
|
|
41
|
+
})}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<AppliedPromotions cart={cart as any} />
|
|
45
|
+
</div>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default ItemsTemplate
|