@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.
Files changed (338) hide show
  1. package/bin/create-storefront.js +239 -0
  2. package/lib/kit-next-config.js +84 -0
  3. package/package.json +32 -0
  4. package/templates/storefront/.eslintrc.json +3 -0
  5. package/templates/storefront/README.md +35 -0
  6. package/templates/storefront/check-env-variables.js +51 -0
  7. package/templates/storefront/kit-next-config.js +71 -0
  8. package/templates/storefront/next-env.d.ts +5 -0
  9. package/templates/storefront/next.config.js +25 -0
  10. package/templates/storefront/package.json +56 -0
  11. package/templates/storefront/postcss.config.js +6 -0
  12. package/templates/storefront/public/favicon.png +0 -0
  13. package/templates/storefront/src/app/[countryCode]/(checkout)/checkout/page.tsx +23 -0
  14. package/templates/storefront/src/app/[countryCode]/(checkout)/checkout/payment/page.tsx +47 -0
  15. package/templates/storefront/src/app/[countryCode]/(checkout)/layout.tsx +31 -0
  16. package/templates/storefront/src/app/[countryCode]/(checkout)/not-found.tsx +19 -0
  17. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/addresses/page.tsx +31 -0
  18. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/loading.tsx +9 -0
  19. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/details/[id]/page.tsx +35 -0
  20. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/exchange/[id]/page.tsx +47 -0
  21. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/page.tsx +28 -0
  22. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/orders/return/[id]/page.tsx +66 -0
  23. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/page.tsx +22 -0
  24. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/payment-methods/page.tsx +23 -0
  25. package/templates/storefront/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx +43 -0
  26. package/templates/storefront/src/app/[countryCode]/(main)/account/@login/default.tsx +11 -0
  27. package/templates/storefront/src/app/[countryCode]/(main)/account/@login/page.tsx +18 -0
  28. package/templates/storefront/src/app/[countryCode]/(main)/account/guest-orders/page.tsx +13 -0
  29. package/templates/storefront/src/app/[countryCode]/(main)/account/layout.tsx +22 -0
  30. package/templates/storefront/src/app/[countryCode]/(main)/account/loading.tsx +9 -0
  31. package/templates/storefront/src/app/[countryCode]/(main)/cart/loading.tsx +5 -0
  32. package/templates/storefront/src/app/[countryCode]/(main)/cart/not-found.tsx +21 -0
  33. package/templates/storefront/src/app/[countryCode]/(main)/cart/page.tsx +23 -0
  34. package/templates/storefront/src/app/[countryCode]/(main)/categories/[...category]/page.tsx +11 -0
  35. package/templates/storefront/src/app/[countryCode]/(main)/collections/[handle]/page.tsx +11 -0
  36. package/templates/storefront/src/app/[countryCode]/(main)/contact/page.tsx +21 -0
  37. package/templates/storefront/src/app/[countryCode]/(main)/guest-orders/page.tsx +12 -0
  38. package/templates/storefront/src/app/[countryCode]/(main)/help/page.tsx +28 -0
  39. package/templates/storefront/src/app/[countryCode]/(main)/layout.tsx +21 -0
  40. package/templates/storefront/src/app/[countryCode]/(main)/not-found.tsx +20 -0
  41. package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/confirmed/loading.tsx +5 -0
  42. package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/confirmed/page.tsx +23 -0
  43. package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/accept/page.tsx +41 -0
  44. package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/decline/page.tsx +41 -0
  45. package/templates/storefront/src/app/[countryCode]/(main)/order/[id]/transfer/[token]/page.tsx +38 -0
  46. package/templates/storefront/src/app/[countryCode]/(main)/order/exchange/[id]/page.tsx +47 -0
  47. package/templates/storefront/src/app/[countryCode]/(main)/order/return/[id]/page.tsx +61 -0
  48. package/templates/storefront/src/app/[countryCode]/(main)/orders/[id]/page.tsx +33 -0
  49. package/templates/storefront/src/app/[countryCode]/(main)/page.tsx +24 -0
  50. package/templates/storefront/src/app/[countryCode]/(main)/privacy-policy/page.tsx +173 -0
  51. package/templates/storefront/src/app/[countryCode]/(main)/products/[handle]/page.tsx +193 -0
  52. package/templates/storefront/src/app/[countryCode]/(main)/reset-password/page.tsx +192 -0
  53. package/templates/storefront/src/app/[countryCode]/(main)/store/page.tsx +72 -0
  54. package/templates/storefront/src/app/[countryCode]/(main)/terms-of-use/page.tsx +179 -0
  55. package/templates/storefront/src/app/[countryCode]/(main)/wishlist/page.tsx +19 -0
  56. package/templates/storefront/src/app/api/meta/event/route.ts +63 -0
  57. package/templates/storefront/src/app/auth/customer/google/callback/page.tsx +126 -0
  58. package/templates/storefront/src/app/layout.tsx +104 -0
  59. package/templates/storefront/src/app/not-found.tsx +30 -0
  60. package/templates/storefront/src/app/opengraph-image.jpg +0 -0
  61. package/templates/storefront/src/app/robots.ts +15 -0
  62. package/templates/storefront/src/app/sitemap.ts +65 -0
  63. package/templates/storefront/src/app/twitter-image.jpg +0 -0
  64. package/templates/storefront/src/modules/account/components/account-deletion/index.tsx +160 -0
  65. package/templates/storefront/src/modules/account/components/account-info/index.tsx +145 -0
  66. package/templates/storefront/src/modules/account/components/account-nav/icons.tsx +43 -0
  67. package/templates/storefront/src/modules/account/components/account-nav/index.tsx +318 -0
  68. package/templates/storefront/src/modules/account/components/account-nav/logout-modal.tsx +92 -0
  69. package/templates/storefront/src/modules/account/components/account-nav/payment-methods-icon.tsx +9 -0
  70. package/templates/storefront/src/modules/account/components/address-book/index.tsx +47 -0
  71. package/templates/storefront/src/modules/account/components/address-card/add-address.tsx +377 -0
  72. package/templates/storefront/src/modules/account/components/address-card/edit-address-modal.tsx +468 -0
  73. package/templates/storefront/src/modules/account/components/deletion-pending-modal/index.tsx +213 -0
  74. package/templates/storefront/src/modules/account/components/forgot-password/index.tsx +1 -0
  75. package/templates/storefront/src/modules/account/components/login/index.tsx +1 -0
  76. package/templates/storefront/src/modules/account/components/order-card/index.tsx +221 -0
  77. package/templates/storefront/src/modules/account/components/order-overview/index.tsx +159 -0
  78. package/templates/storefront/src/modules/account/components/overview/index.tsx +189 -0
  79. package/templates/storefront/src/modules/account/components/profile-billing-address/index.tsx +447 -0
  80. package/templates/storefront/src/modules/account/components/profile-email/index.tsx +75 -0
  81. package/templates/storefront/src/modules/account/components/profile-form/index.tsx +416 -0
  82. package/templates/storefront/src/modules/account/components/profile-name/index.tsx +76 -0
  83. package/templates/storefront/src/modules/account/components/profile-password/index.tsx +70 -0
  84. package/templates/storefront/src/modules/account/components/profile-phone/index.tsx +185 -0
  85. package/templates/storefront/src/modules/account/components/register/index.tsx +1 -0
  86. package/templates/storefront/src/modules/account/components/return-item-selector/index.tsx +187 -0
  87. package/templates/storefront/src/modules/account/components/return-shipping-selector/index.tsx +118 -0
  88. package/templates/storefront/src/modules/account/components/transfer-request-form/index.tsx +81 -0
  89. package/templates/storefront/src/modules/account/templates/account-layout.tsx +38 -0
  90. package/templates/storefront/src/modules/account/templates/exchange-request-template.tsx +389 -0
  91. package/templates/storefront/src/modules/account/templates/guest-orders-template.tsx +123 -0
  92. package/templates/storefront/src/modules/account/templates/login-template.tsx +44 -0
  93. package/templates/storefront/src/modules/account/templates/payment-methods-template.tsx +478 -0
  94. package/templates/storefront/src/modules/account/templates/return-request-template.tsx +300 -0
  95. package/templates/storefront/src/modules/cart/components/abandoned-carts/ScrollToPendingOrdersButton.tsx +21 -0
  96. package/templates/storefront/src/modules/cart/components/abandoned-carts/index.tsx +335 -0
  97. package/templates/storefront/src/modules/cart/components/applied-promotions/index.tsx +121 -0
  98. package/templates/storefront/src/modules/cart/components/cart-delivery-selection/index.tsx +203 -0
  99. package/templates/storefront/src/modules/cart/components/cart-item-card/index.tsx +476 -0
  100. package/templates/storefront/src/modules/cart/components/cart-item-select/index.tsx +73 -0
  101. package/templates/storefront/src/modules/cart/components/cart-view-tracker/index.tsx +44 -0
  102. package/templates/storefront/src/modules/cart/components/delivery-information/index.tsx +89 -0
  103. package/templates/storefront/src/modules/cart/components/empty-cart-message/index.tsx +38 -0
  104. package/templates/storefront/src/modules/cart/components/item/index.tsx +150 -0
  105. package/templates/storefront/src/modules/cart/components/pincode-checker/index.tsx +174 -0
  106. package/templates/storefront/src/modules/cart/components/sign-in-prompt/index.tsx +26 -0
  107. package/templates/storefront/src/modules/cart/components/you-may-also-like/index.tsx +137 -0
  108. package/templates/storefront/src/modules/cart/templates/index.tsx +88 -0
  109. package/templates/storefront/src/modules/cart/templates/items.tsx +49 -0
  110. package/templates/storefront/src/modules/cart/templates/preview.tsx +51 -0
  111. package/templates/storefront/src/modules/cart/templates/summary.tsx +29 -0
  112. package/templates/storefront/src/modules/checkout/components/add-address-modal/index.tsx +390 -0
  113. package/templates/storefront/src/modules/checkout/components/address-card/index.tsx +135 -0
  114. package/templates/storefront/src/modules/checkout/components/address-select/index.tsx +116 -0
  115. package/templates/storefront/src/modules/checkout/components/addresses/index.tsx +605 -0
  116. package/templates/storefront/src/modules/checkout/components/back-link/index.tsx +32 -0
  117. package/templates/storefront/src/modules/checkout/components/billing_address/index.tsx +301 -0
  118. package/templates/storefront/src/modules/checkout/components/checkout-begin-tracker/index.tsx +45 -0
  119. package/templates/storefront/src/modules/checkout/components/checkout-leave-guard/index.tsx +109 -0
  120. package/templates/storefront/src/modules/checkout/components/checkout-shipping-tracker/index.tsx +45 -0
  121. package/templates/storefront/src/modules/checkout/components/country-select/index.tsx +50 -0
  122. package/templates/storefront/src/modules/checkout/components/discount-code/index.tsx +220 -0
  123. package/templates/storefront/src/modules/checkout/components/error-message/index.tsx +13 -0
  124. package/templates/storefront/src/modules/checkout/components/payment/index.tsx +572 -0
  125. package/templates/storefront/src/modules/checkout/components/payment-button/index.tsx +257 -0
  126. package/templates/storefront/src/modules/checkout/components/payment-button/razorpay-payment-button.tsx +136 -0
  127. package/templates/storefront/src/modules/checkout/components/payment-container/index.tsx +129 -0
  128. package/templates/storefront/src/modules/checkout/components/payment-test/index.tsx +12 -0
  129. package/templates/storefront/src/modules/checkout/components/payment-wrapper/index.tsx +50 -0
  130. package/templates/storefront/src/modules/checkout/components/payment-wrapper/stripe-wrapper.tsx +54 -0
  131. package/templates/storefront/src/modules/checkout/components/processing-overlay/index.tsx +83 -0
  132. package/templates/storefront/src/modules/checkout/components/review/index.tsx +60 -0
  133. package/templates/storefront/src/modules/checkout/components/select-address-modal/index.tsx +103 -0
  134. package/templates/storefront/src/modules/checkout/components/shipping/index.tsx +533 -0
  135. package/templates/storefront/src/modules/checkout/components/shipping-address/index.tsx +521 -0
  136. package/templates/storefront/src/modules/checkout/components/submit-button/index.tsx +32 -0
  137. package/templates/storefront/src/modules/checkout/templates/checkout-form/index.tsx +38 -0
  138. package/templates/storefront/src/modules/checkout/templates/checkout-summary/index.tsx +274 -0
  139. package/templates/storefront/src/modules/common/components/breadcrumb/index.tsx +43 -0
  140. package/templates/storefront/src/modules/common/components/cart-totals/index.tsx +473 -0
  141. package/templates/storefront/src/modules/common/components/checkbox/index.tsx +98 -0
  142. package/templates/storefront/src/modules/common/components/delete-button/index.tsx +156 -0
  143. package/templates/storefront/src/modules/common/components/divider/index.tsx +9 -0
  144. package/templates/storefront/src/modules/common/components/filter-checkbox-group/index.tsx +134 -0
  145. package/templates/storefront/src/modules/common/components/filter-radio-group/index.tsx +62 -0
  146. package/templates/storefront/src/modules/common/components/input/index.tsx +79 -0
  147. package/templates/storefront/src/modules/common/components/interactive-link/index.tsx +33 -0
  148. package/templates/storefront/src/modules/common/components/line-item-options/index.tsx +26 -0
  149. package/templates/storefront/src/modules/common/components/line-item-price/index.tsx +64 -0
  150. package/templates/storefront/src/modules/common/components/line-item-unit-price/index.tsx +61 -0
  151. package/templates/storefront/src/modules/common/components/localized-client-link/index.tsx +32 -0
  152. package/templates/storefront/src/modules/common/components/login-popup/index.tsx +78 -0
  153. package/templates/storefront/src/modules/common/components/modal/index.tsx +123 -0
  154. package/templates/storefront/src/modules/common/components/native-select/index.tsx +75 -0
  155. package/templates/storefront/src/modules/common/components/obfuscated-email/index.tsx +30 -0
  156. package/templates/storefront/src/modules/common/components/product/product-rating/index.tsx +172 -0
  157. package/templates/storefront/src/modules/common/components/product/review-modal/index.tsx +333 -0
  158. package/templates/storefront/src/modules/common/components/product/share-button/index.tsx +227 -0
  159. package/templates/storefront/src/modules/common/components/product/wishlist-icon/index.tsx +46 -0
  160. package/templates/storefront/src/modules/common/components/radio/index.tsx +27 -0
  161. package/templates/storefront/src/modules/common/components/select/index.tsx +164 -0
  162. package/templates/storefront/src/modules/common/components/side-panel/index.tsx +65 -0
  163. package/templates/storefront/src/modules/common/icons/arrow-left.tsx +36 -0
  164. package/templates/storefront/src/modules/common/icons/back.tsx +37 -0
  165. package/templates/storefront/src/modules/common/icons/bancontact.tsx +26 -0
  166. package/templates/storefront/src/modules/common/icons/chevron-down.tsx +30 -0
  167. package/templates/storefront/src/modules/common/icons/delivered.tsx +29 -0
  168. package/templates/storefront/src/modules/common/icons/envelope.tsx +27 -0
  169. package/templates/storefront/src/modules/common/icons/eye-off.tsx +37 -0
  170. package/templates/storefront/src/modules/common/icons/eye.tsx +37 -0
  171. package/templates/storefront/src/modules/common/icons/fast-delivery.tsx +65 -0
  172. package/templates/storefront/src/modules/common/icons/ideal.tsx +26 -0
  173. package/templates/storefront/src/modules/common/icons/lock.tsx +31 -0
  174. package/templates/storefront/src/modules/common/icons/map-pin.tsx +37 -0
  175. package/templates/storefront/src/modules/common/icons/medusa.tsx +27 -0
  176. package/templates/storefront/src/modules/common/icons/menu.tsx +45 -0
  177. package/templates/storefront/src/modules/common/icons/nextjs.tsx +27 -0
  178. package/templates/storefront/src/modules/common/icons/package.tsx +44 -0
  179. package/templates/storefront/src/modules/common/icons/paypal.tsx +30 -0
  180. package/templates/storefront/src/modules/common/icons/phone.tsx +30 -0
  181. package/templates/storefront/src/modules/common/icons/placeholder-image.tsx +44 -0
  182. package/templates/storefront/src/modules/common/icons/refresh.tsx +51 -0
  183. package/templates/storefront/src/modules/common/icons/spinner.tsx +37 -0
  184. package/templates/storefront/src/modules/common/icons/trash.tsx +51 -0
  185. package/templates/storefront/src/modules/common/icons/user.tsx +37 -0
  186. package/templates/storefront/src/modules/common/icons/x.tsx +37 -0
  187. package/templates/storefront/src/modules/contact/templates/index.tsx +272 -0
  188. package/templates/storefront/src/modules/help/templates/index.tsx +629 -0
  189. package/templates/storefront/src/modules/home/components/dynamic-banner/index.tsx +190 -0
  190. package/templates/storefront/src/modules/home/components/featured-products/index.tsx +16 -0
  191. package/templates/storefront/src/modules/home/components/featured-products/product-rail/index.tsx +51 -0
  192. package/templates/storefront/src/modules/home/components/features/index.tsx +1 -0
  193. package/templates/storefront/src/modules/home/components/hero/index.tsx +1 -0
  194. package/templates/storefront/src/modules/home/components/loved-by-moms/index.tsx +1 -0
  195. package/templates/storefront/src/modules/home/components/new-arrivals/index.tsx +1 -0
  196. package/templates/storefront/src/modules/home/components/shop-by-age/index.tsx +1 -0
  197. package/templates/storefront/src/modules/home/components/shop-by-category/index.tsx +1 -0
  198. package/templates/storefront/src/modules/home/components/testimonials/index.tsx +1 -0
  199. package/templates/storefront/src/modules/home/components/why-choose-us/dynamic-features.tsx +93 -0
  200. package/templates/storefront/src/modules/home/components/why-choose-us/index.tsx +1 -0
  201. package/templates/storefront/src/modules/layout/components/account-dropdown/index.tsx +56 -0
  202. package/templates/storefront/src/modules/layout/components/cart-button/index.tsx +8 -0
  203. package/templates/storefront/src/modules/layout/components/cart-dropdown/index.tsx +424 -0
  204. package/templates/storefront/src/modules/layout/components/cart-mismatch-banner/index.tsx +57 -0
  205. package/templates/storefront/src/modules/layout/components/cookie-consent/index.tsx +116 -0
  206. package/templates/storefront/src/modules/layout/components/country-select/index.tsx +135 -0
  207. package/templates/storefront/src/modules/layout/components/desktop-search/index.tsx +148 -0
  208. package/templates/storefront/src/modules/layout/components/dynamic-logo/index.tsx +27 -0
  209. package/templates/storefront/src/modules/layout/components/footer-categories/index.tsx +34 -0
  210. package/templates/storefront/src/modules/layout/components/footer-contact/index.tsx +87 -0
  211. package/templates/storefront/src/modules/layout/components/footer-description/index.tsx +12 -0
  212. package/templates/storefront/src/modules/layout/components/footer-logo/index.tsx +22 -0
  213. package/templates/storefront/src/modules/layout/components/footer-newsletter/index.tsx +100 -0
  214. package/templates/storefront/src/modules/layout/components/language-select/index.tsx +192 -0
  215. package/templates/storefront/src/modules/layout/components/medusa-cta/index.tsx +21 -0
  216. package/templates/storefront/src/modules/layout/components/mobile-menu/index.tsx +296 -0
  217. package/templates/storefront/src/modules/layout/components/nav-links/index.tsx +66 -0
  218. package/templates/storefront/src/modules/layout/components/nav-wrapper/index.tsx +14 -0
  219. package/templates/storefront/src/modules/layout/components/promo-bar/index.tsx +7 -0
  220. package/templates/storefront/src/modules/layout/components/promo-bar/promo-bar-content.tsx +174 -0
  221. package/templates/storefront/src/modules/layout/components/push-notification-manager/index.tsx +191 -0
  222. package/templates/storefront/src/modules/layout/components/search-panel/index.tsx +136 -0
  223. package/templates/storefront/src/modules/layout/components/side-menu/index.tsx +144 -0
  224. package/templates/storefront/src/modules/layout/components/verification-banner/index.tsx +217 -0
  225. package/templates/storefront/src/modules/layout/components/wishlist-counter/index.tsx +17 -0
  226. package/templates/storefront/src/modules/layout/templates/footer/index.tsx +7 -0
  227. package/templates/storefront/src/modules/layout/templates/nav/index.tsx +14 -0
  228. package/templates/storefront/src/modules/order/components/cancel-order-modal/index.tsx +168 -0
  229. package/templates/storefront/src/modules/order/components/help/index.tsx +25 -0
  230. package/templates/storefront/src/modules/order/components/item/index.tsx +62 -0
  231. package/templates/storefront/src/modules/order/components/items/index.tsx +44 -0
  232. package/templates/storefront/src/modules/order/components/onboarding-cta/index.tsx +28 -0
  233. package/templates/storefront/src/modules/order/components/order-confirmation-back-handler/index.tsx +28 -0
  234. package/templates/storefront/src/modules/order/components/order-details/index.tsx +63 -0
  235. package/templates/storefront/src/modules/order/components/order-purchase-tracker/index.tsx +48 -0
  236. package/templates/storefront/src/modules/order/components/order-redesign/index.tsx +887 -0
  237. package/templates/storefront/src/modules/order/components/order-summary/index.tsx +60 -0
  238. package/templates/storefront/src/modules/order/components/payment-details/index.tsx +63 -0
  239. package/templates/storefront/src/modules/order/components/shipping-details/index.tsx +73 -0
  240. package/templates/storefront/src/modules/order/components/transfer-actions/index.tsx +81 -0
  241. package/templates/storefront/src/modules/order/components/transfer-image/index.tsx +275 -0
  242. package/templates/storefront/src/modules/order/templates/order-completed-template.tsx +233 -0
  243. package/templates/storefront/src/modules/order/templates/order-details-template.tsx +128 -0
  244. package/templates/storefront/src/modules/products/components/image-gallery/index.tsx +297 -0
  245. package/templates/storefront/src/modules/products/components/product-actions/index.tsx +1400 -0
  246. package/templates/storefront/src/modules/products/components/product-actions/mobile-actions.tsx +217 -0
  247. package/templates/storefront/src/modules/products/components/product-actions/option-select.tsx +62 -0
  248. package/templates/storefront/src/modules/products/components/product-onboarding-cta/index.tsx +30 -0
  249. package/templates/storefront/src/modules/products/components/product-preview/index.tsx +5 -0
  250. package/templates/storefront/src/modules/products/components/product-preview/price.tsx +29 -0
  251. package/templates/storefront/src/modules/products/components/product-price/index.tsx +58 -0
  252. package/templates/storefront/src/modules/products/components/product-rating/index.tsx +1 -0
  253. package/templates/storefront/src/modules/products/components/product-tabs/accordion.tsx +100 -0
  254. package/templates/storefront/src/modules/products/components/product-tabs/index.tsx +127 -0
  255. package/templates/storefront/src/modules/products/components/product-tabs/ratings-tab.tsx +598 -0
  256. package/templates/storefront/src/modules/products/components/product-view-tracker/index.tsx +53 -0
  257. package/templates/storefront/src/modules/products/components/related-products/index.tsx +152 -0
  258. package/templates/storefront/src/modules/products/components/review-modal/index.tsx +1 -0
  259. package/templates/storefront/src/modules/products/components/share-button/index.tsx +1 -0
  260. package/templates/storefront/src/modules/products/components/thumbnail/index.tsx +91 -0
  261. package/templates/storefront/src/modules/products/components/wishlist-icon/index.tsx +1 -0
  262. package/templates/storefront/src/modules/products/context/product-context.tsx +52 -0
  263. package/templates/storefront/src/modules/products/templates/index.tsx +26 -0
  264. package/templates/storefront/src/modules/products/templates/product-actions-wrapper/index.tsx +1 -0
  265. package/templates/storefront/src/modules/products/templates/product-info/index.tsx +2 -0
  266. package/templates/storefront/src/modules/shipping/components/free-shipping-price-nudge/index.tsx +283 -0
  267. package/templates/storefront/src/modules/skeletons/components/skeleton-button/index.tsx +5 -0
  268. package/templates/storefront/src/modules/skeletons/components/skeleton-card-details/index.tsx +10 -0
  269. package/templates/storefront/src/modules/skeletons/components/skeleton-cart-item/index.tsx +35 -0
  270. package/templates/storefront/src/modules/skeletons/components/skeleton-cart-totals/index.tsx +30 -0
  271. package/templates/storefront/src/modules/skeletons/components/skeleton-code-form/index.tsx +13 -0
  272. package/templates/storefront/src/modules/skeletons/components/skeleton-line-item/index.tsx +35 -0
  273. package/templates/storefront/src/modules/skeletons/components/skeleton-order-confirmed-header/index.tsx +14 -0
  274. package/templates/storefront/src/modules/skeletons/components/skeleton-order-information/index.tsx +36 -0
  275. package/templates/storefront/src/modules/skeletons/components/skeleton-order-items/index.tsx +43 -0
  276. package/templates/storefront/src/modules/skeletons/components/skeleton-order-summary/index.tsx +15 -0
  277. package/templates/storefront/src/modules/skeletons/components/skeleton-product-preview/index.tsx +15 -0
  278. package/templates/storefront/src/modules/skeletons/templates/skeleton-cart-page/index.tsx +65 -0
  279. package/templates/storefront/src/modules/skeletons/templates/skeleton-order-confirmed/index.tsx +21 -0
  280. package/templates/storefront/src/modules/skeletons/templates/skeleton-product-grid/index.tsx +23 -0
  281. package/templates/storefront/src/modules/skeletons/templates/skeleton-related-products/index.tsx +25 -0
  282. package/templates/storefront/src/modules/store/components/client-paginated-products.tsx +108 -0
  283. package/templates/storefront/src/modules/store/components/mobile-filters/index.tsx +135 -0
  284. package/templates/storefront/src/modules/store/components/pagination/index.tsx +118 -0
  285. package/templates/storefront/src/modules/store/components/product-list-view-tracker/index.tsx +43 -0
  286. package/templates/storefront/src/modules/store/components/refinement-list/index.tsx +299 -0
  287. package/templates/storefront/src/modules/store/components/refinement-list/sort-products/index.tsx +120 -0
  288. package/templates/storefront/src/modules/store/components/store-header/index.tsx +67 -0
  289. package/templates/storefront/src/modules/store/templates/index.tsx +1 -0
  290. package/templates/storefront/src/modules/store/templates/paginated-products.tsx +175 -0
  291. package/templates/storefront/src/modules/wishlist/components/wishlist-item/index.tsx +797 -0
  292. package/templates/storefront/src/modules/wishlist/templates/index.tsx +176 -0
  293. package/templates/storefront/src/storefront.config.ts +12 -0
  294. package/templates/storefront/src/styles/globals.css +326 -0
  295. package/templates/storefront/src/theme/valero/blocks/home/Features/index.tsx +61 -0
  296. package/templates/storefront/src/theme/valero/blocks/home/Hero/index.tsx +102 -0
  297. package/templates/storefront/src/theme/valero/blocks/home/LovedByMoms/index.tsx +407 -0
  298. package/templates/storefront/src/theme/valero/blocks/home/NewArrivals/index.tsx +48 -0
  299. package/templates/storefront/src/theme/valero/blocks/home/ShopByAge/index.tsx +128 -0
  300. package/templates/storefront/src/theme/valero/blocks/home/ShopByCategory/index.tsx +409 -0
  301. package/templates/storefront/src/theme/valero/blocks/home/Testimonials/index.tsx +697 -0
  302. package/templates/storefront/src/theme/valero/blocks/home/WhyChooseUs/index.tsx +62 -0
  303. package/templates/storefront/src/theme/valero/layouts/MainLayoutShell.tsx +14 -0
  304. package/templates/storefront/src/theme/valero/primitives/Button.tsx +28 -0
  305. package/templates/storefront/src/theme/valero/primitives/Card.tsx +32 -0
  306. package/templates/storefront/src/theme/valero/primitives/index.ts +2 -0
  307. package/templates/storefront/src/theme/valero/slots/account/ForgotPassword/index.tsx +1 -0
  308. package/templates/storefront/src/theme/valero/slots/account/Login/index.tsx +1 -0
  309. package/templates/storefront/src/theme/valero/slots/account/LoginTemplate/index.tsx +44 -0
  310. package/templates/storefront/src/theme/valero/slots/account/Register/index.tsx +1 -0
  311. package/templates/storefront/src/theme/valero/slots/cart/CartItem/index.tsx +11 -0
  312. package/templates/storefront/src/theme/valero/slots/cart/CartSummary/index.tsx +13 -0
  313. package/templates/storefront/src/theme/valero/slots/checkout/CheckoutForm/index.tsx +1 -0
  314. package/templates/storefront/src/theme/valero/slots/checkout/CheckoutSummary/index.tsx +1 -0
  315. package/templates/storefront/src/theme/valero/slots/layout/Footer/index.tsx +104 -0
  316. package/templates/storefront/src/theme/valero/slots/layout/Nav/index.tsx +97 -0
  317. package/templates/storefront/src/theme/valero/slots/layout/PromoBar/index.tsx +19 -0
  318. package/templates/storefront/src/theme/valero/slots/layout/PromoBar/promo-bar-content.tsx +174 -0
  319. package/templates/storefront/src/theme/valero/slots/order/OrderDetails/index.tsx +12 -0
  320. package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductCTASection.tsx +191 -0
  321. package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductDetailsSection.tsx +137 -0
  322. package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductFeaturePanel.tsx +245 -0
  323. package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductHighlightsSection.tsx +98 -0
  324. package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductOptionsSection.tsx +233 -0
  325. package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductPriceSection.tsx +53 -0
  326. package/templates/storefront/src/theme/valero/slots/product/ProductActions/ProductTrustSection.tsx +84 -0
  327. package/templates/storefront/src/theme/valero/slots/product/ProductActions/index.tsx +161 -0
  328. package/templates/storefront/src/theme/valero/slots/product/ProductCard/index.tsx +132 -0
  329. package/templates/storefront/src/theme/valero/slots/product/ProductInfo/index.tsx +40 -0
  330. package/templates/storefront/src/theme/valero/templates/StorePage/index.tsx +154 -0
  331. package/templates/storefront/src/theme/valero/tokens/colors.js +16 -0
  332. package/templates/storefront/src/theme/valero/tokens/colors.ts +21 -0
  333. package/templates/storefront/src/theme/valero/tokens/fonts.ts +13 -0
  334. package/templates/storefront/src/theme/valero/tokens/index.ts +3 -0
  335. package/templates/storefront/src/theme/valero/tokens/spacing.ts +9 -0
  336. package/templates/storefront/src/theme/valero/tokens/theme.css +91 -0
  337. package/templates/storefront/tailwind.config.js +221 -0
  338. package/templates/storefront/tsconfig.json +30 -0
