@riosst100/pwa-marketplace 1.8.9 → 1.9.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/i18n/en_US.json +9 -9
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +15 -1
- package/src/components/AccountLayout/accountlayout.module.css +3 -0
- package/src/components/AccountLayout/index.js +147 -0
- package/src/components/BecomeSeller/becomeSeller.js +304 -178
- package/src/components/BecomeSeller/becomeSeller.module.css +3 -3
- package/src/components/BecomeSellerPage/becomeSellerPage.js +2 -1
- package/src/components/BecomeSellerPage/becomeSellerPage.module.css +2 -10
- package/src/components/LegoSets/legoSets.js +1 -2
- package/src/components/LiveChat/chatContent.js +39 -0
- package/src/components/LiveChat/index.js +52 -0
- package/src/components/LiveChat/liveChat.js +160 -0
- package/src/components/SellerCountry/sellerCountry.js +1 -1
- package/src/components/SellerDetail/sellerDetail.js +34 -3
- package/src/components/ShopBy/shopBy.js +92 -4
- package/src/components/ShopBy/shopBy.module.css +22 -0
- package/src/components/ShopByVehicles/shopByVehicles.js +1 -2
- package/src/components/ShopByVehicles/shopByVehicles.module.css +76 -0
- package/src/components/SocialLogin/img/facebook.svg +3 -0
- package/src/components/SocialLogin/img/google.svg +6 -0
- package/src/components/SocialLogin/img/instagram.svg +27 -0
- package/src/components/SocialLogin/img/wechat.svg +15 -0
- package/src/components/SocialLogin/img/weibo.svg +7 -0
- package/src/components/SocialLogin/index.js +10 -0
- package/src/components/SocialLogin/socialLogin.js +70 -0
- package/src/components/TrainsSets/index.js +2 -0
- package/src/components/TrainsSets/trainsSets.js +331 -0
- package/src/components/TrainsSets/trainsSets.module.css +76 -0
- package/src/components/TrainsSets/trainsSets.shimmer.js +49 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +5 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.gql.js +48 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.js +147 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPageFragment.gql.js +10 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.js +206 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.module.css +40 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.js +107 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/index.js +14 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.js +107 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.module.css +73 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.js +58 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.module.css +31 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Button/button.js +1 -1
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.js +50 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.module.css +11 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.js +238 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.module.css +98 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +178 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +321 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +61 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +103 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.module.css +36 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +103 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +37 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +106 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.module.css +10 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ce.js +7 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +28 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +95 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.module.css +2 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.js +123 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ce.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +60 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.js +210 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.module.css +51 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/shippingSummary.js +58 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/taxSummary.js +57 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/editModal.js +41 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.js +80 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.js +153 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.module.css +13 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.js +271 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.module.css +156 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.js +94 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.module.css +11 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/quantity.js +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.js +126 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.module.css +64 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.js +190 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.module.css +78 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.js +125 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.module.css +94 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.js +213 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.module.css +36 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +93 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.module.css +55 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +102 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.js +54 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.module.css +60 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.js +84 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.module.css +20 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.js +38 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.module.css +28 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +213 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.module.css +24 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +162 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.js +34 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.module.css +17 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +196 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeDropin.module.css +26 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +160 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.module.css +62 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.js +348 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.module.css +58 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.js +44 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.module.css +5 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editModal.js +88 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editablePaymentCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +99 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.module.css +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.js +121 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.module.css +34 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.js +71 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.module.css +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summaryPaymentCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +63 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.module.css +2 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/addressForm.js +18 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +401 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.module.css +58 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +455 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/index.js +3 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.js +66 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.module.css +12 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.js +65 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.module.css +90 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +149 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.module.css +88 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.js +114 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.module.css +48 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +154 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.module.css +27 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.js +80 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.module.css +22 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.js +85 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.js +472 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.module.css +186 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.js +323 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.js +48 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.module.css +21 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/dialog.js +198 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/dialog.module.css +189 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +8 -7
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +12 -4
- package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +2 -2
- package/src/overwrites/venia-ui/lib/components/Header/header.js +37 -2
- package/src/overwrites/venia-ui/lib/components/Main/main.js +1 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.js +3 -2
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +1 -1
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +22 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.js +143 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.module.css +53 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.js +42 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.js +38 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.module.css +5 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +71 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.js +121 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.module.css +35 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.js +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.module.css +16 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.js +207 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.module.css +102 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.js +159 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.module.css +50 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +45 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.module.css +14 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +90 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +86 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.module.css +19 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js +63 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.module.css +16 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/index.js +15 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +227 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.js +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.module.css +14 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +324 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.module.css +146 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/resetButton.js +41 -0
- package/src/overwrites/venia-ui/lib/components/Password/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Password/password.js +102 -0
- package/src/overwrites/venia-ui/lib/components/Password/password.module.css +26 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +29 -14
- package/src/overwrites/venia-ui/lib/components/Select/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Select/option.js +28 -0
- package/src/overwrites/venia-ui/lib/components/Select/select.js +74 -0
- package/src/overwrites/venia-ui/lib/components/Select/select.module.css +25 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.gql.js +50 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.js +224 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.module.css +65 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.js +50 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.module.css +17 -0
- package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +1 -1
- package/src/talons/Header/logo.gql.js +19 -0
- package/src/talons/Header/useLogo.js +19 -0
- package/src/talons/ShopBy/shopBy.gql.js +2 -2
- package/src/talons/ShopBy/useShopBy.js +10 -9
- package/src/talons/ShopByVehicles/shopByVehicles.gql.js +1 -0
- package/src/talons/TrainsSets/trainsSets.gql.js +60 -0
- package/src/talons/TrainsSets/useTrainsSets.js +223 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
3
|
+
import { Form } from 'informed';
|
|
4
|
+
import { func, shape, string } from 'prop-types';
|
|
5
|
+
import { useShippingForm } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/ShippingMethods/useShippingForm';
|
|
6
|
+
|
|
7
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
8
|
+
import { isRequired } from '@magento/venia-ui/lib/util/formValidators';
|
|
9
|
+
import Button from '@magento/venia-ui/lib/components/Button';
|
|
10
|
+
|
|
11
|
+
import Country from '@magento/venia-ui/lib/components/Country';
|
|
12
|
+
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
13
|
+
import Region from '@magento/venia-ui/lib/components/Region';
|
|
14
|
+
import Postcode from '@magento/venia-ui/lib/components/Postcode';
|
|
15
|
+
import defaultClasses from './shippingForm.module.css';
|
|
16
|
+
|
|
17
|
+
const ShippingForm = props => {
|
|
18
|
+
const { hasMethods, selectedShippingFields, setIsCartUpdating } = props;
|
|
19
|
+
const talonProps = useShippingForm({
|
|
20
|
+
selectedValues: selectedShippingFields,
|
|
21
|
+
setIsCartUpdating
|
|
22
|
+
});
|
|
23
|
+
const {
|
|
24
|
+
errors,
|
|
25
|
+
handleOnSubmit,
|
|
26
|
+
handleZipChange,
|
|
27
|
+
handleOnSubmitKeyPress,
|
|
28
|
+
isSetShippingLoading
|
|
29
|
+
} = talonProps;
|
|
30
|
+
const { formatMessage } = useIntl();
|
|
31
|
+
|
|
32
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
33
|
+
|
|
34
|
+
const shippingStatusMessage = isSetShippingLoading
|
|
35
|
+
? formatMessage({
|
|
36
|
+
id: 'shippingForm.loading',
|
|
37
|
+
defaultMessage: 'Loading Methods...'
|
|
38
|
+
})
|
|
39
|
+
: formatMessage({
|
|
40
|
+
id: 'shippingForm.getShippingOptions',
|
|
41
|
+
defaultMessage: 'Get Shipping Options'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Fragment>
|
|
46
|
+
<h3 className={classes.formTitle}>
|
|
47
|
+
<FormattedMessage
|
|
48
|
+
id={'shippingForm.formTitle'}
|
|
49
|
+
defaultMessage={'Destination'}
|
|
50
|
+
/>
|
|
51
|
+
</h3>
|
|
52
|
+
<FormError errors={Array.from(errors.values)} />
|
|
53
|
+
<Form
|
|
54
|
+
className={classes.root}
|
|
55
|
+
initialValues={selectedShippingFields}
|
|
56
|
+
onSubmit={handleOnSubmit}
|
|
57
|
+
>
|
|
58
|
+
<Country
|
|
59
|
+
data-cy="ShippingMethods-ShippingForm-country"
|
|
60
|
+
validate={isRequired}
|
|
61
|
+
/>
|
|
62
|
+
<Region
|
|
63
|
+
data-cy="ShippingMethods-ShippingForm-region"
|
|
64
|
+
validate={isRequired}
|
|
65
|
+
/>
|
|
66
|
+
<Postcode
|
|
67
|
+
fieldInput="zip"
|
|
68
|
+
data-cy="ShippingMethods-ShippingForm-postCode"
|
|
69
|
+
validate={isRequired}
|
|
70
|
+
onValueChange={handleZipChange}
|
|
71
|
+
/>
|
|
72
|
+
{!hasMethods ? (
|
|
73
|
+
<Button
|
|
74
|
+
classes={{
|
|
75
|
+
root_normalPriority: classes.submit
|
|
76
|
+
}}
|
|
77
|
+
data-cy="ShippingMethods-ShippingForm-submit"
|
|
78
|
+
disabled={isSetShippingLoading}
|
|
79
|
+
priority="normal"
|
|
80
|
+
type="submit"
|
|
81
|
+
onKeyDown={handleOnSubmitKeyPress}
|
|
82
|
+
>
|
|
83
|
+
{shippingStatusMessage}
|
|
84
|
+
</Button>
|
|
85
|
+
) : null}
|
|
86
|
+
</Form>
|
|
87
|
+
</Fragment>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default ShippingForm;
|
|
92
|
+
|
|
93
|
+
ShippingForm.propTypes = {
|
|
94
|
+
classes: shape({
|
|
95
|
+
zip: string
|
|
96
|
+
}),
|
|
97
|
+
selectedShippingFields: shape({
|
|
98
|
+
country: string.isRequired,
|
|
99
|
+
region: string.isRequired,
|
|
100
|
+
zip: string.isRequired
|
|
101
|
+
}),
|
|
102
|
+
setIsFetchingMethods: func
|
|
103
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: gap-x-xs from global;
|
|
3
|
+
composes: gap-y-sm from global;
|
|
4
|
+
composes: grid from global;
|
|
5
|
+
grid-template-columns: 2fr 1fr;
|
|
6
|
+
grid-template-areas:
|
|
7
|
+
'country country'
|
|
8
|
+
'state zip'
|
|
9
|
+
'submit submit';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.formTitle {
|
|
13
|
+
composes: font-semibold from global;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.zip {
|
|
17
|
+
grid-area: zip;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.submit {
|
|
21
|
+
composes: root_normalPriority from '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
22
|
+
|
|
23
|
+
composes: justify-self-start from global;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (max-width: 639px) {
|
|
27
|
+
.root {
|
|
28
|
+
/* Only one column in mobile view. */
|
|
29
|
+
grid-template-columns: 100%;
|
|
30
|
+
grid-template-areas:
|
|
31
|
+
'country'
|
|
32
|
+
'state'
|
|
33
|
+
'zip'
|
|
34
|
+
'submit';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import { Form } from 'informed';
|
|
4
|
+
import { useShippingMethods } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/ShippingMethods/useShippingMethods';
|
|
5
|
+
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import Button from '@magento/venia-ui/lib/components/Button';
|
|
8
|
+
import ShippingForm from './shippingForm';
|
|
9
|
+
import defaultClasses from './shippingMethods.module.css';
|
|
10
|
+
import ShippingRadios from './shippingRadios';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A child component of the PriceAdjustments component.
|
|
14
|
+
* This component renders the form for adding the shipping method for the cart.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} props
|
|
17
|
+
* @param {Function} props.setIsCartUpdating Function for setting the updating state of the cart.
|
|
18
|
+
* @param {Object} props.classes CSS className overrides.
|
|
19
|
+
* See [shippingMethods.module.css]{@link https://github.com/magento/pwa-studio/blob/develop/packages/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.module.css}
|
|
20
|
+
* for a list of classes you can override.
|
|
21
|
+
*
|
|
22
|
+
* @returns {React.Element}
|
|
23
|
+
*
|
|
24
|
+
* @example <caption>Importing into your project</caption>
|
|
25
|
+
* import ShippingMethods from "@magento/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods";
|
|
26
|
+
*/
|
|
27
|
+
const ShippingMethods = props => {
|
|
28
|
+
const { setIsCartUpdating } = props;
|
|
29
|
+
const {
|
|
30
|
+
hasMethods,
|
|
31
|
+
isShowingForm,
|
|
32
|
+
selectedShippingFields,
|
|
33
|
+
selectedShippingMethod,
|
|
34
|
+
shippingMethods,
|
|
35
|
+
showForm,
|
|
36
|
+
showFormOnEnter
|
|
37
|
+
} = useShippingMethods();
|
|
38
|
+
|
|
39
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
40
|
+
|
|
41
|
+
const radios =
|
|
42
|
+
isShowingForm && hasMethods ? (
|
|
43
|
+
<Fragment>
|
|
44
|
+
<h3 className={classes.prompt}>
|
|
45
|
+
<FormattedMessage
|
|
46
|
+
id={'shippingMethods.prompt'}
|
|
47
|
+
defaultMessage={'Shipping Methods'}
|
|
48
|
+
/>
|
|
49
|
+
</h3>
|
|
50
|
+
<Form>
|
|
51
|
+
<ShippingRadios
|
|
52
|
+
selectedShippingMethod={selectedShippingMethod}
|
|
53
|
+
setIsCartUpdating={setIsCartUpdating}
|
|
54
|
+
shippingMethods={shippingMethods}
|
|
55
|
+
/>
|
|
56
|
+
</Form>
|
|
57
|
+
</Fragment>
|
|
58
|
+
) : null;
|
|
59
|
+
|
|
60
|
+
const formOrPlaceholder = isShowingForm ? (
|
|
61
|
+
<Fragment>
|
|
62
|
+
<ShippingForm
|
|
63
|
+
hasMethods={hasMethods}
|
|
64
|
+
selectedShippingFields={selectedShippingFields}
|
|
65
|
+
setIsCartUpdating={setIsCartUpdating}
|
|
66
|
+
/>
|
|
67
|
+
{radios}
|
|
68
|
+
</Fragment>
|
|
69
|
+
) : (
|
|
70
|
+
<Button
|
|
71
|
+
priority="normal"
|
|
72
|
+
type="button"
|
|
73
|
+
classes={{
|
|
74
|
+
root_normalPriority: classes.estimateButton,
|
|
75
|
+
content: 'gap-1.5 grid-flow-col inline-grid items-center justify-center justify-items-center capitalize font-medium'
|
|
76
|
+
}}
|
|
77
|
+
data-cy="ShippingMethods-estimateButton"
|
|
78
|
+
onClick={showForm}
|
|
79
|
+
onKeyDown={showFormOnEnter}
|
|
80
|
+
>
|
|
81
|
+
<FormattedMessage
|
|
82
|
+
id={'shippingMethods.estimateButton'}
|
|
83
|
+
defaultMessage={'I want to estimate my shipping'}
|
|
84
|
+
/>
|
|
85
|
+
</Button>
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div className={classes.root} data-cy="ShippingMethods-root">
|
|
90
|
+
<p className={classes.message}>
|
|
91
|
+
<FormattedMessage
|
|
92
|
+
id={'shippingMethods.message'}
|
|
93
|
+
defaultMessage={
|
|
94
|
+
'For shipping estimates before proceeding to checkout, please provide the Country, State, and ZIP for the destination of your order.'
|
|
95
|
+
}
|
|
96
|
+
/>
|
|
97
|
+
</p>
|
|
98
|
+
{formOrPlaceholder}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default ShippingMethods;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: gap-xs from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.message {
|
|
7
|
+
composes: leading-normal from global;
|
|
8
|
+
composes: text-sm from global;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.prompt {
|
|
12
|
+
composes: font-semibold from global;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.shipping_methods {
|
|
16
|
+
grid-area: methods;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.shipping_methods_hidden {
|
|
20
|
+
composes: shipping_methods;
|
|
21
|
+
composes: hidden from global;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.mask {
|
|
25
|
+
composes: opacity-50 from global;
|
|
26
|
+
composes: pointer-events-none from global;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.estimateButton {
|
|
30
|
+
composes: root_normalPriority from '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
31
|
+
|
|
32
|
+
composes: justify-self-start from global;
|
|
33
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import { number, string, shape } from 'prop-types';
|
|
4
|
+
import Price from '@magento/venia-ui/lib/components/Price';
|
|
5
|
+
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import defaultClasses from './shippingRadio.module.css';
|
|
8
|
+
|
|
9
|
+
const ShippingRadio = props => {
|
|
10
|
+
const priceElement = props.price ? (
|
|
11
|
+
<Price value={props.price} currencyCode={props.currency} />
|
|
12
|
+
) : (
|
|
13
|
+
<span>
|
|
14
|
+
<FormattedMessage id={'global.free'} defaultMessage={'FREE'} />
|
|
15
|
+
</span>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Fragment>
|
|
22
|
+
<span data-cy="ShippingRadio-name">{props.name}</span>
|
|
23
|
+
<div className={classes.price}>{priceElement}</div>
|
|
24
|
+
</Fragment>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default ShippingRadio;
|
|
29
|
+
|
|
30
|
+
ShippingRadio.propTypes = {
|
|
31
|
+
classes: shape({
|
|
32
|
+
price: string
|
|
33
|
+
}),
|
|
34
|
+
currency: string.isRequired,
|
|
35
|
+
name: string.isRequired,
|
|
36
|
+
price: number.isRequired
|
|
37
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { gql } from '@apollo/client';
|
|
3
|
+
import { arrayOf, number, shape, string } from 'prop-types';
|
|
4
|
+
import { useShippingRadios } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/ShippingMethods/useShippingRadios';
|
|
5
|
+
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import RadioGroup from '@magento/venia-ui/lib/components/RadioGroup';
|
|
8
|
+
import { CartPageFragment } from '@magento/peregrine/lib/talons/CartPage/cartPageFragments.gql.js';
|
|
9
|
+
import ShippingRadio from './shippingRadio';
|
|
10
|
+
import defaultClasses from './shippingRadios.module.css';
|
|
11
|
+
import { SelectedShippingMethodCartFragment } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/ShippingMethods/shippingMethodsFragments.gql.js';
|
|
12
|
+
|
|
13
|
+
const ShippingRadios = props => {
|
|
14
|
+
const {
|
|
15
|
+
setIsCartUpdating,
|
|
16
|
+
selectedShippingMethod,
|
|
17
|
+
shippingMethods
|
|
18
|
+
} = props;
|
|
19
|
+
const {
|
|
20
|
+
formattedShippingMethods,
|
|
21
|
+
handleShippingSelection
|
|
22
|
+
} = useShippingRadios({
|
|
23
|
+
setIsCartUpdating,
|
|
24
|
+
selectedShippingMethod,
|
|
25
|
+
shippingMethods,
|
|
26
|
+
mutations: {
|
|
27
|
+
setShippingMethodMutation: SET_SHIPPING_METHOD_MUTATION
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const radioComponents = formattedShippingMethods.map(shippingMethod => {
|
|
31
|
+
return {
|
|
32
|
+
label: (
|
|
33
|
+
<ShippingRadio
|
|
34
|
+
currency={shippingMethod.amount.currency}
|
|
35
|
+
name={shippingMethod.method_title}
|
|
36
|
+
price={shippingMethod.amount.value}
|
|
37
|
+
/>
|
|
38
|
+
),
|
|
39
|
+
value: shippingMethod.serializedValue
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
44
|
+
const radioGroupClasses = {
|
|
45
|
+
radioLabel: classes.radioContents,
|
|
46
|
+
root: classes.radioRoot
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<RadioGroup
|
|
51
|
+
classes={radioGroupClasses}
|
|
52
|
+
field="method"
|
|
53
|
+
initialValue={selectedShippingMethod}
|
|
54
|
+
items={radioComponents}
|
|
55
|
+
onValueChange={handleShippingSelection}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default ShippingRadios;
|
|
61
|
+
|
|
62
|
+
export const SET_SHIPPING_METHOD_MUTATION = gql`
|
|
63
|
+
mutation SetShippingMethodForEstimate(
|
|
64
|
+
$cartId: String!
|
|
65
|
+
$shippingMethod: ShippingMethodInput!
|
|
66
|
+
) {
|
|
67
|
+
setShippingMethodsOnCart(
|
|
68
|
+
input: { cart_id: $cartId, shipping_methods: [$shippingMethod] }
|
|
69
|
+
) {
|
|
70
|
+
cart {
|
|
71
|
+
id
|
|
72
|
+
# If this mutation causes "free" to become available we need to know.
|
|
73
|
+
available_payment_methods {
|
|
74
|
+
code
|
|
75
|
+
title
|
|
76
|
+
}
|
|
77
|
+
...CartPageFragment
|
|
78
|
+
...SelectedShippingMethodCartFragment
|
|
79
|
+
# Intentionally do not re-fetch available shipping methods because
|
|
80
|
+
# a) they are wrong in the mutation response
|
|
81
|
+
# b) it is expensive to recalculate.
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
${CartPageFragment}
|
|
86
|
+
${SelectedShippingMethodCartFragment}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
ShippingRadios.propTypes = {
|
|
90
|
+
classes: shape({
|
|
91
|
+
radioContents: string,
|
|
92
|
+
radioRoot: string
|
|
93
|
+
}),
|
|
94
|
+
selectedShippingMethod: string,
|
|
95
|
+
shippingMethods: arrayOf(
|
|
96
|
+
shape({
|
|
97
|
+
amount: shape({
|
|
98
|
+
currency: string.isRequired,
|
|
99
|
+
value: number.isRequired
|
|
100
|
+
}),
|
|
101
|
+
carrier_code: string.isRequired,
|
|
102
|
+
method_code: string.isRequired,
|
|
103
|
+
method_title: string.isRequired
|
|
104
|
+
})
|
|
105
|
+
)
|
|
106
|
+
};
|
package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
|
|
5
|
+
import { Section } from '@magento/venia-ui/lib/components/Accordion';
|
|
6
|
+
|
|
7
|
+
const GiftCards = React.lazy(() => import('../GiftCards'));
|
|
8
|
+
|
|
9
|
+
const GiftCardSection = props => {
|
|
10
|
+
const { setIsCartUpdating } = props;
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
return (
|
|
13
|
+
<Section
|
|
14
|
+
id={'gift_card'}
|
|
15
|
+
data-cy="PriceAdjustments-giftCardSection"
|
|
16
|
+
title={formatMessage({
|
|
17
|
+
id: 'giftCardSection.giftCard',
|
|
18
|
+
defaultMessage: 'Apply Gift Card'
|
|
19
|
+
})}
|
|
20
|
+
>
|
|
21
|
+
<Suspense fallback={<LoadingIndicator />}>
|
|
22
|
+
<GiftCards setIsCartUpdating={setIsCartUpdating} />
|
|
23
|
+
</Suspense>
|
|
24
|
+
</Section>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default GiftCardSection;
|
package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
|
|
5
|
+
import { Section } from '@magento/venia-ui/lib/components/Accordion';
|
|
6
|
+
import { useGiftOptionsSection } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/useGiftOptionsSection';
|
|
7
|
+
|
|
8
|
+
const GiftOptions = React.lazy(() => import('./GiftOptions'));
|
|
9
|
+
|
|
10
|
+
const GiftOptionsSection = () => {
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
const {
|
|
13
|
+
giftOptionsConfigData,
|
|
14
|
+
isLoading,
|
|
15
|
+
isVisible
|
|
16
|
+
} = useGiftOptionsSection();
|
|
17
|
+
|
|
18
|
+
if (isLoading || !isVisible) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Section
|
|
24
|
+
id={'gift_options'}
|
|
25
|
+
data-cy="PriceAdjustments-giftOptionsSection"
|
|
26
|
+
title={formatMessage({
|
|
27
|
+
id: 'priceAdjustments.giftOptions',
|
|
28
|
+
defaultMessage: 'See Gift Options'
|
|
29
|
+
})}
|
|
30
|
+
>
|
|
31
|
+
<Suspense fallback={<LoadingIndicator />}>
|
|
32
|
+
<GiftOptions giftOptionsConfigData={giftOptionsConfigData} />
|
|
33
|
+
</Suspense>
|
|
34
|
+
</Section>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default GiftOptionsSection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './priceAdjustments';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { func } from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import { Accordion, Section } from '@magento/venia-ui/lib/components/Accordion';
|
|
8
|
+
import GiftCardSection from './giftCardSection';
|
|
9
|
+
import GiftOptionsSection from './giftOptionsSection';
|
|
10
|
+
import defaultClasses from './priceAdjustments.module.css';
|
|
11
|
+
import cn from 'classnames';
|
|
12
|
+
|
|
13
|
+
const CouponCode = React.lazy(() => import('./CouponCode'));
|
|
14
|
+
const ShippingMethods = React.lazy(() => import('./ShippingMethods'));
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* PriceAdjustments is a child component of the CartPage component.
|
|
18
|
+
* It renders the price adjustments forms for applying gift cards, coupons, and the shipping method.
|
|
19
|
+
* All of which can adjust the cart total.
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} props
|
|
22
|
+
* @param {Function} props.setIsCartUpdating A callback function for setting the updating state of the cart.
|
|
23
|
+
* @param {Object} props.classes CSS className overrides.
|
|
24
|
+
* See [priceAdjustments.module.css]{@link https://github.com/magento/pwa-studio/blob/develop/packages/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.module.css}
|
|
25
|
+
* for a list of classes you can override.
|
|
26
|
+
*
|
|
27
|
+
* @returns {React.Element}
|
|
28
|
+
*
|
|
29
|
+
* @example <caption>Importing into your project</caption>
|
|
30
|
+
* import PriceAdjustments from '@magento/venia-ui/lib/components/CartPage/PriceAdjustments'
|
|
31
|
+
*/
|
|
32
|
+
const PriceAdjustments = props => {
|
|
33
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
34
|
+
|
|
35
|
+
const { setIsCartUpdating } = props;
|
|
36
|
+
const { formatMessage } = useIntl();
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className={classes.root} data-cy="PriceAdjustments-root">
|
|
40
|
+
<Accordion
|
|
41
|
+
canOpenMultiple={true}
|
|
42
|
+
classes={{
|
|
43
|
+
root: cn('border-none flex flex-col gap-4')
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<Section
|
|
47
|
+
id={'shipping_method'}
|
|
48
|
+
data-cy="PriceAdjustments-shippingMethodSection"
|
|
49
|
+
title={formatMessage({
|
|
50
|
+
id: 'priceAdjustments.shippingMethod',
|
|
51
|
+
defaultMessage: 'Estimate your Shipping'
|
|
52
|
+
})}
|
|
53
|
+
classes={{
|
|
54
|
+
root: cn('border border-gray-100 rounded-md max-w-[400px] p-2.5'),
|
|
55
|
+
title: 'text-[16px] font-medium',
|
|
56
|
+
title_wrapper: 'gap-sm grid grid-cols-1 grid-flow-col h-[38px] items-center justify-items-start',
|
|
57
|
+
contents_container: 'p-0'
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
<Suspense fallback={<LoadingIndicator />}>
|
|
61
|
+
<ShippingMethods
|
|
62
|
+
setIsCartUpdating={setIsCartUpdating}
|
|
63
|
+
/>
|
|
64
|
+
</Suspense>
|
|
65
|
+
</Section>
|
|
66
|
+
<Section
|
|
67
|
+
id={'coupon_code'}
|
|
68
|
+
data-cy="PriceAdjustments-couponCodeSection"
|
|
69
|
+
title={formatMessage({
|
|
70
|
+
id: 'priceAdjustments.couponCode',
|
|
71
|
+
defaultMessage: 'Enter Coupon Code'
|
|
72
|
+
})}
|
|
73
|
+
classes={{
|
|
74
|
+
root: cn('border border-gray-100 rounded-md max-w-[400px] p-2.5'),
|
|
75
|
+
title: 'text-[16px] font-medium',
|
|
76
|
+
title_wrapper: 'gap-sm grid grid-cols-1 grid-flow-col h-[38px] items-center justify-items-start',
|
|
77
|
+
contents_container: 'p-0'
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<Suspense fallback={<LoadingIndicator />}>
|
|
81
|
+
<CouponCode setIsCartUpdating={setIsCartUpdating} />
|
|
82
|
+
</Suspense>
|
|
83
|
+
</Section>
|
|
84
|
+
<GiftCardSection setIsCartUpdating={setIsCartUpdating} />
|
|
85
|
+
<GiftOptionsSection />
|
|
86
|
+
</Accordion>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default PriceAdjustments;
|
|
92
|
+
|
|
93
|
+
PriceAdjustments.propTypes = {
|
|
94
|
+
setIsCartUpdating: func
|
|
95
|
+
};
|