@magento/venia-ui 9.1.0-alpha.1 → 9.2.0-alpha.2

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 (290) hide show
  1. package/i18n/en_US.json +22 -7
  2. package/lib/RootComponents/CMS/__tests__/cms.spec.js +50 -20
  3. package/lib/RootComponents/CMS/cms.js +39 -43
  4. package/lib/RootComponents/CMS/cms.module.css +17 -14
  5. package/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +1 -1
  6. package/lib/RootComponents/Category/__tests__/__snapshots__/category.spec.js.snap +2 -2
  7. package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.spec.js.snap +60 -0
  8. package/lib/RootComponents/Category/__tests__/category.spec.js +1 -1
  9. package/lib/RootComponents/Category/__tests__/categoryContent.spec.js +8 -0
  10. package/lib/RootComponents/Category/category.gql.js +2 -1
  11. package/lib/RootComponents/Category/category.js +6 -6
  12. package/lib/RootComponents/Category/categoryContent.js +11 -4
  13. package/lib/components/Accordion/section.js +6 -2
  14. package/lib/components/AccountChip/accountChip.gql.js +1 -1
  15. package/lib/components/AccountInformationPage/accountInformationPage.gql.js +5 -7
  16. package/lib/components/AccountInformationPage/accountInformationPage.js +5 -1
  17. package/lib/components/AccountInformationPage/editForm.js +22 -4
  18. package/lib/components/AccountMenu/accountMenu.js +1 -1
  19. package/lib/components/AccountMenu/accountMenuItems.js +2 -1
  20. package/lib/components/AddressBookPage/__tests__/__snapshots__/addressCard.spec.js.snap +5 -0
  21. package/lib/components/AddressBookPage/addEditDialog.js +36 -10
  22. package/lib/components/AddressBookPage/addressBookPage.js +5 -2
  23. package/lib/components/AddressBookPage/addressCard.js +17 -4
  24. package/lib/components/App/app.js +5 -1
  25. package/lib/components/App/localeProvider.js +2 -1
  26. package/lib/components/Breadcrumbs/breadcrumbs.js +3 -3
  27. package/lib/components/Breadcrumbs/breadcrumbs.module.css +10 -3
  28. package/lib/components/CartPage/GiftCards/giftCard.js +1 -0
  29. package/lib/components/CartPage/GiftCards/giftCards.js +2 -0
  30. package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +3 -0
  31. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +3 -0
  32. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +10 -2
  33. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +2 -1
  34. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +1 -1
  35. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +1 -1
  36. package/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +1 -0
  37. package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +4 -1
  38. package/lib/components/CartPage/PriceSummary/discountSummary.js +8 -2
  39. package/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +4 -1
  40. package/lib/components/CartPage/PriceSummary/priceSummary.js +10 -3
  41. package/lib/components/CartPage/PriceSummary/shippingSummary.js +6 -1
  42. package/lib/components/CartPage/PriceSummary/taxSummary.js +1 -1
  43. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +3 -3
  44. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +2 -2
  45. package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +1 -1
  46. package/lib/components/CartPage/ProductListing/__tests__/__snapshots__/errorMessage.spec.js.snap +11 -0
  47. package/lib/components/CartPage/ProductListing/__tests__/errorMessage.spec.js +20 -0
  48. package/lib/components/CartPage/ProductListing/__tests__/product.spec.js +1 -0
  49. package/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
  50. package/lib/components/CartPage/ProductListing/errorMessage.module.css +9 -0
  51. package/lib/components/CartPage/ProductListing/product.js +14 -7
  52. package/lib/components/CartPage/ProductListing/productListing.js +6 -1
  53. package/lib/components/CartPage/ProductListing/productListing.module.css +6 -0
  54. package/lib/components/CartPage/ProductListing/quantity.js +3 -0
  55. package/lib/components/CartPage/cartPage.js +1 -1
  56. package/lib/components/CategoryList/__tests__/categoryList.spec.js +2 -0
  57. package/lib/components/CategoryList/categoryList.js +4 -2
  58. package/lib/components/CategoryList/categoryList.module.css +2 -0
  59. package/lib/components/CategoryList/categoryTile.js +2 -0
  60. package/lib/components/CategoryList/categoryTile.module.css +2 -0
  61. package/lib/components/CategoryList/index.js +2 -0
  62. package/lib/components/CategoryTree/categoryBranch.js +2 -1
  63. package/lib/components/CategoryTree/categoryLeaf.js +1 -0
  64. package/lib/components/CategoryTree/categoryTree.js +3 -3
  65. package/lib/components/Checkbox/checkbox.module.css +11 -3
  66. package/lib/components/Checkout/addressForm.js +2 -3
  67. package/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +6 -2
  68. package/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +12 -12
  69. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
  70. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +3 -3
  71. package/lib/components/CheckoutPage/ItemsReview/item.js +1 -1
  72. package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
  73. package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/orderConfirmationPage.spec.js.snap +1 -1
  74. package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +6 -0
  75. package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +10 -4
  76. package/lib/components/CheckoutPage/OrderSummary/orderSummary.js +1 -1
  77. package/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +2 -1
  78. package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +11 -1
  79. package/lib/components/CheckoutPage/PaymentInformation/editCard.js +1 -1
  80. package/lib/components/CheckoutPage/PaymentInformation/editModal.js +1 -1
  81. package/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +1 -1
  82. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/guestForm.spec.js.snap +8 -0
  83. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/guestForm.spec.js +56 -1
  84. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +27 -4
  85. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +96 -9
  86. package/lib/components/CheckoutPage/ShippingInformation/card.js +1 -1
  87. package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +14 -3
  88. package/lib/components/CheckoutPage/ShippingMethod/completedView.js +1 -0
  89. package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +2 -1
  90. package/lib/components/CheckoutPage/ShippingMethod/updateModal.js +1 -0
  91. package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +32 -0
  92. package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +2 -0
  93. package/lib/components/CheckoutPage/checkoutPage.js +26 -4
  94. package/lib/components/ContactPage/__tests__/__snapshots__/contactLink.spec.js.snap +11 -0
  95. package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.shimmer.spec.js.snap +113 -0
  96. package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.spec.js.snap +312 -0
  97. package/lib/components/ContactPage/__tests__/contactLink.spec.js +58 -0
  98. package/lib/components/ContactPage/__tests__/contactPage.shimmer.spec.js +20 -0
  99. package/lib/components/ContactPage/__tests__/contactPage.spec.js +159 -0
  100. package/lib/components/ContactPage/contactLink.js +21 -0
  101. package/lib/components/ContactPage/contactPage.js +270 -0
  102. package/lib/components/ContactPage/contactPage.module.css +81 -0
  103. package/lib/components/ContactPage/contactPage.shimmer.js +104 -0
  104. package/lib/components/ContactPage/contactPage.shimmer.module.css +27 -0
  105. package/lib/components/ContactPage/index.js +2 -0
  106. package/lib/components/CreateAccount/createAccount.js +5 -0
  107. package/lib/components/Dialog/dialog.js +18 -4
  108. package/lib/components/ErrorMessage/errorMessage.js +7 -2
  109. package/lib/components/ErrorView/errorView.js +4 -2
  110. package/lib/components/Field/field.module.css +10 -6
  111. package/lib/components/FilterModal/CurrentFilters/currentFilter.js +7 -3
  112. package/lib/components/FilterModal/FilterList/__tests__/filterItem.spec.js +34 -5
  113. package/lib/components/FilterModal/FilterList/filterDefault.js +3 -2
  114. package/lib/components/FilterModal/FilterList/filterItem.js +27 -7
  115. package/lib/components/FilterModal/FilterList/filterList.js +6 -1
  116. package/lib/components/FilterModal/filterBlock.js +9 -4
  117. package/lib/components/FilterModal/filterFooter.js +1 -0
  118. package/lib/components/FilterModal/filterModal.js +6 -1
  119. package/lib/components/FilterModalOpenButton/filterModalOpenButton.js +1 -0
  120. package/lib/components/FilterSidebar/filterSidebar.js +6 -1
  121. package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +14 -0
  122. package/lib/components/Footer/__tests__/footer.spec.js +9 -1
  123. package/lib/components/Footer/footer.js +14 -7
  124. package/lib/components/Footer/sampleData.js +8 -3
  125. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +3 -0
  126. package/lib/components/ForgotPassword/FormSubmissionSuccessful/formSubmissionSuccessful.js +4 -2
  127. package/lib/components/ForgotPassword/forgotPassword.gql.js +0 -1
  128. package/lib/components/FormError/formError.js +10 -4
  129. package/lib/components/Gallery/__tests__/__snapshots__/addToCartButton.spec.js.snap +0 -3
  130. package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +1 -0
  131. package/lib/components/Gallery/addToCartButton.js +27 -22
  132. package/lib/components/Gallery/item.js +16 -4
  133. package/lib/components/Gallery/item.module.css +1 -0
  134. package/lib/components/Head/index.js +2 -1
  135. package/lib/components/Header/__tests__/header.spec.js +1 -1
  136. package/lib/components/Header/accountTrigger.js +1 -0
  137. package/lib/components/Header/cartTrigger.js +4 -1
  138. package/lib/components/Header/header.js +1 -1
  139. package/lib/components/Header/navTrigger.js +1 -0
  140. package/lib/components/Header/searchTrigger.js +1 -0
  141. package/lib/components/LegacyMiniCart/cartOptions.gql.js +4 -3
  142. package/lib/components/LegacyMiniCart/editFormFragment.gql.js +7 -3
  143. package/lib/components/LegacyMiniCart/kebab.js +1 -0
  144. package/lib/components/LegacyMiniCart/productOptions.js +6 -1
  145. package/lib/components/LegacyMiniCart/section.js +15 -5
  146. package/lib/components/Link/link.js +6 -4
  147. package/lib/components/Mask/mask.js +3 -3
  148. package/lib/components/MegaMenu/__tests__/MegaMenuItem.spec.js +1 -0
  149. package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +9 -0
  150. package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +6 -0
  151. package/lib/components/MegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +2 -0
  152. package/lib/components/MegaMenu/megaMenu.js +6 -2
  153. package/lib/components/MegaMenu/megaMenuItem.js +27 -6
  154. package/lib/components/MegaMenu/megaMenuItem.module.css +0 -5
  155. package/lib/components/MegaMenu/submenu.js +5 -3
  156. package/lib/components/MegaMenu/submenuColumn.js +15 -4
  157. package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +4 -4
  158. package/lib/components/MiniCart/ProductList/item.js +5 -2
  159. package/lib/components/MiniCart/ProductList/productList.js +5 -1
  160. package/lib/components/MiniCart/__tests__/__snapshots__/miniCart.spec.js.snap +1 -1
  161. package/lib/components/MiniCart/miniCart.gql.js +3 -2
  162. package/lib/components/MiniCart/miniCart.js +9 -4
  163. package/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +1 -1
  164. package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.shimmer.spec.js.snap +40 -0
  165. package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.spec.js.snap +14 -8
  166. package/lib/components/Newsletter/__tests__/newsletter.shimmer.spec.js +10 -0
  167. package/lib/components/Newsletter/__tests__/newsletter.spec.js +25 -2
  168. package/lib/components/Newsletter/newsletter.js +27 -6
  169. package/lib/components/Newsletter/newsletter.shimmer.js +46 -0
  170. package/lib/components/Newsletter/newsletter.shimmer.module.css +11 -0
  171. package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +1 -1
  172. package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/shippingMethod.spec.js.snap +3 -0
  173. package/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +4 -1
  174. package/lib/components/OrderHistoryPage/OrderDetails/item.js +1 -1
  175. package/lib/components/OrderHistoryPage/OrderDetails/items.js +1 -1
  176. package/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +1 -1
  177. package/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +4 -1
  178. package/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +5 -1
  179. package/lib/components/OrderHistoryPage/orderHistoryPage.js +8 -1
  180. package/lib/components/Pagination/pagination.js +1 -1
  181. package/lib/components/Pagination/tile.js +5 -1
  182. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/__snapshots__/boolean.spec.js.snap +20 -0
  183. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/boolean.spec.js +52 -0
  184. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.js +74 -0
  185. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.module.css +9 -0
  186. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/index.js +1 -0
  187. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/__snapshots__/date.spec.js.snap +25 -0
  188. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/date.spec.js +52 -0
  189. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.js +82 -0
  190. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.module.css +9 -0
  191. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/index.js +1 -0
  192. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/__snapshots__/dateTime.spec.js.snap +29 -0
  193. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/dateTime.spec.js +53 -0
  194. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.js +85 -0
  195. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.module.css +9 -0
  196. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/index.js +1 -0
  197. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/__snapshots__/multiSelect.spec.js.snap +36 -0
  198. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/multiSelect.spec.js +88 -0
  199. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/index.js +1 -0
  200. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.js +99 -0
  201. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.module.css +13 -0
  202. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/__snapshots__/price.spec.js.snap +23 -0
  203. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/price.spec.js +52 -0
  204. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/index.js +1 -0
  205. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.js +74 -0
  206. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.module.css +9 -0
  207. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/__snapshots__/select.spec.js.snap +36 -0
  208. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/select.spec.js +88 -0
  209. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/index.js +1 -0
  210. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.js +99 -0
  211. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.module.css +13 -0
  212. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/__snapshots__/text.spec.js.snap +33 -0
  213. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/text.spec.js +74 -0
  214. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/index.js +1 -0
  215. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.js +88 -0
  216. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.module.css +13 -0
  217. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/__snapshots__/textarea.spec.js.snap +33 -0
  218. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/textarea.spec.js +74 -0
  219. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/index.js +1 -0
  220. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.js +88 -0
  221. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.module.css +13 -0
  222. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/__snapshots__/attributeType.spec.js.snap +101 -0
  223. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/attributeType.spec.js +173 -0
  224. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/attributeType.js +61 -0
  225. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/index.js +1 -0
  226. package/lib/components/ProductFullDetail/CustomAttributes/__tests__/__snapshots__/customAttributes.spec.js.snap +49 -0
  227. package/lib/components/ProductFullDetail/CustomAttributes/__tests__/customAttributes.spec.js +78 -0
  228. package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +66 -0
  229. package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +14 -0
  230. package/lib/components/ProductFullDetail/CustomAttributes/index.js +1 -0
  231. package/lib/components/ProductFullDetail/__tests__/__snapshots__/productFullDetail.spec.js.snap +39 -0
  232. package/lib/components/ProductFullDetail/__tests__/productFullDetail.spec.js +3 -1
  233. package/lib/components/ProductFullDetail/productFullDetail.js +18 -3
  234. package/lib/components/ProductOptions/__tests__/__snapshots__/option.spec.js.snap +1 -1
  235. package/lib/components/ProductOptions/__tests__/__snapshots__/options.spec.js.snap +2 -2
  236. package/lib/components/ProductOptions/__tests__/__snapshots__/swatch.spec.js.snap +44 -2
  237. package/lib/components/ProductOptions/__tests__/__snapshots__/swatchList.spec.js.snap +22 -1
  238. package/lib/components/ProductOptions/__tests__/swatch.spec.js +0 -2
  239. package/lib/components/ProductOptions/option.js +2 -2
  240. package/lib/components/ProductOptions/swatch.js +7 -5
  241. package/lib/components/ProductOptions/swatch.module.css +11 -0
  242. package/lib/components/ProductOptions/tile.js +1 -0
  243. package/lib/components/ProductSort/__tests__/__snapshots__/sortItem.spec.js.snap +14 -0
  244. package/lib/components/ProductSort/__tests__/sortItem.spec.js +61 -0
  245. package/lib/components/ProductSort/productSort.js +84 -40
  246. package/lib/components/ProductSort/sortItem.js +26 -11
  247. package/lib/components/RadioGroup/radio.module.css +13 -5
  248. package/lib/components/RadioGroup/radioGroup.js +2 -1
  249. package/lib/components/Rating/__tests__/__snapshots__/rating.spec.js.snap +27 -0
  250. package/lib/components/Rating/__tests__/rating.spec.js +13 -0
  251. package/lib/components/Rating/index.js +1 -0
  252. package/lib/components/Rating/rating.js +30 -0
  253. package/lib/components/Rating/rating.module.css +21 -0
  254. package/lib/components/RichContent/richContent.module.css +52 -59
  255. package/lib/components/SearchBar/autocomplete.js +2 -0
  256. package/lib/components/SearchBar/searchBar.js +1 -1
  257. package/lib/components/SearchBar/searchField.js +1 -0
  258. package/lib/components/SearchBar/suggestedCategory.js +1 -1
  259. package/lib/components/SearchBar/suggestedProduct.js +6 -1
  260. package/lib/components/SearchPage/__tests__/__snapshots__/searchPage.spec.js.snap +41 -1
  261. package/lib/components/SearchPage/__tests__/searchPage.spec.js +8 -0
  262. package/lib/components/SearchPage/searchPage.js +12 -6
  263. package/lib/components/Shimmer/shimmer.js +11 -2
  264. package/lib/components/Shimmer/shimmer.module.css +4 -8
  265. package/lib/components/SignIn/__tests__/__snapshots__/signIn.spec.js.snap +126 -0
  266. package/lib/components/SignIn/__tests__/signIn.spec.js +11 -0
  267. package/lib/components/SignIn/signIn.gql.js +8 -4
  268. package/lib/components/SignIn/signIn.js +24 -4
  269. package/lib/components/TextArea/textArea.module.css +9 -0
  270. package/lib/components/TextInput/textInput.module.css +4 -0
  271. package/lib/components/ToastContainer/toast.js +23 -3
  272. package/lib/components/ToastContainer/toast.module.css +3 -0
  273. package/lib/components/Trigger/trigger.js +9 -2
  274. package/lib/components/Wishlist/AddToListButton/addToListButton.ee.js +1 -0
  275. package/lib/components/Wishlist/WishlistDialog/CreateWishlistForm/createWishlistForm.js +2 -0
  276. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +1 -0
  277. package/lib/components/Wishlist/WishlistDialog/wishlistDialog.js +1 -0
  278. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +5 -5
  279. package/lib/components/WishlistPage/createWishlist.ee.js +2 -0
  280. package/lib/components/WishlistPage/wishlist.js +8 -3
  281. package/lib/components/WishlistPage/wishlistItem.js +17 -4
  282. package/lib/components/WishlistPage/wishlistPage.js +5 -3
  283. package/lib/defaultRoutes.json +6 -0
  284. package/lib/targets/__tests__/venia-ui-targets.spec.js +2 -0
  285. package/lib/util/__tests__/shrinkGETQuery.spec.js +1 -1
  286. package/lib/util/apolloCache.js +2 -2
  287. package/lib/util/formValidators.js +10 -8
  288. package/lib/util/toCamelCase.js +3 -0
  289. package/package.json +17 -14
  290. package/upward.yml +19 -40
