@magento/venia-ui 9.2.0 → 9.3.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 (167) hide show
  1. package/i18n/en_US.json +17 -3
  2. package/lib/RootComponents/CMS/__tests__/__snapshots__/cms.spec.js.snap +19 -0
  3. package/lib/RootComponents/CMS/__tests__/cms.spec.js +4 -9
  4. package/lib/RootComponents/CMS/cms.js +5 -4
  5. package/lib/RootComponents/CMS/cms.shimmer.js +18 -0
  6. package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.shimmer.spec.js.snap +12 -0
  7. package/lib/RootComponents/Category/categoryContent.js +4 -1
  8. package/lib/components/AccountChip/accountChip.js +3 -1
  9. package/lib/components/AccountInformationPage/accountInformationPage.js +3 -1
  10. package/lib/components/AccountInformationPage/editModal.js +9 -2
  11. package/lib/components/AccountMenu/accountMenuItems.js +8 -3
  12. package/lib/components/CartPage/GiftCards/giftCards.js +1 -1
  13. package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +5 -1
  14. package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/__snapshots__/giftOptions.spec.js.snap +1018 -78
  15. package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/giftOptions.spec.js +221 -35
  16. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +287 -40
  17. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +56 -1
  18. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftCardSection.ee.spec.js.snap +12 -0
  19. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ce.spec.js.snap +3 -0
  20. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ee.spec.js.snap +16 -0
  21. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -32
  22. package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ce.spec.js +17 -0
  23. package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ee.spec.js +36 -0
  24. package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ce.spec.js +17 -0
  25. package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ee.spec.js +54 -0
  26. package/lib/components/CartPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +1 -1
  27. package/lib/components/CartPage/PriceAdjustments/{giftCardSection.js → giftCardSection.ce.js} +0 -0
  28. package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
  29. package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
  30. package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +2 -14
  31. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/discountSummary.spec.js.snap +496 -42
  32. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftCardSummary.ce.spec.js.snap +3 -0
  33. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/{giftCardSummary.spec.js.snap → giftCardSummary.ee.spec.js.snap} +4 -4
  34. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ce.spec.js.snap +3 -0
  35. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ee.spec.js.snap +63 -0
  36. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/priceSummary.spec.js.snap +201 -141
  37. package/lib/components/CartPage/PriceSummary/__tests__/discountSummary.spec.js +41 -1
  38. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ce.spec.js +17 -0
  39. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ee.spec.js +84 -0
  40. package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ce.spec.js +17 -0
  41. package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ee.spec.js +69 -0
  42. package/lib/components/CartPage/PriceSummary/__tests__/priceSummary.spec.js +2 -0
  43. package/lib/components/CartPage/PriceSummary/discountSummary.js +99 -49
  44. package/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
  45. package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
  46. package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
  47. package/lib/components/CartPage/PriceSummary/priceSummary.js +95 -53
  48. package/lib/components/CartPage/PriceSummary/priceSummary.module.css +2 -0
  49. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +57 -0
  50. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +22 -0
  51. package/lib/components/CartPage/ProductListing/EditModal/__tests__/productDetail.spec.js +42 -3
  52. package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +13 -10
  53. package/lib/components/CartPage/ProductListing/EditModal/productForm.js +7 -2
  54. package/lib/components/CartPage/ProductListing/product.js +1 -0
  55. package/lib/components/CartPage/ProductListing/productListing.js +1 -1
  56. package/lib/components/CartPage/cartPage.js +1 -1
  57. package/lib/components/Checkbox/checkbox.js +6 -1
  58. package/lib/components/Checkbox/checkbox.module.css +1 -0
  59. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
  60. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +33 -0
  61. package/lib/components/CheckoutPage/ItemsReview/__tests__/item.spec.js +2 -2
  62. package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
  63. package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/createAccount.spec.js +4 -0
  64. package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +9 -1
  65. package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +12 -3
  66. package/lib/components/CheckoutPage/PaymentInformation/__tests__/__snapshots__/creditCard.spec.js.snap +1 -0
  67. package/lib/components/CheckoutPage/PaymentInformation/__tests__/creditCard.spec.js +2 -1
  68. package/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +2 -18
  69. package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +13 -3
  70. package/lib/components/CheckoutPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -6
  71. package/lib/components/CheckoutPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +2 -2
  72. package/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +8 -12
  73. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +1 -1
  74. package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +4 -1
  75. package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +5 -2
  76. package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +3 -3
  77. package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +5 -0
  78. package/lib/components/CheckoutPage/checkoutPage.js +25 -4
  79. package/lib/components/CheckoutPage/checkoutPage.module.css +8 -1
  80. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ce.spec.js.snap +3 -0
  81. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ee.spec.js.snap +61 -0
  82. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/dynamicBlock.spec.js.snap +7 -0
  83. package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ce.spec.js +17 -0
  84. package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ee.spec.js +211 -0
  85. package/lib/components/CmsDynamicBlock/__tests__/constants.spec.js +37 -0
  86. package/lib/components/CmsDynamicBlock/__tests__/dynamicBlock.spec.js +33 -0
  87. package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ce.js +5 -0
  88. package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ee.js +73 -0
  89. package/lib/components/CmsDynamicBlock/constants.js +6 -0
  90. package/lib/components/CmsDynamicBlock/dynamicBlock.js +32 -0
  91. package/lib/components/CmsDynamicBlock/index.js +2 -0
  92. package/lib/components/CreateAccount/__tests__/createAccount.spec.js +6 -1
  93. package/lib/components/CreateAccount/createAccount.js +7 -2
  94. package/lib/components/Field/field.module.css +6 -0
  95. package/lib/components/FilterSidebar/filterSidebar.js +4 -1
  96. package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +8 -2
  97. package/lib/components/Footer/footer.js +16 -9
  98. package/lib/components/Footer/footer.module.css +7 -2
  99. package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/__snapshots__/forgotPasswordForm.spec.js.snap +109 -1
  100. package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/forgotPasswordForm.spec.js +22 -3
  101. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +13 -3
  102. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.module.css +1 -1
  103. package/lib/components/ForgotPassword/__tests__/__snapshots__/forgotPassword.spec.js.snap +5 -6
  104. package/lib/components/ForgotPassword/__tests__/forgotPassword.spec.js +41 -28
  105. package/lib/components/ForgotPassword/forgotPassword.js +10 -3
  106. package/lib/components/ForgotPassword/forgotPassword.module.css +2 -2
  107. package/lib/components/Gallery/__tests__/__snapshots__/gallery.spec.js.snap +22 -0
  108. package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +17 -0
  109. package/lib/components/Gallery/addToCartButton.js +2 -0
  110. package/lib/components/Gallery/gallery.js +6 -1
  111. package/lib/components/Gallery/item.js +7 -2
  112. package/lib/components/GoogleReCaptcha/googleReCaptcha.js +49 -0
  113. package/lib/components/GoogleReCaptcha/googleReCaptcha.module.css +3 -0
  114. package/lib/components/GoogleReCaptcha/index.js +1 -0
  115. package/lib/components/Header/currencySwitcher.js +2 -1
  116. package/lib/components/Header/header.js +1 -1
  117. package/lib/components/Header/header.module.css +2 -2
  118. package/lib/components/Header/searchTrigger.js +3 -1
  119. package/lib/components/Header/storeSwitcher.js +18 -4
  120. package/lib/components/Header/switcherItem.js +4 -1
  121. package/lib/components/HomePage/homePage.module.css +12 -0
  122. package/lib/components/Image/resourceImage.js +8 -1
  123. package/lib/components/Image/simpleImage.js +8 -1
  124. package/lib/components/Link/link.js +15 -13
  125. package/lib/components/LoadingIndicator/spinner.js +5 -7
  126. package/lib/components/LoadingIndicator/spinner.module.css +4 -17
  127. package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +44 -0
  128. package/lib/components/MiniCart/ProductList/__tests__/item.spec.js +2 -2
  129. package/lib/components/MiniCart/ProductList/item.js +3 -2
  130. package/lib/components/MiniCart/miniCart.js +6 -3
  131. package/lib/components/MyAccount/ResetPassword/__tests__/__snapshots__/resetPassword.spec.js.snap +274 -254
  132. package/lib/components/MyAccount/ResetPassword/__tests__/resetPassword.spec.js +10 -5
  133. package/lib/components/MyAccount/ResetPassword/resetPassword.js +55 -55
  134. package/lib/components/MyAccount/ResetPassword/resetPassword.module.css +27 -79
  135. package/lib/components/Newsletter/newsletter.js +6 -2
  136. package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +11 -0
  137. package/lib/components/ProductFullDetail/productFullDetail.js +12 -3
  138. package/lib/components/ProductImageCarousel/__tests__/__snapshots__/carousel.spec.js.snap +61 -0
  139. package/lib/components/ProductImageCarousel/__tests__/__snapshots__/thumbnail.spec.js.snap +26 -0
  140. package/lib/components/ProductOptions/__tests__/options.spec.js +1 -1
  141. package/lib/components/ProductOptions/__tests__/swatch.spec.js +1 -1
  142. package/lib/components/ProductOptions/__tests__/swatchList.spec.js +1 -1
  143. package/lib/components/ProductOptions/__tests__/tile.spec.js +1 -1
  144. package/lib/components/ProductOptions/__tests__/tileList.spec.js +1 -1
  145. package/lib/components/ProductOptions/option.js +4 -1
  146. package/lib/components/ProductSort/productSort.js +22 -14
  147. package/lib/components/Rating/rating.js +1 -1
  148. package/lib/components/SearchBar/__tests__/__snapshots__/suggestedProduct.spec.js.snap +11 -0
  149. package/lib/components/SearchBar/autocomplete.js +4 -2
  150. package/lib/components/SearchBar/suggestedProduct.js +1 -1
  151. package/lib/components/SearchBar/suggestions.js +1 -1
  152. package/lib/components/SignIn/__tests__/signIn.spec.js +11 -20
  153. package/lib/components/SignIn/signIn.js +6 -16
  154. package/lib/components/TextInput/textInput.module.css +0 -4
  155. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/__tests__/__snapshots__/wishlistLineItem.spec.js.snap +5 -1
  156. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +7 -1
  157. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.module.css +7 -0
  158. package/lib/components/Wishlist/WishlistDialog/__tests__/__snapshots__/wishlistDialog.spec.js.snap +6 -1
  159. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlist.spec.js.snap +4 -0
  160. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistItem.spec.js.snap +22 -0
  161. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +9 -3
  162. package/lib/components/WishlistPage/createWishlist.ee.js +3 -1
  163. package/lib/components/WishlistPage/wishlist.js +1 -1
  164. package/lib/components/WishlistPage/wishlist.module.css +3 -0
  165. package/lib/components/WishlistPage/wishlistPage.js +1 -1
  166. package/package.json +4 -3
  167. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.spec.js +0 -84
