@magento/venia-ui 9.1.0 → 9.2.0-alpha.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 (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 +24 -20
  132. package/lib/components/Gallery/item.js +15 -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
@@ -153,6 +153,9 @@ exports[`it disables the add to cart button when the talon indicates 1`] = `
153
153
  <strong>
154
154
  BTTF123
155
155
  </strong>
156
+ <CustomAttributes
157
+ customAttributes={Object {}}
158
+ />
156
159
  </section>
157
160
  </form>
158
161
  `;
@@ -280,6 +283,9 @@ exports[`it does not render options if the product is not a ConfigurableProduct
280
283
  <strong>
281
284
  BTTF123
282
285
  </strong>
286
+ <CustomAttributes
287
+ customAttributes={Object {}}
288
+ />
283
289
  </section>
284
290
  </form>
285
291
  `;
@@ -441,6 +447,9 @@ exports[`it renders an error for an invalid cart 1`] = `
441
447
  <strong>
442
448
  BTTF123
443
449
  </strong>
450
+ <CustomAttributes
451
+ customAttributes={Object {}}
452
+ />
444
453
  </section>
445
454
  </form>
446
455
  `;
@@ -602,6 +611,9 @@ exports[`it renders an error for an invalid user token when adding to cart 1`] =
602
611
  <strong>
603
612
  BTTF123
604
613
  </strong>
614
+ <CustomAttributes
615
+ customAttributes={Object {}}
616
+ />
605
617
  </section>
606
618
  </form>
607
619
  `;
@@ -764,6 +776,9 @@ Array [
764
776
  <strong>
765
777
  BTTF123
766
778
  </strong>
779
+ <CustomAttributes
780
+ customAttributes={Object {}}
781
+ />
767
782
  </section>
768
783
  </form>,
769
784
  ]
@@ -922,6 +937,9 @@ exports[`it renders correctly 1`] = `
922
937
  <strong>
923
938
  BTTF123
924
939
  </strong>
940
+ <CustomAttributes
941
+ customAttributes={Object {}}
942
+ />
925
943
  </section>
926
944
  </form>
927
945
  `;
@@ -1079,6 +1097,9 @@ exports[`it renders field level errors for quantity - message 1 1`] = `
1079
1097
  <strong>
1080
1098
  BTTF123
1081
1099
  </strong>
1100
+ <CustomAttributes
1101
+ customAttributes={Object {}}
1102
+ />
1082
1103
  </section>
1083
1104
  </form>
1084
1105
  `;
@@ -1236,6 +1257,9 @@ exports[`it renders field level errors for quantity - message 2 1`] = `
1236
1257
  <strong>
1237
1258
  BTTF123
1238
1259
  </strong>
1260
+ <CustomAttributes
1261
+ customAttributes={Object {}}
1262
+ />
1239
1263
  </section>
1240
1264
  </form>
1241
1265
  `;
@@ -1393,6 +1417,9 @@ exports[`it renders field level errors for quantity - message 3 1`] = `
1393
1417
  <strong>
1394
1418
  BTTF123
1395
1419
  </strong>
1420
+ <CustomAttributes
1421
+ customAttributes={Object {}}
1422
+ />
1396
1423
  </section>
1397
1424
  </form>
1398
1425
  `;
@@ -1554,6 +1581,9 @@ exports[`it renders form level errors 1`] = `
1554
1581
  <strong>
1555
1582
  BTTF123
1556
1583
  </strong>
1584
+ <CustomAttributes
1585
+ customAttributes={Object {}}
1586
+ />
1557
1587
  </section>
1558
1588
  </form>
1559
1589
  `;
@@ -1724,6 +1754,9 @@ exports[`it renders message with unsupported product type 1`] = `
1724
1754
  <strong>
1725
1755
  BTTF123
1726
1756
  </strong>
1757
+ <CustomAttributes
1758
+ customAttributes={Object {}}
1759
+ />
1727
1760
  </section>
1728
1761
  </form>
1729
1762
  `;
@@ -1851,6 +1884,9 @@ exports[`out of stock disabled CTA button is rendered if out of stock 1`] = `
1851
1884
  <strong>
1852
1885
  BTTF123
1853
1886
  </strong>
1887
+ <CustomAttributes
1888
+ customAttributes={Object {}}
1889
+ />
1854
1890
  </section>
1855
1891
  </form>
1856
1892
  `;
@@ -2010,6 +2046,9 @@ exports[`renders a WishlistButton with props 1`] = `
2010
2046
  <strong>
2011
2047
  BTTF123
2012
2048
  </strong>
2049
+ <CustomAttributes
2050
+ customAttributes={Object {}}
2051
+ />
2013
2052
  </section>
2014
2053
  </form>
2015
2054
  `;
@@ -30,6 +30,7 @@ jest.mock('../../CartPage/ProductListing/quantity', () => ({
30
30
  QuantityFields: () => 'QuantityFields'
31
31
  }));
32
32
  jest.mock('../../RichContent/richContent', () => 'RichContent');
33
+ jest.mock('../CustomAttributes', () => 'CustomAttributes');
33
34
 
34
35
  jest.mock('../../../classify');
35
36
 
@@ -187,7 +188,8 @@ const talonProps = {
187
188
  currency: 'USD',
188
189
  value: 3.5
189
190
  }
190
- }
191
+ },
192
+ customAttributes: {}
191
193
  };
192
194
 
193
195
  test('it renders correctly', () => {
@@ -16,6 +16,7 @@ import FormError from '../FormError';
16
16
  import { QuantityFields } from '../CartPage/ProductListing/quantity';
17
17
  import RichContent from '../RichContent/richContent';
18
18
  import { ProductOptionsShimmer } from '../ProductOptions';
19
+ import CustomAttributes from './CustomAttributes';
19
20
  import defaultClasses from './productFullDetail.module.css';
20
21
 
21
22
  const WishlistButton = React.lazy(() => import('../Wishlist/AddToListButton'));
@@ -50,6 +51,7 @@ const ProductFullDetail = props => {
50
51
  isSupportedProductType,
51
52
  mediaGalleryEntries,
52
53
  productDetails,
54
+ customAttributes,
53
55
  wishlistButtonProps
54
56
  } = talonProps;
55
57
  const { formatMessage } = useIntl();
@@ -139,7 +141,12 @@ const ProductFullDetail = props => {
139
141
  );
140
142
 
141
143
  const cartActionContent = isSupportedProductType ? (
142
- <Button disabled={isAddToCartDisabled} priority="high" type="submit">
144
+ <Button
145
+ data-cy="ProductFullDetail-addToCartButton"
146
+ disabled={isAddToCartDisabled}
147
+ priority="high"
148
+ type="submit"
149
+ >
143
150
  {cartCallToActionText}
144
151
  </Button>
145
152
  ) : (
@@ -159,9 +166,16 @@ const ProductFullDetail = props => {
159
166
  return (
160
167
  <Fragment>
161
168
  {breadcrumbs}
162
- <Form className={classes.root} onSubmit={handleAddToCart}>
169
+ <Form
170
+ className={classes.root}
171
+ data-cy="ProductFullDetail-root"
172
+ onSubmit={handleAddToCart}
173
+ >
163
174
  <section className={classes.title}>
164
- <h1 className={classes.productName}>
175
+ <h1
176
+ className={classes.productName}
177
+ data-cy="ProductFullDetail-productName"
178
+ >
165
179
  {productDetails.name}
166
180
  </h1>
167
181
  <p className={classes.productPrice}>
@@ -217,6 +231,7 @@ const ProductFullDetail = props => {
217
231
  />
218
232
  </span>
219
233
  <strong>{productDetails.sku}</strong>
234
+ <CustomAttributes customAttributes={customAttributes} />
220
235
  </section>
221
236
  </Form>
222
237
  </Fragment>
@@ -17,7 +17,7 @@ exports[`renders Option component correctly 1`] = `
17
17
  className="selectionLabel"
18
18
  >
19
19
  <mock-FormattedMessage
20
- defaultMessage="Selected Foo:"
20
+ defaultMessage="Selected {label}:"
21
21
  id="productOptions.selectedLabel"
22
22
  values={
23
23
  Object {
@@ -20,7 +20,7 @@ Array [
20
20
  className="selectionLabel"
21
21
  >
22
22
  <mock-FormattedMessage
23
- defaultMessage="Selected option-1:"
23
+ defaultMessage="Selected {label}:"
24
24
  id="productOptions.selectedLabel"
25
25
  values={
26
26
  Object {
@@ -52,7 +52,7 @@ Array [
52
52
  className="selectionLabel"
53
53
  >
54
54
  <mock-FormattedMessage
55
- defaultMessage="Selected option-1:"
55
+ defaultMessage="Selected {label}:"
56
56
  id="productOptions.selectedLabel"
57
57
  values={
58
58
  Object {
@@ -11,7 +11,28 @@ exports[`appends "_focused" to className if hasFocus is true 1`] = `
11
11
  }
12
12
  title="red"
13
13
  type="button"
14
- />
14
+ >
15
+ <span
16
+ className="root"
17
+ >
18
+ <svg
19
+ className="icon"
20
+ fill="none"
21
+ height={24}
22
+ stroke="currentColor"
23
+ strokeLinecap="round"
24
+ strokeLinejoin="round"
25
+ strokeWidth="2"
26
+ viewBox="0 0 24 24"
27
+ width={24}
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ >
30
+ <polyline
31
+ points="20 6 9 17 4 12"
32
+ />
33
+ </svg>
34
+ </span>
35
+ </button>
15
36
  `;
16
37
 
17
38
  exports[`appends "_selected" to className if isSelected is true 1`] = `
@@ -60,7 +81,28 @@ exports[`renders a Swatch correctly 1`] = `
60
81
  }
61
82
  title="red"
62
83
  type="button"
63
- />
84
+ >
85
+ <span
86
+ className="root"
87
+ >
88
+ <svg
89
+ className="icon"
90
+ fill="none"
91
+ height={24}
92
+ stroke="currentColor"
93
+ strokeLinecap="round"
94
+ strokeLinejoin="round"
95
+ strokeWidth="2"
96
+ viewBox="0 0 24 24"
97
+ width={24}
98
+ xmlns="http://www.w3.org/2000/svg"
99
+ >
100
+ <polyline
101
+ points="20 6 9 17 4 12"
102
+ />
103
+ </svg>
104
+ </span>
105
+ </button>
64
106
  `;
65
107
 
66
108
  exports[`renders an icon if isSelected is true 1`] = `
@@ -14,6 +14,27 @@ exports[`renders SwatchList component correctly 1`] = `
14
14
  }
15
15
  title="foo"
16
16
  type="button"
17
- />
17
+ >
18
+ <span
19
+ className="root"
20
+ >
21
+ <svg
22
+ className="icon"
23
+ fill="none"
24
+ height={24}
25
+ stroke="currentColor"
26
+ strokeLinecap="round"
27
+ strokeLinejoin="round"
28
+ strokeWidth="2"
29
+ viewBox="0 0 24 24"
30
+ width={24}
31
+ xmlns="http://www.w3.org/2000/svg"
32
+ >
33
+ <polyline
34
+ points="20 6 9 17 4 12"
35
+ />
36
+ </svg>
37
+ </span>
38
+ </button>
18
39
  </div>
19
40
  `;
@@ -20,8 +20,6 @@ const defaultProps = {
20
20
  test('renders a Swatch correctly', () => {
21
21
  const component = testRenderer.create(<Swatch {...defaultProps} />);
22
22
 
23
- expect(() => component.root.findByType(Icon)).toThrow();
24
-
25
23
  expect(component.root.findByType('button').props.className).not.toContain(
26
24
  '_selected'
27
25
  );
@@ -59,7 +59,7 @@ const Option = props => {
59
59
  const classes = useStyle(defaultClasses, props.classes);
60
60
 
61
61
  return (
62
- <div className={classes.root}>
62
+ <div className={classes.root} data-cy="ProductOptions-Option-root">
63
63
  <span className={classes.title}>{label}</span>
64
64
  <ValueList
65
65
  getItemKey={getItemKey}
@@ -71,7 +71,7 @@ const Option = props => {
71
71
  <dt className={classes.selectionLabel}>
72
72
  <FormattedMessage
73
73
  id="productOptions.selectedLabel"
74
- defaultMessage={`Selected ${label}:`}
74
+ defaultMessage="Selected {label}:"
75
75
  values={{ label }}
76
76
  />
77
77
  </dt>
@@ -40,12 +40,13 @@ const Swatch = props => {
40
40
 
41
41
  const { handleClick } = talonProps;
42
42
 
43
- const icon = useMemo(() => {
44
- return isSelected ? <Icon src={CheckIcon} /> : null;
45
- }, [isSelected]);
46
-
47
43
  const classes = useStyle(defaultClasses, props.classes);
48
44
 
45
+ const checkStyle = useMemo(
46
+ () => (isSelected ? classes.checked : classes.unchecked),
47
+ [classes.checked, classes.unchecked, isSelected]
48
+ );
49
+
49
50
  let finalStyle = style;
50
51
 
51
52
  if (swatch_data) {
@@ -82,8 +83,9 @@ const Swatch = props => {
82
83
  style={finalStyle}
83
84
  title={label}
84
85
  type="button"
86
+ data-cy="Swatch-root"
85
87
  >
86
- {icon}
88
+ <Icon classes={{ root: checkStyle }} src={CheckIcon} />
87
89
  </button>
88
90
  );
89
91
  };
@@ -19,3 +19,14 @@
19
19
  .root_selected_focused {
20
20
  composes: root_selected;
21
21
  }
22
+
23
+ .checked {
24
+ opacity: 1;
25
+ transition-property: opacity;
26
+ transition-duration: 256ms;
27
+ }
28
+
29
+ .unchecked {
30
+ composes: checked;
31
+ opacity: 0;
32
+ }
@@ -32,6 +32,7 @@ const Tile = props => {
32
32
  onClick={handleClick}
33
33
  title={label}
34
34
  type="button"
35
+ data-cy="Tile-button"
35
36
  >
36
37
  <span>{label}</span>
37
38
  </button>
@@ -0,0 +1,14 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders correctly 1`] = `
4
+ <button
5
+ onKeyDown={[Function]}
6
+ onMouseDown={[Function]}
7
+ >
8
+ <span>
9
+ <span>
10
+ relevance
11
+ </span>
12
+ </span>
13
+ </button>
14
+ `;
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import { createTestInstance } from '@magento/peregrine';
3
+ import SortItem from '../sortItem';
4
+
5
+ const mockOnClick = jest.fn();
6
+
7
+ const defaultProps = {
8
+ active: false,
9
+ onClick: mockOnClick,
10
+ sortItem: {
11
+ id: 'foo',
12
+ text: 'relevance'
13
+ }
14
+ };
15
+
16
+ const Component = () => <SortItem {...defaultProps} />;
17
+
18
+ test('renders correctly', () => {
19
+ const instance = createTestInstance(<Component />);
20
+
21
+ expect(instance.toJSON()).toMatchSnapshot();
22
+ });
23
+
24
+ test('calls onClick handler on mousedown event', () => {
25
+ const component = createTestInstance(<Component />);
26
+ const { root } = component;
27
+ const eventMock = {
28
+ button: 0
29
+ };
30
+
31
+ root.findByType('button').props.onMouseDown(eventMock);
32
+ expect(mockOnClick).toHaveBeenCalled();
33
+ });
34
+
35
+ test('it does not call onClick handler on right mousedown event', () => {
36
+ const component = createTestInstance(<Component />);
37
+ const { root } = component;
38
+ const eventMock = {
39
+ button: 1
40
+ };
41
+
42
+ root.findByType('button').props.onMouseDown(eventMock);
43
+ expect(mockOnClick).not.toHaveBeenCalled();
44
+ });
45
+
46
+ test('calls onClick handler on keyboard Enter or space press', () => {
47
+ const component = createTestInstance(<Component />);
48
+ const { root } = component;
49
+
50
+ root.findByType('button').props.onKeyDown({
51
+ key: 'Enter',
52
+ preventDefault: jest.fn()
53
+ });
54
+
55
+ root.findByType('button').props.onKeyDown({
56
+ key: ' ',
57
+ preventDefault: jest.fn()
58
+ });
59
+
60
+ expect(mockOnClick).toHaveBeenCalledTimes(2);
61
+ });
@@ -1,7 +1,7 @@
1
1
  import React, { useMemo, useCallback } from 'react';
2
2
  import { ChevronDown as ArrowDown } from 'react-feather';
3
- import { FormattedMessage } from 'react-intl';
4
- import { array, arrayOf, shape, string, oneOf } from 'prop-types';
3
+ import { FormattedMessage, useIntl } from 'react-intl';
4
+ import { array, arrayOf, shape, string } from 'prop-types';
5
5
  import { useDropdown } from '@magento/peregrine/lib/hooks/useDropdown';
6
6
 
7
7
  import { useStyle } from '../../classify';
@@ -15,6 +15,34 @@ const ProductSort = props => {
15
15
  const { availableSortMethods, sortProps } = props;
16
16
  const [currentSort, setSort] = sortProps;
17
17
  const { elementRef, expanded, setExpanded } = useDropdown();
18
+ const { formatMessage, locale } = useIntl();
19
+
20
+ const orderSortingList = useCallback(
21
+ list => {
22
+ return list.sort((a, b) => {
23
+ return a.text.localeCompare(b.text, locale, {
24
+ sensitivity: 'base'
25
+ });
26
+ });
27
+ },
28
+ [locale]
29
+ );
30
+
31
+ const sortMethodsFromConfig = availableSortMethods
32
+ ? availableSortMethods
33
+ .map(method => {
34
+ const { value, label } = method;
35
+ if (value !== 'price' && value !== 'position') {
36
+ return {
37
+ id: `sortItem.${value}`,
38
+ text: label,
39
+ attribute: value,
40
+ sortDirection: 'ASC'
41
+ };
42
+ }
43
+ })
44
+ .filter(method => !!method)
45
+ : null;
18
46
 
19
47
  // click event for menu items
20
48
  const handleItemClick = useCallback(
@@ -36,7 +64,52 @@ const ProductSort = props => {
36
64
  return null;
37
65
  }
38
66
 
39
- const itemElements = Array.from(availableSortMethods, sortItem => {
67
+ const defaultSortMethods = [
68
+ {
69
+ id: 'sortItem.relevance',
70
+ text: formatMessage({
71
+ id: 'sortItem.relevance',
72
+ defaultMessage: 'Best Match'
73
+ }),
74
+ attribute: 'relevance',
75
+ sortDirection: 'DESC'
76
+ },
77
+ {
78
+ id: 'sortItem.position',
79
+ text: formatMessage({
80
+ id: 'sortItem.position',
81
+ defaultMessage: 'Position'
82
+ }),
83
+ attribute: 'position',
84
+ sortDirection: 'ASC'
85
+ },
86
+ {
87
+ id: 'sortItem.priceDesc',
88
+ text: formatMessage({
89
+ id: 'sortItem.priceDesc',
90
+ defaultMessage: 'Price: High to Low'
91
+ }),
92
+ attribute: 'price',
93
+ sortDirection: 'DESC'
94
+ },
95
+ {
96
+ id: 'sortItem.priceAsc',
97
+ text: formatMessage({
98
+ id: 'sortItem.priceAsc',
99
+ defaultMessage: 'Price: Low to High'
100
+ }),
101
+ attribute: 'price',
102
+ sortDirection: 'ASC'
103
+ }
104
+ ];
105
+
106
+ const allSortingMethods = sortMethodsFromConfig
107
+ ? orderSortingList(
108
+ [sortMethodsFromConfig, defaultSortMethods].flat()
109
+ )
110
+ : defaultSortMethods;
111
+
112
+ const itemElements = Array.from(allSortingMethods, sortItem => {
40
113
  const { attribute, sortDirection } = sortItem;
41
114
  const isActive =
42
115
  currentSort.sortAttribute === attribute &&
@@ -60,13 +133,15 @@ const ProductSort = props => {
60
133
  </div>
61
134
  );
62
135
  }, [
63
- availableSortMethods,
64
136
  classes.menu,
65
137
  classes.menuItem,
66
138
  currentSort.sortAttribute,
67
139
  currentSort.sortDirection,
68
140
  expanded,
69
- handleItemClick
141
+ formatMessage,
142
+ handleItemClick,
143
+ orderSortingList,
144
+ sortMethodsFromConfig
70
145
  ]);
71
146
 
72
147
  // expand or collapse on click
@@ -78,6 +153,7 @@ const ProductSort = props => {
78
153
  <div
79
154
  ref={elementRef}
80
155
  className={classes.root}
156
+ data-cy="ProductSort-root"
81
157
  aria-live="polite"
82
158
  aria-busy="false"
83
159
  >
@@ -87,6 +163,7 @@ const ProductSort = props => {
87
163
  root_lowPriority: classes.sortButton
88
164
  }}
89
165
  onClick={handleSortClick}
166
+ data-cy="ProductSort-sortButton"
90
167
  >
91
168
  <span className={classes.mobileText}>
92
169
  <FormattedMessage
@@ -116,8 +193,6 @@ const ProductSort = props => {
116
193
  );
117
194
  };
118
195
 
119
- const sortDirections = oneOf(['ASC', 'DESC']);
120
-
121
196
  ProductSort.propTypes = {
122
197
  classes: shape({
123
198
  menuItem: string,
@@ -127,42 +202,11 @@ ProductSort.propTypes = {
127
202
  }),
128
203
  availableSortMethods: arrayOf(
129
204
  shape({
130
- text: string,
131
- id: string,
132
- attribute: string,
133
- sortDirection: sortDirections
205
+ label: string,
206
+ value: string
134
207
  })
135
208
  ),
136
209
  sortProps: array
137
210
  };
138
211
 
139
- ProductSort.defaultProps = {
140
- availableSortMethods: [
141
- {
142
- text: 'Position',
143
- id: 'sortItem.position',
144
- attribute: 'position',
145
- sortDirection: 'ASC'
146
- },
147
- {
148
- id: 'sortItem.relevance',
149
- text: 'Best Match',
150
- attribute: 'relevance',
151
- sortDirection: 'DESC'
152
- },
153
- {
154
- id: 'sortItem.priceAsc',
155
- text: 'Price: Low to High',
156
- attribute: 'price',
157
- sortDirection: 'ASC'
158
- },
159
- {
160
- id: 'sortItem.priceDesc',
161
- text: 'Price: High to Low',
162
- attribute: 'price',
163
- sortDirection: 'DESC'
164
- }
165
- ]
166
- };
167
-
168
212
  export default ProductSort;