@@ -257,3 +257,129 @@ exports[`renders correctly 1`] = `
257
257
  </form>
258
258
  </div>
259
259
  `;
260
+
261
+ exports[`renders prefilled form with initial values 1`] = `
262
+ <div
263
+ className="root"
264
+ >
265
+ <span
266
+ className="title"
267
+ >
268
+ <mock-FormattedMessage
269
+ defaultMessage="Sign-in to Your Account"
270
+ id="signIn.titleText"
271
+ />
272
+ </span>
273
+ <FormError
274
+ errors={
275
+ Array [
276
+ null,
277
+ null,
278
+ ]
279
+ }
280
+ />
281
+ <form
282
+ className="form"
283
+ onKeyDown={[Function]}
284
+ onReset={[Function]}
285
+ onSubmit={[Function]}
286
+ >
287
+ <div
288
+ className="root"
289
+ >
290
+ <label
291
+ className="label"
292
+ >
293
+ Email address
294
+ </label>
295
+ <span
296
+ className="root"
297
+ style={
298
+ Object {
299
+ "--iconsAfter": 0,
300
+ "--iconsBefore": 0,
301
+ }
302
+ }
303
+ >
304
+ <span
305
+ className="input"
306
+ >
307
+ <input
308
+ autoComplete="email"
309
+ className="input"
310
+ id="email"
311
+ name="email"
312
+ onBlur={[Function]}
313
+ onChange={[Function]}
314
+ value="test@mail.com"
315
+ />
316
+ </span>
317
+ <span
318
+ className="before"
319
+ />
320
+ <span
321
+ className="after"
322
+ />
323
+ </span>
324
+ <p
325
+ className="root"
326
+ />
327
+ </div>
328
+ <div
329
+ className="root"
330
+ >
331
+ <label
332
+ className="label"
333
+ >
334
+ Password
335
+ </label>
336
+ <span
337
+ className="root"
338
+ style={
339
+ Object {
340
+ "--iconsAfter": 1,
341
+ "--iconsBefore": 0,
342
+ }
343
+ }
344
+ >
345
+ <span
346
+ className="input"
347
+ >
348
+ <input
349
+ autoComplete="current-password"
350
+ className="input"
351
+ id="password"
352
+ name="password"
353
+ onBlur={[Function]}
354
+ onChange={[Function]}
355
+ type="password"
356
+ value=""
357
+ />
358
+ </span>
359
+ <span
360
+ className="before"
361
+ />
362
+ <span
363
+ className="after"
364
+ >
365
+ <i />
366
+ </span>
367
+ </span>
368
+ <p
369
+ className="root"
370
+ />
371
+ </div>
372
+ <div
373
+ className="forgotPasswordButtonContainer"
374
+ >
375
+ <i />
376
+ </div>
377
+ <div
378
+ className="buttonsContainer"
379
+ >
380
+ <i />
381
+ <i />
382
+ </div>
383
+ </form>
384
+ </div>
385
+ `;
@@ -91,6 +91,17 @@ test('renders the loading indicator when form is submitting', () => {
91
91
  });