@@ -0,0 +1,424 @@
1
+ "use client"
2
+
3
+ import {
4
+ Popover,
5
+ PopoverButton,
6
+ PopoverPanel,
7
+ Transition,
8
+ } from "@headlessui/react"
9
+ import Image from "next/image"
10
+ import { convertToLocale } from "@core/util/money"
11
+ import { HttpTypes } from "@medusajs/types"
12
+ import { Button } from "@medusajs/ui"
13
+ import DeleteButton from "@modules/common/components/delete-button"
14
+ import LineItemOptions from "@modules/common/components/line-item-options"
15
+ import LineItemPrice from "@modules/common/components/line-item-price"
16
+ import LocalizedClientLink from "@modules/common/components/localized-client-link"
17
+ import Thumbnail from "@modules/products/components/thumbnail"
18
+ import { usePathname } from "next/navigation"
19
+ import { Fragment, useEffect, useRef, useState } from "react"
20
+
21
+ const CartDropdown = ({
22
+ cart: cartState,
23
+ }: {
24
+ cart?: HttpTypes.StoreCart | null
25
+ }) => {
26
+ const [activeTimer, setActiveTimer] = useState<NodeJS.Timer | undefined>(
27
+ undefined
28
+ )
29
+ const [cartDropdownOpen, setCartDropdownOpen] = useState(false)
30
+
31
+ const open = () => setCartDropdownOpen(true)
32
+ const close = () => setCartDropdownOpen(false)
33
+
34
+ const totalItems =
35
+ cartState?.items?.reduce((acc, item) => {
36
+ return acc + item.quantity
37
+ }, 0) || 0
38
+
39
+ const subtotal = cartState?.subtotal ?? 0
40
+ const itemRef = useRef<number>(totalItems || 0)
41
+
42
+ const timedOpen = () => {
43
+ open()
44
+
45
+ const timer = setTimeout(close, 2000)
46
+
47
+ setActiveTimer(timer)
48
+ }
49
+
50
+ const openAndCancel = () => {
51
+ if (activeTimer) {
52
+ clearTimeout(activeTimer)
53
+ }
54
+ }
55
+
56
+ // Clean up the timer when the component unmounts
57
+ useEffect(() => {
58
+ return () => {
59
+ if (activeTimer) {
60
+ clearTimeout(activeTimer)
61
+ }
62
+ }
63
+ }, [activeTimer])
64
+
65
+ const pathname = usePathname()
66
+ const prevPathname = useRef(pathname)
67
+
68
+ // open cart dropdown when modifying the cart items, but only if we're not on the cart page
69
+ useEffect(() => {
70
+ // Check if we just navigated away from the cart page
71
+ const isNavigationFromCart = prevPathname.current.includes("/cart") && !pathname.includes("/cart")
72
+
73
+ if (itemRef.current !== totalItems && !pathname.includes("/cart") && !isNavigationFromCart) {
74
+ timedOpen()
75
+ }
76
+ itemRef.current = totalItems
77
+ prevPathname.current = pathname
78
+ // eslint-disable-next-line react-hooks/exhaustive-deps
79
+ }, [totalItems, pathname])
80
+
81
+ const [isMounted, setIsMounted] = useState(false)
82
+
83
+ useEffect(() => {
84
+ setIsMounted(true)
85
+ }, [])
86
+
87
+ if (pathname.includes("/cart")) {
88
+ return (
89
+ <div className="h-full flex items-center">
90
+ <LocalizedClientLink
91
+ className="hover:opacity-80 transition-opacity flex items-center"
92
+ href="/cart"
93
+ data-testid="nav-cart-link-simple"
94
+ >
95
+ <div className="relative">
96
+ <Image
97
+ src="/shopping-bag (3).svg"
98
+ alt="Cart"
99
+ width={26}
100
+ height={26}
101
+ className="w-7 h-7 sm:w-6 sm:h-6 lg:w-7 lg:h-7"
102
+ />
103
+ {totalItems > 0 && (
104
+ <div className="absolute -top-1.5 -right-1.5 h-3.5 w-3.5 sm:h-4 sm:w-4 flex items-center justify-center bg-brand-accent text-inverse text-[8px] sm:text-[10px] rounded-full font-bold shadow-sm">
105
+ {totalItems}
106
+ </div>
107
+ )}
108
+ </div>
109
+ </LocalizedClientLink>
110
+ </div>
111
+ )
112
+ }
113
+
114
+ return (
115
+ <div
116
+ className="h-full z-50"
117
+ onMouseEnter={openAndCancel}
118
+ onMouseLeave={close}
119
+ >
120
+ <Popover className="relative h-full">
121
+ {!isMounted ? (
122
+ /* Placeholder to prevent hydration mismatch */
123
+ <div className="h-full flex items-center">
124
+ <div className="relative">
125
+ <Image src="/shopping-bag (3).svg" alt="Cart" width={26} height={26} className="w-7 h-7 sm:w-6 sm:h-6 lg:w-7 lg:h-7" />
126
+ {totalItems > 0 && (
127
+ <div className="absolute -top-1.5 -right-1.5 h-3.5 w-3.5 sm:h-4 sm:w-4 flex items-center justify-center bg-brand-accent text-inverse text-[8px] sm:text-[10px] rounded-full font-bold shadow-sm">{totalItems}</div>
128
+ )}
129
+ </div>
130
+ </div>
131
+ ) : (
132
+ <>
133
+ {/* Mobile View: Simple Link (No Dropdown) */}
134
+ <div className="h-full flex items-center sm:hidden">
135
+ <LocalizedClientLink
136
+ className="hover:opacity-80 transition-opacity flex items-center"
137
+ href="/cart"
138
+ data-testid="nav-cart-link-mobile"
139
+ >
140
+ <div className="relative">
141
+ <Image
142
+ src="/shopping-bag (3).svg"
143
+ alt="Cart"
144
+ width={26}
145
+ height={26}
146
+ className="w-7 h-7 min-[340px]:w-7 min-[340px]:h-7"
147
+ />
148
+ {totalItems > 0 && (
149
+ <div className="absolute -top-1.5 -right-1.5 h-3.5 w-3.5 flex items-center justify-center bg-brand-accent text-inverse text-[8px] rounded-full font-bold shadow-sm">
150
+ {totalItems}
151
+ </div>
152
+ )}
153
+ </div>
154
+ </LocalizedClientLink>
155
+ </div>
156
+
157
+ {/* Desktop View: Popover Button (Opens Dropdown) */}
158
+ <div className="h-full items-center hidden sm:flex">
159
+ <PopoverButton className="h-full flex items-center focus:outline-none">
160
+ <LocalizedClientLink
161
+ className="hover:opacity-80 transition-opacity flex items-center"
162
+ href="/cart"
163
+ data-testid="nav-cart-link"
164
+ >
165
+ <div className="relative">
166
+ <Image
167
+ src="/shopping-bag (3).svg"
168
+ alt="Cart"
169
+ width={26}
170
+ height={26}
171
+ className="sm:w-6 sm:h-6 lg:w-7 lg:h-7"
172
+ />
173
+ {totalItems > 0 && (
174
+ <div className="absolute -top-1.5 -right-1.5 h-3.5 w-3.5 sm:h-4 sm:w-4 flex items-center justify-center bg-brand-accent text-inverse text-[8px] sm:text-[10px] rounded-full font-bold shadow-sm">
175
+ {totalItems}
176
+ </div>
177
+ )}
178
+ </div>
179
+ </LocalizedClientLink>
180
+ </PopoverButton>
181
+ </div>
182
+ </>
183
+ )}
184
+ <Transition
185
+ show={cartDropdownOpen}
186
+ as={Fragment}
187
+ enter="transition ease-out duration-200"
188
+ enterFrom="opacity-0 translate-y-1"
189
+ enterTo="opacity-100 translate-y-0"
190
+ leave="transition ease-in duration-150"
191
+ leaveFrom="opacity-100 translate-y-0"
192
+ leaveTo="opacity-0 translate-y-1"
193
+ >
194
+ <PopoverPanel
195
+ static
196
+ className="absolute top-[calc(100%+8px)] right-0 w-[320px] sm:w-[380px] md:w-[420px] p-[1.5px] bg-cart-border shadow-brand rounded-2xl overflow-hidden z-[100] sm:block hidden"
197
+ data-testid="nav-cart-dropdown"
198
+ >
199
+ <div className="bg-page-bg/95 backdrop-blur-2xl rounded-[calc(1rem-1.5px)] flex flex-col h-full overflow-hidden text-ui-fg-base">
200
+ <div className="p-4 flex items-center justify-center border-b border-[var(--color-border)]">
201
+ <h3 className="text-lg font-bold text-brand-accent tracking-tight">Bag</h3>
202
+ </div>
203
+ <CartItems cartState={cartState} subtotal={subtotal} close={close} />
204
+ </div>
205
+ </PopoverPanel>
206
+ </Transition>
207
+
208
+ {/* Mobile View Bottom Sheet (Opens for 2 seconds) */}
209
+ <div className="sm:hidden">
210
+ <Transition
211
+ show={cartDropdownOpen}
212
+ as={Fragment}
213
+ enter="transition ease-out duration-300"
214
+ enterFrom="translate-y-full"
215
+ enterTo="translate-y-0"
216
+ leave="transition ease-in duration-200"
217
+ leaveFrom="translate-y-0"
218
+ leaveTo="translate-y-full"
219
+ >
220
+ <div className="fixed inset-x-0 bottom-0 z-[100] pt-3 pb-4 bg-surface shadow-brand rounded-t-[24px] border-t border-brand-accent-border translate-z-0 px-5">
221
+ <div className="flex items-center justify-between px-5 mb-2.5">
222
+ <div className="flex items-center gap-1.5">
223
+ <div className="w-4 h-4 bg-green-500 rounded-full flex items-center justify-center">
224
+ <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
225
+ </div>
226
+ <h3 className="text-[14px] font-black text-heading leading-none">Added to Bag</h3>
227
+ </div>
228
+ <button onClick={close} className="p-1 text-muted hover:text-heading">
229
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
230
+ </button>
231
+ </div>
232
+
233
+ {cartState && cartState.items && cartState.items.length > 0 ? (
234
+ <div className="flex flex-col gap-2.5">
235
+ {(() => {
236
+ const items = cartState?.items || []
237
+ if (items.length === 0) return null
238
+
239
+ const sortedItems = [...items].sort((a: any, b: any) => {
240
+ const dateA = a.updated_at || a.created_at || ""
241
+ const dateB = b.updated_at || b.created_at || ""
242
+ return dateA > dateB ? -1 : 1
243
+ })
244
+
245
+ const lastItem = sortedItems[0]
246
+ if (!lastItem) return null
247
+
248
+ return (
249
+ <div className="flex items-center gap-3 bg-surface-muted p-2.5 border border-[var(--color-border)]">
250
+ <div className="w-12 h-12 flex-shrink-0 overflow-hidden bg-surface border border-[var(--color-border)] shadow-brand-sm">
251
+ <Thumbnail
252
+ thumbnail={lastItem.thumbnail}
253
+ images={lastItem.variant?.product?.images}
254
+ variantImages={lastItem.variant?.images}
255
+ size="square"
256
+ />
257
+ </div>
258
+ <div className="flex-1 min-w-0">
259
+ <h4 className="text-[13px] font-bold text-heading truncate mb-0">{lastItem.title}</h4>
260
+ <div className="text-[10px] text-muted font-bold flex items-center gap-1.5 uppercase tracking-tight">
261
+ <span>Qty: {lastItem.quantity}</span>
262
+ <span className="w-0.5 h-0.5 bg-gray-300 rounded-full" />
263
+ <span className="text-brand-accent">
264
+ <LineItemPrice
265
+ item={lastItem}
266
+ style="tight"
267
+ currencyCode={cartState?.currency_code}
268
+ />
269
+ </span>
270
+ </div>
271
+ </div>
272
+ </div>
273
+ )
274
+ })()}
275
+
276
+ <LocalizedClientLink
277
+ href="/cart"
278
+ className="w-full bg-brand-accent hover:bg-brand-accent-hover border-none h-10 text-[13px] font-black tracking-tight flex items-center justify-center text-inverse shadow-brand-sm"
279
+ onClick={close}
280
+ >
281
+ View Bag & Checkout
282
+ </LocalizedClientLink>
283
+ </div>
284
+ ) : null}
285
+ </div>
286
+ </Transition>
287
+ </div>
288
+ </Popover>
289
+ </div>
290
+ )
291
+ }
292
+
293
+ const CartItems = ({ cartState, subtotal, close }: { cartState: any, subtotal: number, close: () => void }) => {
294
+ return (
295
+ <>
296
+ {cartState && cartState.items?.length ? (
297
+ <>
298
+ <div className="overflow-y-scroll max-h-[402px] px-4 grid grid-cols-1 gap-y-8 no-scrollbar p-px py-4">
299
+ {cartState.items
300
+ .sort((a: any, b: any) => {
301
+ const dateA = a.updated_at || a.created_at || ""
302
+ const dateB = b.updated_at || b.created_at || ""
303
+ return dateA > dateB ? -1 : 1
304
+ })
305
+ .map((item: any) => (
306
+ <div
307
+ className="grid grid-cols-[122px_1fr] gap-x-4"
308
+ key={item.id}
309
+ data-testid="cart-item"
310
+ >
311
+ <LocalizedClientLink
312
+ href={`/products/${item.product_handle}`}
313
+ className="w-24"
314
+ >
315
+ <Thumbnail
316
+ thumbnail={item.thumbnail}
317
+ images={item.variant?.product?.images}
318
+ variantImages={item.variant?.images}
319
+ size="square"
320
+ />
321
+ </LocalizedClientLink>
322
+ <div className="flex flex-col justify-between flex-1">
323
+ <div className="flex flex-col flex-1">
324
+ <div className="flex items-start justify-between">
325
+ <div className="flex flex-col overflow-ellipsis whitespace-nowrap mr-4 w-[180px]">
326
+ <h3 className="text-base-regular overflow-hidden text-ellipsis font-bold">
327
+ <LocalizedClientLink
328
+ href={`/products/${item.product_handle}`}
329
+ data-testid="product-link"
330
+ >
331
+ {item.title}
332
+ </LocalizedClientLink>
333
+ </h3>
334
+ <LineItemOptions
335
+ variant={item.variant}
336
+ data-testid="cart-item-variant"
337
+ data-value={item.variant}
338
+ />
339
+ <span
340
+ data-testid="cart-item-quantity"
341
+ data-value={item.quantity}
342
+ >
343
+ Quantity: {item.quantity}
344
+ </span>
345
+ </div>
346
+ <div className="flex justify-end">
347
+ <LineItemPrice
348
+ item={item}
349
+ style="tight"
350
+ currencyCode={cartState.currency_code}
351
+ />
352
+ </div>
353
+ </div>
354
+ </div>
355
+ <DeleteButton
356
+ id={item.id}
357
+ productId={item.product_id || ""}
358
+ thumbnail={item.thumbnail}
359
+ className="mt-1"
360
+ data-testid="cart-item-remove-button"
361
+ >
362
+ Remove
363
+ </DeleteButton>
364
+ </div>
365
+ </div>
366
+ ))}
367
+ </div>
368
+ <div className="p-4 flex flex-col gap-y-4 text-small-regular bg-surface-muted">
369
+ <div className="flex items-center justify-between">
370
+ <span className="text-ui-fg-base font-semibold">
371
+ Subtotal{" "}
372
+ <span className="font-normal">(excl. taxes)</span>
373
+ </span>
374
+ <span
375
+ className="text-large-semi font-bold"
376
+ data-testid="cart-subtotal"
377
+ data-value={subtotal}
378
+ >
379
+ {convertToLocale({
380
+ amount: subtotal,
381
+ currency_code: cartState.currency_code,
382
+ })}
383
+ </span>
384
+ </div>
385
+ <LocalizedClientLink href="/cart" passHref>
386
+ <Button
387
+ className="w-full bg-brand-accent hover:bg-brand-accent-hover border-none h-12"
388
+ size="large"
389
+ data-testid="go-to-cart-button"
390
+ onClick={close}
391
+ >
392
+ Go to bag
393
+ </Button>
394
+ </LocalizedClientLink>
395
+ </div>
396
+ </>
397
+ ) : (
398
+ <div>
399
+ <div className="flex py-16 flex-col gap-y-4 items-center justify-center">
400
+ <div className="bg-[#8B5AB1] text-small-regular flex items-center justify-center w-6 h-6 rounded-full text-white shadow-sm">
401
+ <span>0</span>
402
+ </div>
403
+ <span className="text-muted font-medium">Your shopping bag is empty.</span>
404
+ <div>
405
+ <LocalizedClientLink href="/store">
406
+ <>
407
+ <span className="sr-only">Go to all products page</span>
408
+ <Button
409
+ onClick={close}
410
+ className="bg-brand-accent hover:bg-brand-accent-hover border-none px-8"
411
+ >
412
+ Explore products
413
+ </Button>
414
+ </>
415
+ </LocalizedClientLink>
416
+ </div>
417
+ </div>
418
+ </div>
419
+ )}
420
+ </>
421
+ )
422
+ }
423
+
424
+ export default CartDropdown
@@ -0,0 +1,57 @@
1
+ "use client"
2
+
3
+ import { transferCart } from "@core/data/customer"
4
+ import { ExclamationCircleSolid } from "@medusajs/icons"
5
+ import { StoreCart, StoreCustomer } from "@medusajs/types"
6
+ import { Button } from "@medusajs/ui"
7
+ import { useState } from "react"
8
+
9
+ function CartMismatchBanner(props: {
10
+ customer: StoreCustomer
11
+ cart: StoreCart
12
+ }) {
13
+ const { customer, cart } = props
14
+ const [isPending, setIsPending] = useState(false)
15
+ const [actionText, setActionText] = useState("Run transfer again")
16
+
17
+ if (!customer || !!cart.customer_id) {
18
+ return
19
+ }
20
+
21
+ const handleSubmit = async () => {
22
+ try {
23
+ setIsPending(true)
24
+ setActionText("Transferring..")
25
+
26
+ await transferCart()
27
+ } catch {
28
+ setActionText("Run transfer again")
29
+ setIsPending(false)
30
+ }
31
+ }
32
+
33
+ return (
34
+ <div className="flex items-center justify-center small:p-4 p-2 text-center bg-orange-300 small:gap-2 gap-1 text-sm mt-2 text-orange-800">
35
+ <div className="flex flex-col small:flex-row small:gap-2 gap-1 items-center">
36
+ <span className="flex items-center gap-1">
37
+ <ExclamationCircleSolid className="inline" />
38
+ Something went wrong when we tried to transfer your cart
39
+ </span>
40
+
41
+ <span>·</span>
42
+
43
+ <Button
44
+ variant="transparent"
45
+ className="hover:bg-transparent active:bg-transparent focus:bg-transparent disabled:text-orange-500 text-orange-950 p-0 bg-transparent"
46
+ size="base"
47
+ disabled={isPending}
48
+ onClick={handleSubmit}
49
+ >
50
+ {actionText}
51
+ </Button>
52
+ </div>
53
+ </div>
54
+ )
55
+ }
56
+
57
+ export default CartMismatchBanner
@@ -0,0 +1,116 @@
1
+ "use client"
2
+
3
+ import { useEffect, useState } from "react"
4
+ import Link from "next/link"
5
+
6
+ const CookieConsent = () => {
7
+ const [isVisible, setIsVisible] = useState(false)
8
+
9
+ useEffect(() => {
10
+ const consent = localStorage.getItem("cookie_consent")
11
+ if (!consent) {
12
+ setIsVisible(true)
13
+ }
14
+ }, [])
15
+
16
+ const acceptConsent = () => {
17
+ localStorage.setItem("cookie_consent", "granted")
18
+
19
+ // GTM Consent Update
20
+ if (typeof window !== "undefined") {
21
+ // @ts-ignore
22
+ if (typeof window.gtag === "function") {
23
+ // @ts-ignore
24
+ window.gtag("consent", "update", {
25
+ ad_storage: "granted",
26
+ analytics_storage: "granted",
27
+ ad_user_data: "granted",
28
+ ad_personalization: "granted",
29
+ })
30
+ // @ts-ignore
31
+ window.gtag("event", "page_view")
32
+ }
33
+
34
+ // @ts-ignore
35
+ window.dataLayer = window.dataLayer || []
36
+ // @ts-ignore
37
+ window.dataLayer.push({
38
+ event: "cookie_accept",
39
+ })
40
+ }
41
+
42
+ setIsVisible(false)
43
+ }
44
+
45
+ const rejectConsent = () => {
46
+ localStorage.setItem("cookie_consent", "denied")
47
+
48
+ if (typeof window !== "undefined") {
49
+ // @ts-ignore
50
+ window.dataLayer = window.dataLayer || []
51
+ // @ts-ignore
52
+ window.dataLayer.push({
53
+ event: "cookie_consent_update",
54
+ ad_storage: "denied",
55
+ analytics_storage: "denied",
56
+ })
57
+ }
58
+
59
+ setIsVisible(false)
60
+ }
61
+
62
+ if (!isVisible) return null
63
+
64
+ return (
65
+ <div
66
+ id="cookie-banner"
67
+ className="fixed bottom-0 left-0 right-0 w-full bg-white/75 backdrop-blur-lg border-t border-gray-200 shadow-lg z-[9999] px-3 py-3 md:px-6 md:py-6"
68
+ >
69
+ <div id="cookie-content" className="max-w-7xl mx-auto">
70
+ <div className="flex flex-col md:flex-row items-center justify-between gap-3 md:gap-6">
71
+ {/* Text */}
72
+ <div className="flex-1 text-center md:text-left min-w-0">
73
+ <p className="text-gray-900 font-semibold text-sm md:text-lg mb-0 md:mb-2">
74
+ We use cookies to enhance your experience.{" "}
75
+ <Link
76
+ href="/privacy-policy"
77
+ className="text-[#8750F6] hover:underline font-semibold md:hidden"
78
+ >
79
+ Read our Privacy Policy
80
+ </Link>
81
+ </p>
82
+
83
+ <p className="text-gray-600 text-xs md:text-sm hidden md:block">
84
+ By clicking "Accept", you consent to our use of cookies.{" "}
85
+ <Link
86
+ href="/privacy-policy"
87
+ className="text-[#8750F6] hover:underline font-semibold"
88
+ >
89
+ Read our Privacy Policy
90
+ </Link>
91
+ </p>
92
+ </div>
93
+
94
+ {/* Buttons */}
95
+ <div className="flex items-center justify-center gap-2 w-full md:w-auto">
96
+ <button
97
+ onClick={rejectConsent}
98
+ className="flex-1 px-4 py-2.5 md:px-6 md:py-3 font-semibold text-sm md:text-base text-gray-700 bg-white border-2 border-gray-300 rounded-lg hover:bg-gray-50 transition-colors"
99
+ >
100
+ Reject
101
+ </button>
102
+
103
+ <button
104
+ onClick={acceptConsent}
105
+ className="flex-1 px-4 py-2.5 md:px-6 md:py-3 font-semibold text-sm md:text-base text-white bg-[#8750F6] rounded-lg hover:opacity-90 transition-opacity"
106
+ >
107
+ Accept
108
+ </button>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ )
114
+ }
115
+
116
+ export default CookieConsent