@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
package/templates/storefront/src/modules/products/components/product-actions/mobile-actions.tsx
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Dialog, Transition } from "@headlessui/react"
|
|
2
|
+
import { Button, clx } from "@medusajs/ui"
|
|
3
|
+
import React, { Fragment, useMemo } from "react"
|
|
4
|
+
|
|
5
|
+
import useToggleState from "@core/hooks/use-toggle-state"
|
|
6
|
+
import ChevronDown from "@modules/common/icons/chevron-down"
|
|
7
|
+
import X from "@modules/common/icons/x"
|
|
8
|
+
|
|
9
|
+
import { getProductPrice } from "@core/util/get-product-price"
|
|
10
|
+
import OptionSelect from "./option-select"
|
|
11
|
+
import { HttpTypes } from "@medusajs/types"
|
|
12
|
+
import { isSimpleProduct } from "@core/util/product"
|
|
13
|
+
|
|
14
|
+
type MobileActionsProps = {
|
|
15
|
+
product: HttpTypes.StoreProduct
|
|
16
|
+
variant?: HttpTypes.StoreProductVariant
|
|
17
|
+
options: Record<string, string | undefined>
|
|
18
|
+
updateOptions: (title: string, value: string) => void
|
|
19
|
+
inStock?: boolean
|
|
20
|
+
handleAddToCart: () => void
|
|
21
|
+
isAdding?: boolean
|
|
22
|
+
show: boolean
|
|
23
|
+
optionsDisabled: boolean
|
|
24
|
+
quantityInCart?: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const MobileActions: React.FC<MobileActionsProps> = ({
|
|
28
|
+
product,
|
|
29
|
+
variant,
|
|
30
|
+
options,
|
|
31
|
+
updateOptions,
|
|
32
|
+
inStock,
|
|
33
|
+
handleAddToCart,
|
|
34
|
+
isAdding,
|
|
35
|
+
show,
|
|
36
|
+
optionsDisabled,
|
|
37
|
+
quantityInCart = 0,
|
|
38
|
+
}) => {
|
|
39
|
+
const { state, open, close } = useToggleState()
|
|
40
|
+
|
|
41
|
+
const price = getProductPrice({
|
|
42
|
+
product: product,
|
|
43
|
+
variantId: variant?.id,
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const selectedPrice = useMemo(() => {
|
|
47
|
+
if (!price) {
|
|
48
|
+
return null
|
|
49
|
+
}
|
|
50
|
+
const { variantPrice, cheapestPrice } = price
|
|
51
|
+
|
|
52
|
+
return variantPrice || cheapestPrice || null
|
|
53
|
+
}, [price])
|
|
54
|
+
|
|
55
|
+
const isSimple = isSimpleProduct(product)
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
<div
|
|
60
|
+
className={clx("lg:hidden inset-x-0 bottom-0 fixed z-50", {
|
|
61
|
+
"pointer-events-none": !show,
|
|
62
|
+
})}
|
|
63
|
+
>
|
|
64
|
+
<Transition
|
|
65
|
+
as={Fragment}
|
|
66
|
+
show={show}
|
|
67
|
+
enter="ease-in-out duration-300"
|
|
68
|
+
enterFrom="opacity-0"
|
|
69
|
+
enterTo="opacity-100"
|
|
70
|
+
leave="ease-in duration-300"
|
|
71
|
+
leaveFrom="opacity-100"
|
|
72
|
+
leaveTo="opacity-0"
|
|
73
|
+
>
|
|
74
|
+
<div
|
|
75
|
+
className="bg-white flex flex-col gap-y-3 justify-center items-center text-large-regular p-4 h-full w-full border-t border-gray-200"
|
|
76
|
+
data-testid="mobile-actions"
|
|
77
|
+
>
|
|
78
|
+
<div className="flex items-center gap-x-2">
|
|
79
|
+
<span data-testid="mobile-title">{product.title}</span>
|
|
80
|
+
<span>—</span>
|
|
81
|
+
{selectedPrice ? (
|
|
82
|
+
<div className="flex items-end gap-x-2 text-ui-fg-base">
|
|
83
|
+
{selectedPrice.price_type === "sale" && (
|
|
84
|
+
<p>
|
|
85
|
+
<span className="line-through text-small-regular">
|
|
86
|
+
{selectedPrice.original_price}
|
|
87
|
+
</span>
|
|
88
|
+
</p>
|
|
89
|
+
)}
|
|
90
|
+
<span
|
|
91
|
+
className={clx({
|
|
92
|
+
"text-ui-fg-interactive":
|
|
93
|
+
selectedPrice.price_type === "sale",
|
|
94
|
+
})}
|
|
95
|
+
>
|
|
96
|
+
{selectedPrice.calculated_price}
|
|
97
|
+
</span>
|
|
98
|
+
</div>
|
|
99
|
+
) : (
|
|
100
|
+
<div></div>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
<div className={clx("grid grid-cols-2 w-full gap-x-4", {
|
|
104
|
+
"!grid-cols-1": isSimple
|
|
105
|
+
})}>
|
|
106
|
+
{!isSimple && <Button
|
|
107
|
+
onClick={open}
|
|
108
|
+
variant="secondary"
|
|
109
|
+
className="w-full"
|
|
110
|
+
data-testid="mobile-actions-button"
|
|
111
|
+
data-ga-event="select_options_mobile_click"
|
|
112
|
+
data-ga-label={product.title || "Product"}
|
|
113
|
+
>
|
|
114
|
+
<div className="flex items-center justify-between w-full">
|
|
115
|
+
<span>
|
|
116
|
+
{variant
|
|
117
|
+
? Object.values(options).join(" / ")
|
|
118
|
+
: "Select Options"}
|
|
119
|
+
</span>
|
|
120
|
+
<ChevronDown />
|
|
121
|
+
</div>
|
|
122
|
+
</Button>}
|
|
123
|
+
<Button
|
|
124
|
+
onClick={handleAddToCart}
|
|
125
|
+
disabled={!inStock || !variant}
|
|
126
|
+
className="w-full"
|
|
127
|
+
isLoading={isAdding}
|
|
128
|
+
data-testid="mobile-cart-button"
|
|
129
|
+
data-ga-event="add_to_bag_click"
|
|
130
|
+
data-ga-label={product.title || "Product"}
|
|
131
|
+
>
|
|
132
|
+
{!variant
|
|
133
|
+
? "Select variant"
|
|
134
|
+
: !inStock
|
|
135
|
+
? "Out of stock"
|
|
136
|
+
: "Add to bag"}
|
|
137
|
+
</Button>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</Transition>
|
|
141
|
+
</div>
|
|
142
|
+
<Transition appear show={state} as={Fragment}>
|
|
143
|
+
<Dialog as="div" className="relative z-[75]" onClose={close}>
|
|
144
|
+
<Transition.Child
|
|
145
|
+
as={Fragment}
|
|
146
|
+
enter="ease-out duration-300"
|
|
147
|
+
enterFrom="opacity-0"
|
|
148
|
+
enterTo="opacity-100"
|
|
149
|
+
leave="ease-in duration-200"
|
|
150
|
+
leaveFrom="opacity-100"
|
|
151
|
+
leaveTo="opacity-0"
|
|
152
|
+
>
|
|
153
|
+
<div className="fixed inset-0 bg-gray-700 bg-opacity-75 backdrop-blur-sm" />
|
|
154
|
+
</Transition.Child>
|
|
155
|
+
|
|
156
|
+
<div className="fixed bottom-0 inset-x-0">
|
|
157
|
+
<div className="flex min-h-full h-full items-center justify-center text-center">
|
|
158
|
+
<Transition.Child
|
|
159
|
+
as={Fragment}
|
|
160
|
+
enter="ease-out duration-300"
|
|
161
|
+
enterFrom="opacity-0"
|
|
162
|
+
enterTo="opacity-100"
|
|
163
|
+
leave="ease-in duration-200"
|
|
164
|
+
leaveFrom="opacity-100"
|
|
165
|
+
leaveTo="opacity-0"
|
|
166
|
+
>
|
|
167
|
+
<Dialog.Panel
|
|
168
|
+
className="w-full h-full transform overflow-hidden text-left flex flex-col gap-y-3"
|
|
169
|
+
data-testid="mobile-actions-modal"
|
|
170
|
+
>
|
|
171
|
+
<div className="w-full flex justify-end pr-6">
|
|
172
|
+
<button
|
|
173
|
+
onClick={close}
|
|
174
|
+
className="bg-white w-12 h-12 rounded-full text-ui-fg-base flex justify-center items-center"
|
|
175
|
+
data-testid="close-modal-button"
|
|
176
|
+
>
|
|
177
|
+
<X />
|
|
178
|
+
</button>
|
|
179
|
+
</div>
|
|
180
|
+
<div className="bg-white px-6 py-12">
|
|
181
|
+
{(product.variants?.length ?? 0) > 1 && (
|
|
182
|
+
<div className="flex flex-col gap-y-6">
|
|
183
|
+
{(product.options || []).slice().sort((a, b) => {
|
|
184
|
+
const getOrder = (title: string) => {
|
|
185
|
+
const t = title.toLowerCase()
|
|
186
|
+
if (t.includes('color') || t.includes('colour')) return 1
|
|
187
|
+
if (t.includes('size')) return 2
|
|
188
|
+
return 3
|
|
189
|
+
}
|
|
190
|
+
return getOrder(a.title || "") - getOrder(b.title || "")
|
|
191
|
+
}).map((option) => {
|
|
192
|
+
return (
|
|
193
|
+
<div key={option.id}>
|
|
194
|
+
<OptionSelect
|
|
195
|
+
option={option}
|
|
196
|
+
current={options[option.id]}
|
|
197
|
+
updateOption={updateOptions}
|
|
198
|
+
title={option.title ?? ""}
|
|
199
|
+
disabled={optionsDisabled}
|
|
200
|
+
/>
|
|
201
|
+
</div>
|
|
202
|
+
)
|
|
203
|
+
})}
|
|
204
|
+
</div>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
</Dialog.Panel>
|
|
208
|
+
</Transition.Child>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</Dialog>
|
|
212
|
+
</Transition>
|
|
213
|
+
</>
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export default MobileActions
|
package/templates/storefront/src/modules/products/components/product-actions/option-select.tsx
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HttpTypes } from "@medusajs/types"
|
|
2
|
+
import { clx } from "@medusajs/ui"
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
type OptionSelectProps = {
|
|
6
|
+
option: HttpTypes.StoreProductOption
|
|
7
|
+
current: string | undefined
|
|
8
|
+
updateOption: (title: string, value: string) => void
|
|
9
|
+
title: string
|
|
10
|
+
disabled: boolean
|
|
11
|
+
error?: boolean
|
|
12
|
+
"data-testid"?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const OptionSelect: React.FC<OptionSelectProps> = ({
|
|
16
|
+
option,
|
|
17
|
+
current,
|
|
18
|
+
updateOption,
|
|
19
|
+
title,
|
|
20
|
+
"data-testid": dataTestId,
|
|
21
|
+
disabled,
|
|
22
|
+
error,
|
|
23
|
+
}) => {
|
|
24
|
+
const filteredOptions = (option.values ?? []).map((v) => v.value)
|
|
25
|
+
|
|
26
|
+
const isSize = title.toLowerCase().includes('size')
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className="flex flex-col gap-y-3">
|
|
30
|
+
<div
|
|
31
|
+
className={clx("flex flex-wrap gap-2 transition-all duration-300", {
|
|
32
|
+
"grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6": isSize,
|
|
33
|
+
})}
|
|
34
|
+
data-testid={dataTestId}
|
|
35
|
+
>
|
|
36
|
+
{filteredOptions.map((v) => {
|
|
37
|
+
return (
|
|
38
|
+
<button
|
|
39
|
+
onClick={() => updateOption(option.id, v)}
|
|
40
|
+
key={v}
|
|
41
|
+
className={clx(
|
|
42
|
+
"border text-sm font-medium h-10 transition-all",
|
|
43
|
+
{
|
|
44
|
+
"border-purple-600 bg-purple-100 text-purple-900 font-bold rounded-[30px] shadow-sm": v === current && isSize,
|
|
45
|
+
"border-gray-400 bg-white text-gray-900 font-bold hover:border-purple-600 rounded-[30px] hover:bg-purple-50 transition-all": v !== current && isSize,
|
|
46
|
+
"border-gray-400 bg-white text-gray-900 font-bold rounded-[30px] p-2 flex-1 hover:border-purple-600 hover:bg-purple-50 transition-all": !isSize,
|
|
47
|
+
"border-purple-600 bg-purple-100 text-purple-900 font-bold rounded-[30px] p-2 flex-1 shadow-sm": v === current && !isSize,
|
|
48
|
+
}
|
|
49
|
+
)}
|
|
50
|
+
disabled={disabled}
|
|
51
|
+
data-testid="option-button"
|
|
52
|
+
>
|
|
53
|
+
{v}
|
|
54
|
+
</button>
|
|
55
|
+
)
|
|
56
|
+
})}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default OptionSelect
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Button, Container, Text } from "@medusajs/ui"
|
|
2
|
+
import { cookies as nextCookies } from "next/headers"
|
|
3
|
+
|
|
4
|
+
async function ProductOnboardingCta() {
|
|
5
|
+
const cookies = await nextCookies()
|
|
6
|
+
|
|
7
|
+
const isOnboarding = cookies.get("_medusa_onboarding")?.value === "true"
|
|
8
|
+
|
|
9
|
+
if (!isOnboarding) {
|
|
10
|
+
return null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Container className="max-w-4xl h-full bg-ui-bg-subtle w-full p-8">
|
|
15
|
+
<div className="flex flex-col gap-y-4 center">
|
|
16
|
+
<Text className="text-ui-fg-base text-xl">
|
|
17
|
+
Your demo product was successfully created! 🎉
|
|
18
|
+
</Text>
|
|
19
|
+
<Text className="text-ui-fg-subtle text-small-regular">
|
|
20
|
+
You can now continue setting up your store in the admin.
|
|
21
|
+
</Text>
|
|
22
|
+
<a href="http://localhost:7001/a/orders?onboarding_step=create_order_nextjs">
|
|
23
|
+
<Button className="w-full">Continue setup in admin</Button>
|
|
24
|
+
</a>
|
|
25
|
+
</div>
|
|
26
|
+
</Container>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default ProductOnboardingCta
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Text, clx } from "@medusajs/ui"
|
|
2
|
+
import { VariantPrice } from "types/global"
|
|
3
|
+
|
|
4
|
+
export default async function PreviewPrice({ price }: { price: VariantPrice }) {
|
|
5
|
+
if (!price) {
|
|
6
|
+
return null
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
{price.price_type === "sale" && (
|
|
12
|
+
<Text
|
|
13
|
+
className="line-through text-ui-fg-muted"
|
|
14
|
+
data-testid="original-price"
|
|
15
|
+
>
|
|
16
|
+
{price.original_price}
|
|
17
|
+
</Text>
|
|
18
|
+
)}
|
|
19
|
+
<Text
|
|
20
|
+
className={clx("text-ui-fg-muted", {
|
|
21
|
+
"text-ui-fg-interactive": price.price_type === "sale",
|
|
22
|
+
})}
|
|
23
|
+
data-testid="price"
|
|
24
|
+
>
|
|
25
|
+
{price.calculated_price}
|
|
26
|
+
</Text>
|
|
27
|
+
</>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { clx } from "@medusajs/ui"
|
|
2
|
+
|
|
3
|
+
import { getProductPrice } from "@core/util/get-product-price"
|
|
4
|
+
import { HttpTypes } from "@medusajs/types"
|
|
5
|
+
|
|
6
|
+
export default function ProductPrice({
|
|
7
|
+
product,
|
|
8
|
+
variant,
|
|
9
|
+
}: {
|
|
10
|
+
product: HttpTypes.StoreProduct
|
|
11
|
+
variant?: HttpTypes.StoreProductVariant
|
|
12
|
+
}) {
|
|
13
|
+
const { cheapestPrice, variantPrice } = getProductPrice({
|
|
14
|
+
product,
|
|
15
|
+
variantId: variant?.id,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const selectedPrice = variant ? variantPrice : cheapestPrice
|
|
19
|
+
|
|
20
|
+
if (!selectedPrice) {
|
|
21
|
+
return <div className="block w-32 h-9 bg-gray-100 animate-pulse" />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex flex-col text-ui-fg-base">
|
|
26
|
+
<span
|
|
27
|
+
className={clx("text-xl-semi", {
|
|
28
|
+
"text-ui-fg-interactive": selectedPrice.price_type === "sale",
|
|
29
|
+
})}
|
|
30
|
+
>
|
|
31
|
+
{!variant && "From "}
|
|
32
|
+
<span
|
|
33
|
+
data-testid="product-price"
|
|
34
|
+
data-value={selectedPrice.calculated_price_number}
|
|
35
|
+
>
|
|
36
|
+
{selectedPrice.calculated_price}
|
|
37
|
+
</span>
|
|
38
|
+
</span>
|
|
39
|
+
{selectedPrice.price_type === "sale" && (
|
|
40
|
+
<>
|
|
41
|
+
<p>
|
|
42
|
+
<span className="text-ui-fg-subtle">Original: </span>
|
|
43
|
+
<span
|
|
44
|
+
className="line-through"
|
|
45
|
+
data-testid="original-product-price"
|
|
46
|
+
data-value={selectedPrice.original_price_number}
|
|
47
|
+
>
|
|
48
|
+
{selectedPrice.original_price}
|
|
49
|
+
</span>
|
|
50
|
+
</p>
|
|
51
|
+
<span className="text-ui-fg-interactive">
|
|
52
|
+
-{selectedPrice.percentage_diff}%
|
|
53
|
+
</span>
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@modules/common/components/product/product-rating"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Text, clx } from "@medusajs/ui"
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
type AccordionItemProps = AccordionPrimitive.AccordionItemProps & {
|
|
6
|
+
title: string
|
|
7
|
+
subtitle?: string
|
|
8
|
+
description?: string
|
|
9
|
+
required?: boolean
|
|
10
|
+
tooltip?: string
|
|
11
|
+
forceMountContent?: true
|
|
12
|
+
headingSize?: "small" | "medium" | "large"
|
|
13
|
+
customTrigger?: React.ReactNode
|
|
14
|
+
complete?: boolean
|
|
15
|
+
active?: boolean
|
|
16
|
+
triggerable?: boolean
|
|
17
|
+
children: React.ReactNode
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type AccordionProps =
|
|
21
|
+
| (AccordionPrimitive.AccordionSingleProps &
|
|
22
|
+
React.RefAttributes<HTMLDivElement>)
|
|
23
|
+
| (AccordionPrimitive.AccordionMultipleProps &
|
|
24
|
+
React.RefAttributes<HTMLDivElement>)
|
|
25
|
+
|
|
26
|
+
const Accordion: React.FC<AccordionProps> & {
|
|
27
|
+
Item: React.FC<AccordionItemProps>
|
|
28
|
+
} = ({ children, ...props }) => {
|
|
29
|
+
return (
|
|
30
|
+
<AccordionPrimitive.Root {...props}>{children}</AccordionPrimitive.Root>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const Item: React.FC<AccordionItemProps> = ({
|
|
35
|
+
title,
|
|
36
|
+
subtitle,
|
|
37
|
+
description,
|
|
38
|
+
children,
|
|
39
|
+
className,
|
|
40
|
+
headingSize = "large",
|
|
41
|
+
customTrigger = undefined,
|
|
42
|
+
forceMountContent = undefined,
|
|
43
|
+
triggerable,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
46
|
+
return (
|
|
47
|
+
<AccordionPrimitive.Item
|
|
48
|
+
{...props}
|
|
49
|
+
className={clx(
|
|
50
|
+
"border-grey-20 group border-t last:mb-0 last:border-b",
|
|
51
|
+
"py-3",
|
|
52
|
+
className
|
|
53
|
+
)}
|
|
54
|
+
>
|
|
55
|
+
<AccordionPrimitive.Header className="px-1">
|
|
56
|
+
<div className="flex flex-col">
|
|
57
|
+
<div className="flex w-full items-center justify-between">
|
|
58
|
+
<div className="flex items-center gap-4">
|
|
59
|
+
<Text className="text-ui-fg-subtle text-sm">{title}</Text>
|
|
60
|
+
</div>
|
|
61
|
+
<AccordionPrimitive.Trigger>
|
|
62
|
+
{customTrigger || <MorphingTrigger />}
|
|
63
|
+
</AccordionPrimitive.Trigger>
|
|
64
|
+
</div>
|
|
65
|
+
{subtitle && (
|
|
66
|
+
<Text as="span" size="small" className="mt-1">
|
|
67
|
+
{subtitle}
|
|
68
|
+
</Text>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
</AccordionPrimitive.Header>
|
|
72
|
+
<AccordionPrimitive.Content
|
|
73
|
+
forceMount={forceMountContent}
|
|
74
|
+
className={clx(
|
|
75
|
+
"radix-state-closed:animate-accordion-close radix-state-open:animate-accordion-open radix-state-closed:pointer-events-none px-1"
|
|
76
|
+
)}
|
|
77
|
+
>
|
|
78
|
+
<div className="inter-base-regular group-radix-state-closed:animate-accordion-close">
|
|
79
|
+
{description && <Text>{description}</Text>}
|
|
80
|
+
<div className="w-full">{children}</div>
|
|
81
|
+
</div>
|
|
82
|
+
</AccordionPrimitive.Content>
|
|
83
|
+
</AccordionPrimitive.Item>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Accordion.Item = Item
|
|
88
|
+
|
|
89
|
+
const MorphingTrigger = () => {
|
|
90
|
+
return (
|
|
91
|
+
<div className="text-grey-90 hover:bg-grey-5 active:bg-grey-5 active:text-violet-60 focus:border-violet-60 disabled:text-grey-30 bg-transparent disabled:bg-transparent rounded-rounded group relative p-[6px]">
|
|
92
|
+
<div className="h-5 w-5">
|
|
93
|
+
<span className="bg-grey-50 rounded-circle group-radix-state-open:rotate-90 absolute inset-y-[31.75%] left-[48%] right-1/2 w-[1.5px] duration-300" />
|
|
94
|
+
<span className="bg-grey-50 rounded-circle group-radix-state-open:rotate-90 group-radix-state-open:left-1/2 group-radix-state-open:right-1/2 absolute inset-x-[31.75%] top-[48%] bottom-1/2 h-[1.5px] duration-300" />
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default Accordion
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import Back from "@modules/common/icons/back"
|
|
4
|
+
import FastDelivery from "@modules/common/icons/fast-delivery"
|
|
5
|
+
import Refresh from "@modules/common/icons/refresh"
|
|
6
|
+
|
|
7
|
+
import Accordion from "./accordion"
|
|
8
|
+
import { HttpTypes } from "@medusajs/types"
|
|
9
|
+
|
|
10
|
+
type ProductTabsProps = {
|
|
11
|
+
product: HttpTypes.StoreProduct
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
import RatingsTab from "./ratings-tab"
|
|
15
|
+
|
|
16
|
+
const ProductTabs = ({ product }: ProductTabsProps) => {
|
|
17
|
+
const tabs = [
|
|
18
|
+
{
|
|
19
|
+
label: "Product Information",
|
|
20
|
+
component: <ProductInfoTab product={product} />,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "Shipping & Returns",
|
|
24
|
+
component: <ShippingInfoTab />,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Ratings",
|
|
28
|
+
component: <RatingsTab product={product} />,
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className="w-full">
|
|
34
|
+
<Accordion type="multiple">
|
|
35
|
+
{tabs.map((tab, i) => (
|
|
36
|
+
<Accordion.Item
|
|
37
|
+
key={i}
|
|
38
|
+
title={tab.label}
|
|
39
|
+
headingSize="medium"
|
|
40
|
+
value={tab.label}
|
|
41
|
+
>
|
|
42
|
+
{tab.component}
|
|
43
|
+
</Accordion.Item>
|
|
44
|
+
))}
|
|
45
|
+
</Accordion>
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const ProductInfoTab = ({ product }: ProductTabsProps) => {
|
|
51
|
+
return (
|
|
52
|
+
<div className="text-sm text-gray-900 py-8 font-medium">
|
|
53
|
+
<div className="grid grid-cols-2 gap-x-8">
|
|
54
|
+
<div className="flex flex-col gap-y-4">
|
|
55
|
+
<div>
|
|
56
|
+
<span className="font-bold text-gray-900 uppercase text-[10px] tracking-widest">Material</span>
|
|
57
|
+
<p className="text-gray-800">{product.material ? product.material : "-"}</p>
|
|
58
|
+
</div>
|
|
59
|
+
<div>
|
|
60
|
+
<span className="font-bold text-gray-900 uppercase text-[10px] tracking-widest">Country of origin</span>
|
|
61
|
+
<p className="text-gray-800">{product.origin_country ? product.origin_country : "-"}</p>
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
|
+
<span className="font-bold text-gray-900 uppercase text-[10px] tracking-widest">Type</span>
|
|
65
|
+
<p className="text-gray-800">{product.type ? product.type.value : "-"}</p>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div className="flex flex-col gap-y-4">
|
|
69
|
+
<div>
|
|
70
|
+
<span className="font-bold text-gray-900 uppercase text-[10px] tracking-widest">Weight</span>
|
|
71
|
+
<p className="text-gray-800">{product.weight ? `${product.weight} g` : "-"}</p>
|
|
72
|
+
</div>
|
|
73
|
+
<div>
|
|
74
|
+
<span className="font-bold text-gray-900 uppercase text-[10px] tracking-widest">Dimensions</span>
|
|
75
|
+
<p className="text-gray-800">
|
|
76
|
+
{product.length && product.width && product.height
|
|
77
|
+
? `${product.length}L x ${product.width}W x ${product.height}H`
|
|
78
|
+
: "-"}
|
|
79
|
+
</p>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const ShippingInfoTab = () => {
|
|
88
|
+
return (
|
|
89
|
+
<div className="text-sm text-gray-900 py-8 font-medium">
|
|
90
|
+
<div className="grid grid-cols-1 gap-y-8">
|
|
91
|
+
<div className="flex items-start gap-x-2">
|
|
92
|
+
<FastDelivery />
|
|
93
|
+
<div>
|
|
94
|
+
<span className="font-semibold">Fast delivery</span>
|
|
95
|
+
<p className="max-w-sm">
|
|
96
|
+
Your package will arrive in 3-5 business days at your pick up
|
|
97
|
+
location or in the comfort of your home.
|
|
98
|
+
</p>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
<div className="flex items-start gap-x-2">
|
|
102
|
+
<Refresh />
|
|
103
|
+
<div>
|
|
104
|
+
<span className="font-semibold">Simple exchanges</span>
|
|
105
|
+
<p className="max-w-sm">
|
|
106
|
+
Is the fit not quite right? No worries - we'll exchange your
|
|
107
|
+
product for a new one.
|
|
108
|
+
</p>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div className="flex items-start gap-x-2">
|
|
112
|
+
<Back />
|
|
113
|
+
<div>
|
|
114
|
+
<span className="font-semibold">Easy returns</span>
|
|
115
|
+
<p className="max-w-sm">
|
|
116
|
+
Just return your product and we'll refund your money. No
|
|
117
|
+
questions asked – we'll do our best to make sure your return
|
|
118
|
+
is hassle-free.
|
|
119
|
+
</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export default ProductTabs
|