92
92
  });
93
93
 
94
+ test('renders prefilled form with initial values', () => {
95
+ const testProps = {
96
+ ...props,
97
+ initialValues: {
98
+ email: 'test@mail.com'
99
+ }
100
+ };
101
+ const component = createTestInstance(<SignIn {...testProps} />);
102
+ expect(component.toJSON()).toMatchSnapshot();
103
+ });
104
+
94
105
  test('displays an error message if there is a sign in error', () => {
95
106
  useMutation.mockReturnValueOnce([
96
107
  jest.fn(),
@@ -5,10 +5,12 @@ export const GET_CART_DETAILS_QUERY = gql`
5
5
  query GetCartDetailsAfterSignIn($cartId: String!) {
6
6
  cart(cart_id: $cartId) {
7
7
  id
8
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
8
9
  items {
9
- id
10
+ uid
11
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
10
12
  product {
11
- id
13
+ uid
12
14
  name
13
15
  sku
14
16
  small_image {
@@ -24,11 +26,13 @@ export const GET_CART_DETAILS_QUERY = gql`
24
26
  }
25
27
  }
26
28
  quantity
29
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
27
30
  ... on ConfigurableCartItem {
31
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
28
32
  configurable_options {
29
- id
33
+ configurable_product_option_uid
30
34
  option_label
31
- value_id
35
+ configurable_product_option_value_uid
32
36
  value_label
33
37
  }
34
38
  }
@@ -18,7 +18,12 @@ import FormError from '../FormError/formError';
18
18
 
19
19
  const SignIn = props => {
20
20
  const classes = useStyle(defaultClasses, props.classes);
21
- const { setDefaultUsername, showCreateAccount, showForgotPassword } = props;
21
+ const {
22
+ setDefaultUsername,
23
+ showCreateAccount,
24
+ showForgotPassword,
25
+ initialValues
26
+ } = props;
22
27
 
23
28
  const { formatMessage } = useIntl();
24
29
  const talonProps = useSignIn({
@@ -55,7 +60,7 @@ const SignIn = props => {
55
60
  };
56
61
 
57
62
  return (
58
- <div className={classes.root}>
63
+ <div data-cy="SignIn-root" className={classes.root}>
59
64
  <span className={classes.title}>
60
65
  <FormattedMessage
61
66
  id={'signIn.titleText'}
@@ -67,6 +72,8 @@ const SignIn = props => {
67
72
  getApi={setFormApi}
68
73
  className={classes.form}
69
74
  onSubmit={handleSubmit}
75
+ data-cy="SignIn-form"
76
+ initialValues={initialValues && initialValues}
70
77
  >
71
78
  <Field
72
79
  label={formatMessage({
@@ -75,12 +82,15 @@ const SignIn = props => {
75
82
  })}
76
83
  >
77
84
  <TextInput
85
+ data-cy="SignIn-email"
78
86
  autoComplete="email"
79
87
  field="email"
80
88
  validate={isRequired}
89
+ data-cy="email"
81
90
  />
82
91
  </Field>
83
92
  <Password
93
+ data-cy="SignIn-password"
84
94
  fieldName="password"
85
95
  label={formatMessage({
86
96
  id: 'signIn.passwordText',
@@ -89,12 +99,14 @@ const SignIn = props => {
89
99
  validate={isRequired}
90
100
  autoComplete="current-password"
91
101
  isToggleButtonHidden={false}
102
+ data-cy="password"
92
103
  />
93
104
  <div className={classes.forgotPasswordButtonContainer}>
94
105
  <LinkButton
95
106
  classes={forgotPasswordClasses}
96
107
  type="button"
97
108
  onClick={handleForgotPassword}
109
+ data-cy="SignIn-forgotPasswordButton"
98
110
  >
99
111
  <FormattedMessage
100
112
  id={'signIn.forgotPasswordText'}
@@ -103,7 +115,11 @@ const SignIn = props => {
103
115
  </LinkButton>
104
116
  </div>
105
117
  <div className={classes.buttonsContainer}>
106
- <Button priority="high" type="submit">
118
+ <Button
119
+ priority="high"
120
+ type="submit"
121
+ data-cy="SignInButton-root_highPriority"
122
+ >
107
123
  <FormattedMessage
108
124
  id={'signIn.signInText'}
109
125
  defaultMessage={'Sign In'}
@@ -113,6 +129,7 @@ const SignIn = props => {
113
129
  priority="normal"
114
130
  type="button"
115
131
  onClick={handleCreateAccount}
132
+ data-cy="CreateAccount-initiateButton"
116
133
  >
117
134
  <FormattedMessage
118
135
  id={'signIn.createAccountText'}
@@ -137,7 +154,10 @@ SignIn.propTypes = {
137
154
  }),
138
155
  setDefaultUsername: func,
139
156
  showCreateAccount: func,
140
- showForgotPassword: func
157
+ showForgotPassword: func,
158
+ initialValues: shape({
159
+ email: string.isRequired
160
+ })
141
161
  };
142
162
  SignIn.defaultProps = {
143
163
  setDefaultUsername: () => {},
@@ -5,3 +5,12 @@
5
5
  min-width: 100%;
6
6
  padding: 12px 15px;
7
7
  }
8
+
9
+ .input_shimmer {
10
+ composes: input_base from '../Field/field.module.css';
11
+ height: auto;
12
+ min-height: 6.75rem;
13
+ max-width: 100%;
14
+ min-width: 100%;
15
+ padding: 12px 15px;
16
+ }
@@ -10,3 +10,7 @@
10
10
  composes: input from '../Field/field.module.css';
11
11
  border-color: rgb(var(--venia-global-color-red-400));
12
12
  }
13
+
14
+ .input_shimmer {
15
+ composes: input_base from '../Field/field.module.css';
16
+ }
@@ -10,6 +10,8 @@ const Toast = props => {
10
10
  const {
11
11
  actionText,
12
12
  dismissable,
13
+ hasDismissAction,
14
+ dismissActionText,
13
15
  icon,
14
16
  message,
15
17
  onAction,
@@ -30,18 +32,36 @@ const Toast = props => {
30
32
  </button>
31
33
  ) : null;
32
34
 
35
+ const dismissActionButton =
36
+ hasDismissAction && (onDismiss || dismissable) ? (
37
+ <button
38
+ data-cy="Toast-dismissActionButton"
39
+ className={classes.actionButton}
40
+ onClick={handleDismiss}
41
+ >
42
+ {dismissActionText}
43
+ </button>
44
+ ) : null;
45
+
33
46
  const actions = onAction ? (
34
47
  <div className={classes.actions}>
35
- <button className={classes.actionButton} onClick={handleAction}>
48
+ {dismissActionButton}
49
+ <button
50
+ data-cy="Toast-actionButton"
51
+ className={classes.actionButton}
52
+ onClick={handleAction}
53
+ >
36
54
  {actionText}
37
55
  </button>
38
56
  </div>
39
57
  ) : null;
40
58
 
41
59
  return (
42
- <div className={classes[`${type}Toast`]}>
60
+ <div className={classes[`${type}Toast`]} data-cy="Toast-root">
43
61
  <span className={classes.icon}>{iconElement}</span>
44
- <div className={classes.message}>{message}</div>
62
+ <div className={classes.message} data-cy="Toast-message">
63
+ {message}
64
+ </div>
45
65
  <div className={classes.controls}>{controls}</div>
46
66
  {actions}
47
67
  </div>
@@ -98,6 +98,9 @@
98
98
  }
99
99
 
100
100
  .actions {
101
+ display: grid;
102
+ grid-template-columns: 1fr 1fr;
103
+ gap: 1.25rem;
101
104
  grid-column: 2 / span 1;
102
105
  grid-row: 2 / span 1;
103
106
  }
@@ -15,9 +15,15 @@ import defaultClasses from './trigger.module.css';
15
15
  * @returns {React.Element} A React component that when triggered invokes the action.
16
16
  */
17
17
  const Trigger = props => {
18
- const { action, children, ariaLabel } = props;
18
+ const {
19
+ action,
20
+ children,
21
+ ariaLabel,
22
+ classes: propClasses,
23
+ ...restProps
24
+ } = props;
19
25
 
20
- const classes = useStyle(defaultClasses, props.classes);
26
+ const classes = useStyle(defaultClasses, propClasses);
21
27
 
22
28
  return (
23
29
  <button
@@ -25,6 +31,7 @@ const Trigger = props => {
25
31
  type="button"
26
32
  onClick={action}
27
33
  aria-label={ariaLabel}
34
+ {...restProps}
28
35
  >
29
36
  {children}
30
37
  </button>
@@ -41,6 +41,7 @@ const AddToListButton = props => {
41
41
  ref={buttonRef}
42
42
  className={buttonClass}
43
43
  {...buttonAriaProps}
44
+ data-cy="addToListButton-root"
44
45
  >
45
46
  {props.icon} {buttonText}
46
47
  </button>
@@ -48,6 +48,7 @@ const CreateWishlistForm = props => {
48
48
  id={classes.listname}
49
49
  field="listname"
50
50
  validate={isRequired}
51
+ data-cy="createWishlistForm-listname"
51
52
  />
52
53
  </Field>
53
54
  </div>
@@ -61,6 +62,7 @@ const CreateWishlistForm = props => {
61
62
  onClick={handleSave}
62
63
  priority="high"
63
64
  type="button"
65
+ data-cy="createWishListForm-saveButton"
64
66
  >
65
67
  {saveButtonText}
66
68
  </Button>
@@ -18,6 +18,7 @@ const WishlistLineItem = props => {
18
18
  disabled={isDisabled}
19
19
  type="button"
20
20
  onClick={handleClick}
21
+ data-cy="WishlistLineItem-button"
21
22
  >
22
23
  {props.children}
23
24
  </button>
@@ -79,6 +79,7 @@ const WishlistDialog = props => {
79
79
  className={classes.createListButton}
80
80
  onClick={handleNewListClick}
81
81
  type="button"
82
+ data-cy="WishlistDialog-createButton"
82
83
  >
83
84
  {createButtonText}
84
85
  </button>
@@ -8,7 +8,7 @@ exports[`empty single wishlist 1`] = `
8
8
  className="heading"
9
9
  >
10
10
  <mock-FormattedMessage
11
- defaultMessage="Favorites Lists"
11
+ defaultMessage="{count, plural, one {Favorites List} other {Favorites Lists}}"
12
12
  id="wishlistPage.headingText"
13
13
  values={
14
14
  Object {
@@ -30,7 +30,7 @@ exports[`renders a single wishlist without visibility toggle 1`] = `
30
30
  className="heading"
31
31
  >
32
32
  <mock-FormattedMessage
33
- defaultMessage="Favorites Lists"
33
+ defaultMessage="{count, plural, one {Favorites List} other {Favorites Lists}}"
34
34
  id="wishlistPage.headingText"
35
35
  values={
36
36
  Object {
@@ -60,7 +60,7 @@ exports[`renders disabled feature error 1`] = `
60
60
  className="heading"
61
61
  >
62
62
  <mock-FormattedMessage
63
- defaultMessage="Favorites Lists"
63
+ defaultMessage="{count, plural, one {Favorites List} other {Favorites Lists}}"
64
64
  id="wishlistPage.headingText"
65
65
  values={
66
66
  Object {
@@ -90,7 +90,7 @@ exports[`renders general fetch error 1`] = `
90
90
  className="heading"
91
91
  >
92
92
  <mock-FormattedMessage
93
- defaultMessage="Favorites Lists"
93
+ defaultMessage="{count, plural, one {Favorites List} other {Favorites Lists}}"
94
94
  id="wishlistPage.headingText"
95
95
  values={
96
96
  Object {
@@ -202,7 +202,7 @@ exports[`renders wishlist data 1`] = `
202
202
  className="heading"
203
203
  >
204
204
  <mock-FormattedMessage
205
- defaultMessage="Favorites Lists"
205
+ defaultMessage="{count, plural, one {Favorites List} other {Favorites Lists}}"
206
206
  id="wishlistPage.headingText"
207
207
  values={
208
208
  Object {
@@ -47,6 +47,7 @@ const CreateWishlist = props => {
47
47
  className={classes.createButton}
48
48
  onClick={handleShowModal}
49
49
  type="button"
50
+ data-cy="createWishlist-createButton"
50
51
  >
51
52
  <div className={classes.labelContainer}>
52
53
  {createIcon}
@@ -99,6 +100,7 @@ const CreateWishlist = props => {
99
100
  field="name"
100
101
  validate={isRequired}
101
102
  validateOnBlur
103
+ data-cy="createWishlist-name"
102
104
  />
103
105
  </Field>
104
106
  </div>
@@ -91,7 +91,9 @@ const Wishlist = props => {
91
91
 
92
92
  const wishlistName = name ? (
93
93
  <div className={classes.nameContainer}>
94
- <h2 className={classes.name}>{name}</h2>
94
+ <h2 className={classes.name} data-cy="Wishlist-name">
95
+ {name}
96
+ </h2>
95
97
  </div>
96
98
  ) : (
97
99
  <div className={classes.nameContainer}>
@@ -127,7 +129,10 @@ const Wishlist = props => {
127
129
  : classes.visibilityToggle_hidden;
128
130
 
129
131
  const buttonsContainer = id ? (
130
- <div className={classes.buttonsContainer}>
132
+ <div
133
+ className={classes.buttonsContainer}
134
+ data-cy="wishlist-buttonsContainer"
135
+ >
131
136
  <ActionMenu id={id} name={name} visibility={visibility} />
132
137
  <button
133
138
  className={visibilityToggleClass}
@@ -140,7 +145,7 @@ const Wishlist = props => {
140
145
  ) : null;
141
146
 
142
147
  return (
143
- <div className={classes.root}>
148
+ <div className={classes.root} data-cy="Wishlist-root">
144
149
  <div className={classes.header}>
145
150
  {wishlistName}
146
151
  <div className={classes.itemsCountContainer}>
@@ -91,7 +91,11 @@ const WishlistItem = props => {
91
91
  : classes.root;
92
92
 
93
93
  const addToCart = isSupportedProductType ? (
94
- <button className={classes.addToCart} {...addToCartButtonProps}>
94
+ <button
95
+ className={classes.addToCart}
96
+ {...addToCartButtonProps}
97
+ data-cy="wishlistItem-addToCart"
98
+ >
95
99
  {formatMessage({
96
100
  id: 'wishlistItem.addToCart',
97
101
  defaultMessage: 'Add to Cart'
@@ -100,20 +104,29 @@ const WishlistItem = props => {
100
104
  ) : null;
101
105
 
102
106
  return (
103
- <div className={rootClass}>
107
+ <div className={rootClass} data-cy="wishlistItem-root">
104
108
  <Image {...imageProps} />
105
109
 
106
110
  <div className={classes.actionWrap}>
107
- <span className={classes.name}>{name}</span>{' '}
111
+ <span
112
+ className={classes.name}
113
+ data-cy="wishlistItem-productName"
114
+ >
115
+ {name}
116
+ </span>{' '}
108
117
  <button
109
118
  className={classes.deleteItem}
110
119
  onClick={handleRemoveProductFromWishlist}
111
120
  aria-label={removeProductAriaLabel}
121
+ data-cy="wishlistItem-deleteItem"
112
122
  >
113
123
  <Icon size={16} src={Trash2} />
114
124
  </button>
115
125
  </div>
116
- <div className={classes.priceContainer}>
126
+ <div
127
+ className={classes.priceContainer}
128
+ data-cy="wishlistItem-priceContainer"
129
+ >
117
130
  <Price currencyCode={currency} value={unitPrice} />
118
131
  </div>
119
132
  {optionElements}
@@ -80,12 +80,14 @@ const WishlistPage = props => {
80
80
  }
81
81
 
82
82
  return (
83
- <div className={classes.root}>
84
- <h1 className={classes.heading}>
83
+ <div className={classes.root} data-cy="Wishlist-root">
84
+ <h1 className={classes.heading} data-cy="WishlistPage-heading">
85
85
  <FormattedMessage
86
86
  values={{ count: wishlists.length }}
87
87
  id={'wishlistPage.headingText'}
88
- defaultMessage={'Favorites Lists'}
88
+ defaultMessage={
89
+ '{count, plural, one {Favorites List} other {Favorites Lists}}'
90
+ }
89
91
  />
90
92
  </h1>
91
93
  {content}
@@ -35,6 +35,12 @@
35
35
  "authed": true,
36
36
  "redirectTo": "/sign-in"
37
37
  },
38
+ {
39
+ "name": "ContactPage",
40
+ "pattern": "/contact-us",
41
+ "exact": true,
42
+ "path": "../ContactPage"
43
+ },
38
44
  {
39
45
  "name": "CreateAccountPage",
40
46
  "pattern": "/create-account",
@@ -85,6 +85,7 @@ test('uses routes to inject client-routed pages', async () => {
85
85
  '../CartPage/index.js': mockDefault('Cart'),
86
86
  '../CreateAccountPage/index.js': mockDefault('CreateAccount'),
87
87
  '../CheckoutPage/index.js': mockDefault('Checkout'),
88
+ '../ContactPage/index.js': mockDefault('ContactPage'),
88
89
  '../MagentoRoute/index.js': mockDefault('MagentoRoute')
89
90
  },
90
91
  optimization: {
@@ -97,6 +98,7 @@ test('uses routes to inject client-routed pages', async () => {
97
98
  expect(built.bundle).toContain('DynamicCart');
98
99
  expect(built.bundle).toContain('DynamicCreateAccount');
99
100
  expect(built.bundle).toContain('DynamicCheckout');
101
+ expect(built.bundle).toContain('DynamicContactPage');
100
102
  });
101
103
 
102
104
  test('declares checkoutPagePaymentTypes target', async () => {
@@ -82,7 +82,7 @@ test('Shrunken category query URL is smaller than the original', () => {
82
82
  configurable_options {
83
83
  attribute_code
84
84
  attribute_id
85
- id
85
+ uid
86
86
  label
87
87
  values {
88
88
  default_label
@@ -50,9 +50,9 @@ export const cacheKeyFromType = object => {
50
50
  : defaultDataIdFromObject(object);
51
51
  // ID field is not based on selected values and is not unique; use unique value ID instead.
52
52
  case MagentoGraphQLTypes.SelectedConfigurableOption:
53
- return object.value_id
53
+ return object.configurable_product_option_value_uid
54
54
  ? `${MagentoGraphQLTypes.SelectedConfigurableOption}:${
55
- object.value_id
55
+ object.configurable_product_option_value_uid
56
56
  }`
57
57
  : null;
58
58
  // Only maintain a single cart entry