@@ -47,11 +47,14 @@ const ProductSort = props => {
47
47
  // click event for menu items
48
48
  const handleItemClick = useCallback(
49
49
  sortAttribute => {
50
- setSort({
51
- sortText: sortAttribute.text,
52
- sortId: sortAttribute.id,
53
- sortAttribute: sortAttribute.attribute,
54
- sortDirection: sortAttribute.sortDirection
50
+ setSort(prevSort => {
51
+ return {
52
+ sortText: sortAttribute.text,
53
+ sortId: sortAttribute.id,
54
+ sortAttribute: sortAttribute.attribute,
55
+ sortDirection: sortAttribute.sortDirection,
56
+ sortFromSearch: prevSort.sortFromSearch
57
+ };
55
58
  });
56
59
  setExpanded(false);
57
60
  },
@@ -74,15 +77,6 @@ const ProductSort = props => {
74
77
  attribute: 'relevance',
75
78
  sortDirection: 'DESC'
76
79
  },
77
- {
78
- id: 'sortItem.position',
79
- text: formatMessage({
80
- id: 'sortItem.position',
81
- defaultMessage: 'Position'
82
- }),
83
- attribute: 'position',
84
- sortDirection: 'ASC'
85
- },
86
80
  {
87
81
  id: 'sortItem.priceDesc',
88
82
  text: formatMessage({
@@ -103,6 +97,19 @@ const ProductSort = props => {
103
97
  }
104
98
  ];
105
99
 
100
+ // Do not display Position in Search
101
+ if (!currentSort.sortFromSearch) {
102
+ defaultSortMethods.push({
103
+ id: 'sortItem.position',
104
+ text: formatMessage({
105
+ id: 'sortItem.position',
106
+ defaultMessage: 'Position'
107
+ }),
108
+ attribute: 'position',
109
+ sortDirection: 'ASC'
110
+ });
111
+ }
112
+
106
113
  const allSortingMethods = sortMethodsFromConfig
107
114
  ? orderSortingList(
108
115
  [sortMethodsFromConfig, defaultSortMethods].flat()
@@ -137,6 +144,7 @@ const ProductSort = props => {
137
144
  classes.menuItem,
138
145
  currentSort.sortAttribute,
139
146
  currentSort.sortDirection,
147
+ currentSort.sortFromSearch,
140
148
  expanded,
141
149
  formatMessage,
142
150
  handleItemClick,
@@ -11,7 +11,7 @@ const Rating = props => {
11
11
  const classes = useStyle(defaultClasses, props.classes);
12
12
 
13
13
  return (
14
- <div className={classes.ratingAverage}>
14
+ <div className={classes.ratingAverage} data-cy="ratingSummary">
15
15
  <span className={classes.ratingValue}>
16
16
  {((rating * 5) / 100).toFixed(1)}
17
17
  </span>{' '}
@@ -10,6 +10,11 @@ Array [
10
10
  className="image placeholder"
11
11
  loading="eager"
12
12
  src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc0JyBoZWlnaHQ9JzUnPjxyZWN0IHdpZHRoPSc0JyBoZWlnaHQ9JzUnIHN0eWxlPSdmaWxsOiBub25lJyAvPjwvc3ZnPg=="
13
+ style={
14
+ Object {
15
+ "--width": "60px",
16
+ }
17
+ }
13
18
  width={60}
14
19
  />
15
20
  <img
@@ -29,6 +34,12 @@ Array [
29
34
  /media/catalog/category/minimalist.jpg 1280w,
30
35
  /media/catalog/category/minimalist.jpg 1600w,
31
36
  /media/catalog/category/minimalist.jpg 2560w"
37
+ style={
38
+ Object {
39
+ "--height": "75px",
40
+ "--width": "60px",
41
+ }
42
+ }
32
43
  width={60}
33
44
  />
34
45
  </div>,
@@ -124,8 +124,10 @@ const Autocomplete = props => {
124
124
  : messageTpl;
125
125
 
126
126
  return (
127
- <div className={rootClassName}>
128
- <div className={classes.message}>{message}</div>
127
+ <div data-cy="Autocomplete-root" className={rootClassName}>
128
+ <div data-cy="Autocomplete-message" className={classes.message}>
129
+ {message}
130
+ </div>
129
131
  <div className={classes.suggestions}>
130
132
  <Suggestions
131
133
  displayResult={displayResult}
@@ -39,7 +39,7 @@ const SuggestedProduct = props => {
39
39
  width={IMAGE_WIDTH}
40
40
  />
41
41
  <span className={classes.name}>{name}</span>
42
- <span className={classes.price}>
42
+ <span data-cy="SuggestedProduct-price" className={classes.price}>
43
43
  <Price
44
44
  currencyCode={price.regularPrice.amount.currency}
45
45
  value={price.regularPrice.amount.value}
@@ -41,7 +41,7 @@ const Suggestions = props => {
41
41
  onNavigate={onNavigate}
42
42
  value={searchValue}
43
43
  />
44
- <h2 className={classes.heading}>
44
+ <h2 data-cy="Suggestions-heading" className={classes.heading}>
45
45
  <span>
46
46
  <FormattedMessage
47
47
  id={'searchBar.heading'}
@@ -4,7 +4,6 @@ import { Form } from 'informed';
4
4
  import { createTestInstance } from '@magento/peregrine';
5
5
 
6
6
  import Button from '../../Button';
7
- import LoadingIndicator from '../../LoadingIndicator';
8
7
  import SignIn from '../signIn';
9
8
  import { useUserContext } from '@magento/peregrine/lib/context/user';
10
9
  import { useMutation } from '@apollo/client';
@@ -17,7 +16,12 @@ jest.mock('@apollo/client', () => ({
17
16
  {
18
17
  error: null
19
18
  }
20
- ])
19
+ ]),
20
+ useQuery: jest.fn().mockImplementation(() => ({
21
+ data: {},
22
+ error: null,
23
+ loading: false
24
+ }))
21
25
  }));
22
26
  jest.mock('../../../classify');
23
27
  jest.mock('../../Button', () => () => <i />);
@@ -65,7 +69,11 @@ const props = {
65
69
  showForgotPassword: jest.fn(),
66
70
  signIn: jest.fn(),
67
71
  hasError: false,
68
- isSigningIn: false
72
+ isSigningIn: false,
73
+ recaptchaWidgetProps: {
74
+ containerElement: jest.fn(),
75
+ shouldRender: false
76
+ }
69
77
  };
70
78
 
71
79
  test('renders correctly', () => {
@@ -74,23 +82,6 @@ test('renders correctly', () => {
74
82
  expect(component.toJSON()).toMatchSnapshot();
75
83
  });
76
84
 
77
- test('renders the loading indicator when form is submitting', () => {
78
- const [userState, userApi] = useUserContext();
79
- useUserContext.mockReturnValueOnce([
80
- { ...userState, isGettingDetails: true },
81
- userApi
82
- ]);
83
-
84
- const testProps = {
85
- ...props
86
- };
87
- const { root } = createTestInstance(<SignIn {...testProps} />);
88
-
89
- act(() => {
90
- expect(root.findByType(LoadingIndicator)).toBeTruthy();
91
- });
92
- });
93
-
94
85
  test('renders prefilled form with initial values', () => {
95
86
  const testProps = {
96
87
  ...props,
@@ -8,13 +8,13 @@ import { useStyle } from '../../classify';
8
8
  import { isRequired } from '../../util/formValidators';
9
9
  import Button from '../Button';
10
10
  import Field from '../Field';
11
- import LoadingIndicator from '../LoadingIndicator';
12
11
  import TextInput from '../TextInput';
13
12
  import defaultClasses from './signIn.module.css';
14
13
  import { GET_CART_DETAILS_QUERY } from './signIn.gql';
15
14
  import LinkButton from '../LinkButton';
16
15
  import Password from '../Password';
17
16
  import FormError from '../FormError/formError';
17
+ import GoogleRecaptcha from '../GoogleReCaptcha';
18
18
 
19
19
  const SignIn = props => {
20
20
  const classes = useStyle(defaultClasses, props.classes);
@@ -39,29 +39,17 @@ const SignIn = props => {
39
39
  handleForgotPassword,
40
40
  handleSubmit,
41
41
  isBusy,
42
- setFormApi
42
+ setFormApi,
43
+ recaptchaWidgetProps
43
44
  } = talonProps;
44
45
 
45
- if (isBusy) {
46
- return (
47
- <div className={classes.modal_active}>
48
- <LoadingIndicator>
49
- <FormattedMessage
50
- id={'signIn.loadingText'}
51
- defaultMessage={'Signing In'}
52
- />
53
- </LoadingIndicator>
54
- </div>
55
- );
56
- }
57
-
58
46
  const forgotPasswordClasses = {
59
47
  root: classes.forgotPasswordButton
60
48
  };
61
49
 
62
50
  return (
63
51
  <div data-cy="SignIn-root" className={classes.root}>
64
- <span className={classes.title}>
52
+ <span data-cy="SignIn-title" className={classes.title}>
65
53
  <FormattedMessage
66
54
  id={'signIn.titleText'}
67
55
  defaultMessage={'Sign-in to Your Account'}
@@ -114,11 +102,13 @@ const SignIn = props => {
114
102
  />
115
103
  </LinkButton>
116
104
  </div>
105
+ <GoogleRecaptcha {...recaptchaWidgetProps} />
117
106
  <div className={classes.buttonsContainer}>
118
107
  <Button
119
108
  priority="high"
120
109
  type="submit"
121
110
  data-cy="SignInButton-root_highPriority"
111
+ disabled={isBusy}
122
112
  >
123
113
  <FormattedMessage
124
114
  id={'signIn.signInText'}
@@ -2,10 +2,6 @@
2
2
  composes: input from '../Field/field.module.css';
3
3
  }
4
4
 
5
- .input:disabled {
6
- color: rgb(var(--venia-global-color-gray-darker));
7
- }
8
-
9
5
  .input_error {
10
6
  composes: input from '../Field/field.module.css';
11
7
  border-color: rgb(var(--venia-global-color-red-400));
@@ -6,5 +6,9 @@ exports[`renders the correct tree 1`] = `
6
6
  disabled={false}
7
7
  onClick={[Function]}
8
8
  type="button"
9
- />
9
+ >
10
+ <h2
11
+ className="lineItemName"
12
+ />
13
+ </button>
10
14
  `;
@@ -20,7 +20,13 @@ const WishlistLineItem = props => {
20
20
  onClick={handleClick}
21
21
  data-cy="WishlistLineItem-button"
22
22
  >
23
- {props.children}
23
+ <h2
24
+ className={classes.lineItemName}
25
+ data-cy="WishlistLineItem-name"
26
+ title={props.children}
27
+ >
28
+ {props.children}
29
+ </h2>
24
30
  </button>
25
31
  );
26
32
  };
@@ -6,3 +6,10 @@
6
6
  font-weight: var(--venia-global-fontWeight-semibold);
7
7
  height: 3.5rem;
8
8
  }
9
+
10
+ .lineItemName {
11
+ overflow: hidden;
12
+ white-space: nowrap;
13
+ text-overflow: ellipsis;
14
+ max-width: 600px;
15
+ }
@@ -41,7 +41,12 @@ exports[`renders existing wishlists 1`] = `
41
41
  onClick={[Function]}
42
42
  type="button"
43
43
  >
44
- "Scott's Wishlist"
44
+ <h2
45
+ className="lineItemName"
46
+ title="\\"Scott's Wishlist\\""
47
+ >
48
+ "Scott's Wishlist"
49
+ </h2>
45
50
  </button>
46
51
  </li>
47
52
  </ul>
@@ -12,6 +12,7 @@ exports[`hides visibility toggle 1`] = `
12
12
  >
13
13
  <h2
14
14
  className="name"
15
+ title="Favorites List"
15
16
  >
16
17
  Favorites List
17
18
  </h2>
@@ -79,6 +80,7 @@ exports[`render closed with items 1`] = `
79
80
  >
80
81
  <h2
81
82
  className="name"
83
+ title="Favorites List"
82
84
  >
83
85
  Favorites List
84
86
  </h2>
@@ -146,6 +148,7 @@ exports[`render loading state 1`] = `
146
148
  >
147
149
  <h2
148
150
  className="name"
151
+ title="Favorites List"
149
152
  >
150
153
  Favorites List
151
154
  </h2>
@@ -289,6 +292,7 @@ exports[`render open with no items 1`] = `
289
292
  >
290
293
  <h2
291
294
  className="name"
295
+ title="Favorites List"
292
296
  >
293
297
  Favorites List
294
298
  </h2>
@@ -20,6 +20,11 @@ exports[`it renders a configurable wishlist item 1`] = `
20
20
  className="image placeholder"
21
21
  loading="eager"
22
22
  src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc0JyBoZWlnaHQ9JzUnPjxyZWN0IHdpZHRoPSc0JyBoZWlnaHQ9JzUnIHN0eWxlPSdmaWxsOiBub25lJyAvPjwvc3ZnPg=="
23
+ style={
24
+ Object {
25
+ "--width": "400px",
26
+ }
27
+ }
23
28
  width={400}
24
29
  />
25
30
  <img
@@ -30,6 +35,12 @@ exports[`it renders a configurable wishlist item 1`] = `
30
35
  onError={[Function]}
31
36
  onLoad={[Function]}
32
37
  src="https://magento.test/shoggoth-shirt.jpg"
38
+ style={
39
+ Object {
40
+ "--height": "500px",
41
+ "--width": "400px",
42
+ }
43
+ }
33
44
  width={400}
34
45
  />
35
46
  </div>
@@ -125,6 +136,11 @@ exports[`it renders a simple wishlist item 1`] = `
125
136
  className="image placeholder"
126
137
  loading="eager"
127
138
  src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc0JyBoZWlnaHQ9JzUnPjxyZWN0IHdpZHRoPSc0JyBoZWlnaHQ9JzUnIHN0eWxlPSdmaWxsOiBub25lJyAvPjwvc3ZnPg=="
139
+ style={
140
+ Object {
141
+ "--width": "400px",
142
+ }
143
+ }
128
144
  width={400}
129
145
  />
130
146
  <img
@@ -135,6 +151,12 @@ exports[`it renders a simple wishlist item 1`] = `
135
151
  onError={[Function]}
136
152
  onLoad={[Function]}
137
153
  src="https://magento.test/shoggoth-shirt.jpg"
154
+ style={
155
+ Object {
156
+ "--height": "500px",
157
+ "--width": "400px",
158
+ }
159
+ }
138
160
  width={400}
139
161
  />
140
162
  </div>
@@ -18,7 +18,9 @@ exports[`empty single wishlist 1`] = `
18
18
  />
19
19
  </h1>
20
20
  <Wishlist />
21
- <CreateWishlist />
21
+ <CreateWishlist
22
+ numberOfWishlists={0}
23
+ />
22
24
  </div>
23
25
  `;
24
26
 
@@ -48,7 +50,9 @@ exports[`renders a single wishlist without visibility toggle 1`] = `
48
50
  }
49
51
  isCollapsed={false}
50
52
  />
51
- <CreateWishlist />
53
+ <CreateWishlist
54
+ numberOfWishlists={1}
55
+ />
52
56
  </div>
53
57
  `;
54
58
 
@@ -229,6 +233,8 @@ exports[`renders wishlist data 1`] = `
229
233
  }
230
234
  isCollapsed={true}
231
235
  />
232
- <CreateWishlist />
236
+ <CreateWishlist
237
+ numberOfWishlists={2}
238
+ />
233
239
  </div>
234
240
  `;
@@ -17,9 +17,11 @@ import FormError from '../FormError/formError';
17
17
  import defaultClasses from './createWishlist.module.css';
18
18
 
19
19
  const CreateWishlist = props => {
20
+ const { numberOfWishlists } = props;
21
+
20
22
  const classes = useStyle(defaultClasses, props.classes);
21
23
 
22
- const talonProps = useCreateWishlist();
24
+ const talonProps = useCreateWishlist({ numberOfWishlists });
23
25
  const {
24
26
  handleCreateList,
25
27
  handleHideModal,
@@ -91,7 +91,7 @@ const Wishlist = props => {
91
91
 
92
92
  const wishlistName = name ? (
93
93
  <div className={classes.nameContainer}>
94
- <h2 className={classes.name} data-cy="Wishlist-name">
94
+ <h2 className={classes.name} data-cy="Wishlist-name" title={name}>
95
95
  {name}
96
96
  </h2>
97
97
  </div>
@@ -27,6 +27,9 @@
27
27
 
28
28
  .name {
29
29
  font-weight: var(--venia-global-fontWeight-semibold);
30
+ overflow: hidden;
31
+ white-space: nowrap;
32
+ text-overflow: ellipsis;
30
33
  }
31
34
 
32
35
  .buttonsContainer {
@@ -74,7 +74,7 @@ const WishlistPage = props => {
74
74
  content = (
75
75
  <Fragment>
76
76
  {wishlistElements}
77
- <CreateWishlist />
77
+ <CreateWishlist numberOfWishlists={wishlists.length} />
78
78
  </Fragment>
79
79
  );
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magento/venia-ui",
3
- "version": "9.2.0",
3
+ "version": "9.3.0-alpha.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,6 +41,7 @@
41
41
  "lodash.throttle": "~4.1.1",
42
42
  "memoize-one": "~5.0.0",
43
43
  "prop-types": "~15.7.2",
44
+ "react-animate-height": "^2.0.23",
44
45
  "react-aria": "~3.4.0",
45
46
  "react-feather": "~2.0.3",
46
47
  "react-helmet-async": "^1.0.2",
@@ -79,8 +80,8 @@
79
80
  "peerDependencies": {
80
81
  "@apollo/client": "~3.4.0",
81
82
  "@magento/babel-preset-peregrine": "~1.2.0",
82
- "@magento/peregrine": "~12.2.0",
83
- "@magento/pwa-buildpack": "~11.1.0",
83
+ "@magento/peregrine": "12.3.0-alpha.1",
84
+ "@magento/pwa-buildpack": "11.2.0-alpha.1",
84
85
  "apollo-cache-persist": "~0.1.1",
85
86
  "braintree-web-drop-in": "~1.16.0",
86
87
  "graphql": "~15.5.0",
@@ -1,84 +0,0 @@
1
- import React from 'react';
2
- import { createTestInstance } from '@magento/peregrine';
3
-
4
- import GiftCardSummary from '../giftCardSummary';
5
-
6
- jest.mock('../../../../classify');
7
-
8
- const defaultProps = {
9
- classes: {
10
- lineItemLabel: 'lineItemLabel',
11
- price: 'price'
12
- },
13
- data: [
14
- {
15
- applied_balance: {
16
- value: 10,
17
- currency: 'USD'
18
- }
19
- }
20
- ]
21
- };
22
-
23
- test('renders gift card summary line item correctly', () => {
24
- const tree = createTestInstance(<GiftCardSummary {...defaultProps} />);
25
-
26
- expect(tree.toJSON()).toMatchSnapshot();
27
- });
28
-
29
- test('renders accumulated gift card value', () => {
30
- const props = {
31
- ...defaultProps,
32
- data: [
33
- {
34
- applied_balance: {
35
- value: 0,
36
- currency: 'USD'
37
- }
38
- },
39
- {
40
- applied_balance: {
41
- value: 1,
42
- currency: 'USD'
43
- }
44
- },
45
- {
46
- applied_balance: {
47
- value: 1,
48
- currency: 'USD'
49
- }
50
- }
51
- ]
52
- };
53
-
54
- const tree = createTestInstance(<GiftCardSummary {...props} />);
55
-
56
- expect(tree.toJSON()).toMatchSnapshot();
57
- });
58
-
59
- test('renders nothing if gift card data is empty', () => {
60
- const props = {
61
- ...defaultProps,
62
- data: []
63
- };
64
- const tree = createTestInstance(<GiftCardSummary {...props} />);
65
-
66
- expect(tree.toJSON()).toMatchSnapshot();
67
- });
68
-
69
- test('renders nothing if gift card value is "0"', () => {
70
- const props = {
71
- ...defaultProps,
72
- data: [
73
- {
74
- applied_balance: {
75
- value: 0,
76
- currency: 'USD'
77
- }
78
- }
79
- ]
80
- };
81
- const tree = createTestInstance(<GiftCardSummary {...props} />);
82
-
83
- expect(tree.toJSON()).toMatchSnapshot();
84
- });