@magento/venia-ui 10.3.0 → 11.3.0-alpha.8

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 (128) hide show
  1. package/i18n/en_US.json +7 -3
  2. package/lib/RootComponents/Category/category.module.css +2 -2
  3. package/lib/components/Accordion/accordion.module.css +1 -1
  4. package/lib/components/Accordion/section.module.css +2 -8
  5. package/lib/components/AccountInformationPage/editForm.module.css +1 -1
  6. package/lib/components/AccountMenu/__tests__/__snapshots__/accountMenu.spec.js.snap +1 -1
  7. package/lib/components/AccountMenu/accountMenu.js +4 -1
  8. package/lib/components/AccountMenu/accountMenu.module.css +10 -9
  9. package/lib/components/AddToCartDialog/addToCartDialog.module.css +4 -8
  10. package/lib/components/AddressBookPage/addEditDialog.module.css +1 -1
  11. package/lib/components/AddressBookPage/addressBookPage.module.css +1 -1
  12. package/lib/components/AddressBookPage/addressCard.module.css +7 -6
  13. package/lib/components/Breadcrumbs/breadcrumbs.module.css +1 -2
  14. package/lib/components/Button/button.module.css +3 -10
  15. package/lib/components/ButtonGroup/button.module.css +5 -5
  16. package/lib/components/CartPage/GiftCards/giftCards.module.css +8 -15
  17. package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.module.css +5 -12
  18. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.module.css +1 -1
  19. package/lib/components/CartPage/ProductListing/EditModal/productForm.module.css +1 -1
  20. package/lib/components/CartPage/ProductListing/product.module.css +4 -11
  21. package/lib/components/CartPage/cartPage.module.css +3 -4
  22. package/lib/components/CategoryTree/categoryLeaf.module.css +1 -1
  23. package/lib/components/Checkbox/checkbox.module.css +7 -11
  24. package/lib/components/Checkout/form.module.css +3 -7
  25. package/lib/components/Checkout/paymentsForm.module.css +2 -3
  26. package/lib/components/Checkout/section.module.css +1 -1
  27. package/lib/components/CheckoutPage/AddressBook/addressBook.module.css +3 -4
  28. package/lib/components/CheckoutPage/AddressBook/addressCard.module.css +4 -4
  29. package/lib/components/CheckoutPage/GuestSignIn/guestSignIn.module.css +11 -11
  30. package/lib/components/CheckoutPage/ItemsReview/itemsReview.module.css +1 -1
  31. package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.module.css +1 -2
  32. package/lib/components/CheckoutPage/OrderSummary/orderSummary.module.css +1 -1
  33. package/lib/components/CheckoutPage/PaymentInformation/braintreeDropin.module.css +6 -6
  34. package/lib/components/CheckoutPage/PaymentInformation/paymentInformation.module.css +1 -1
  35. package/lib/components/CheckoutPage/PaymentInformation/paymentMethods.module.css +1 -3
  36. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.module.css +5 -5
  37. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.module.css +5 -5
  38. package/lib/components/CheckoutPage/ShippingInformation/editModal.module.css +6 -10
  39. package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.module.css +5 -9
  40. package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.module.css +1 -3
  41. package/lib/components/CheckoutPage/checkoutPage.module.css +11 -13
  42. package/lib/components/CmsBlock/cmsBlock.module.css +8 -10
  43. package/lib/components/ContactPage/contactPage.shimmer.module.css +1 -1
  44. package/lib/components/CreateAccount/createAccount.module.css +1 -4
  45. package/lib/components/CreateAccountPage/createAccountPage.module.css +1 -1
  46. package/lib/components/Dialog/dialog.module.css +7 -13
  47. package/lib/components/ErrorView/errorView.module.css +1 -1
  48. package/lib/components/Field/field.module.css +2 -1
  49. package/lib/components/Field/fieldIcons.module.css +8 -12
  50. package/lib/components/Field/message.module.css +3 -7
  51. package/lib/components/FilterModal/CurrentFilters/currentFilter.module.css +1 -3
  52. package/lib/components/FilterModal/CurrentFilters/currentFilters.module.css +1 -4
  53. package/lib/components/FilterModal/filterBlock.module.css +1 -5
  54. package/lib/components/FilterModal/filterModal.module.css +7 -18
  55. package/lib/components/FilterModalOpenButton/filterModalOpenButton.module.css +2 -2
  56. package/lib/components/FilterSidebar/filterSidebar.module.css +5 -10
  57. package/lib/components/Footer/footer.module.css +2 -2
  58. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.module.css +2 -2
  59. package/lib/components/ForgotPasswordPage/forgotPasswordPage.module.css +1 -1
  60. package/lib/components/Gallery/addToCartButton.module.css +3 -5
  61. package/lib/components/Gallery/gallery.module.css +1 -1
  62. package/lib/components/Gallery/item.module.css +1 -4
  63. package/lib/components/Header/currencySwitcher.module.css +17 -28
  64. package/lib/components/Header/header.module.css +2 -2
  65. package/lib/components/Header/onlineIndicator.module.css +2 -2
  66. package/lib/components/Header/storeSwitcher.module.css +9 -16
  67. package/lib/components/HomePage/homePage.module.css +10 -10
  68. package/lib/components/Image/image.module.css +2 -7
  69. package/lib/components/LegacyMiniCart/cartOptions.module.css +1 -1
  70. package/lib/components/LegacyMiniCart/mask.module.css +1 -1
  71. package/lib/components/LegacyMiniCart/miniCart.module.css +2 -8
  72. package/lib/components/LinkButton/linkButton.module.css +1 -2
  73. package/lib/components/LoadingIndicator/indicator.module.css +3 -3
  74. package/lib/components/Main/main.module.css +3 -3
  75. package/lib/components/Mask/mask.module.css +3 -9
  76. package/lib/components/MegaMenu/megaMenuItem.module.css +1 -2
  77. package/lib/components/MegaMenu/submenu.module.css +8 -8
  78. package/lib/components/MiniCart/ProductList/item.module.css +1 -1
  79. package/lib/components/MiniCart/miniCart.js +2 -1
  80. package/lib/components/MiniCart/miniCart.module.css +15 -17
  81. package/lib/components/MyAccount/ResetPassword/resetPassword.module.css +1 -1
  82. package/lib/components/Navigation/navigation.module.css +9 -27
  83. package/lib/components/Newsletter/newsletter.module.css +10 -11
  84. package/lib/components/OrderHistoryPage/OrderDetails/item.module.css +1 -1
  85. package/lib/components/OrderHistoryPage/OrderDetails/orderDetails.module.css +1 -1
  86. package/lib/components/OrderHistoryPage/OrderDetails/orderTotal.module.css +1 -1
  87. package/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.module.css +2 -3
  88. package/lib/components/OrderHistoryPage/__tests__/__snapshots__/orderRow.spec.js.snap +4 -8
  89. package/lib/components/OrderHistoryPage/__tests__/orderRow.spec.js +0 -42
  90. package/lib/components/OrderHistoryPage/orderHistoryPage.module.css +1 -1
  91. package/lib/components/OrderHistoryPage/orderProgressBar.js +22 -8
  92. package/lib/components/OrderHistoryPage/orderRow.js +5 -31
  93. package/lib/components/OrderHistoryPage/orderRow.module.css +5 -9
  94. package/lib/components/PageLoadingIndicator/pageLoadingIndicator.module.css +2 -2
  95. package/lib/components/Pagination/tile.module.css +1 -1
  96. package/lib/components/Password/password.module.css +2 -2
  97. package/lib/components/ProductFullDetail/productFullDetail.module.css +4 -5
  98. package/lib/components/ProductImageCarousel/carousel.module.css +2 -3
  99. package/lib/components/ProductImageCarousel/thumbnail.module.css +1 -1
  100. package/lib/components/ProductOptions/swatch.module.css +9 -10
  101. package/lib/components/ProductOptions/tile.module.css +8 -9
  102. package/lib/components/ProductSort/productSort.module.css +2 -2
  103. package/lib/components/QuantityStepper/quantityStepper.module.css +3 -13
  104. package/lib/components/RadioGroup/radio.module.css +2 -6
  105. package/lib/components/RadioGroup/radioGroup.module.css +1 -5
  106. package/lib/components/RichContent/richContent.module.css +57 -64
  107. package/lib/components/RichText/richText.module.css +6 -7
  108. package/lib/components/SavedPaymentsPage/creditCard.module.css +10 -16
  109. package/lib/components/SavedPaymentsPage/savedPaymentsPage.module.css +2 -4
  110. package/lib/components/SearchBar/autocomplete.module.css +2 -8
  111. package/lib/components/SearchBar/searchBar.module.css +2 -7
  112. package/lib/components/SearchBar/suggestedCategories.module.css +1 -4
  113. package/lib/components/SearchBar/suggestedProducts.module.css +1 -4
  114. package/lib/components/SearchPage/searchPage.module.css +2 -7
  115. package/lib/components/Select/select.module.css +1 -1
  116. package/lib/components/Shimmer/shimmer.module.css +22 -45
  117. package/lib/components/SignIn/signIn.module.css +2 -8
  118. package/lib/components/SignInPage/signInPage.module.css +1 -1
  119. package/lib/components/TextArea/textArea.module.css +2 -2
  120. package/lib/components/TextInput/textInput.module.css +2 -2
  121. package/lib/components/ToastContainer/toast.module.css +4 -4
  122. package/lib/components/WishlistPage/createWishlist.module.css +3 -3
  123. package/lib/components/WishlistPage/wishlist.module.css +4 -4
  124. package/lib/components/WishlistPage/wishlistEditFavoritesListDialog.module.css +1 -1
  125. package/lib/components/WishlistPage/wishlistItem.module.css +1 -1
  126. package/lib/index.module.css +34 -67
  127. package/lib/tokens.module.css +22 -22
  128. package/package.json +2 -2
@@ -1,22 +1,25 @@
1
1
  .root {
2
2
  composes: absolute from global;
3
3
  composes: h-0 from global;
4
- composes: left-[-100vw] from global;
5
4
  composes: max-w-[100vw] from global;
6
5
  composes: opacity-0 from global;
7
6
  composes: overflow-visible from global;
8
7
  composes: top-full from global;
9
8
  composes: z-menu from global;
9
+ composes: -translate-x-1/2 from global;
10
10
  transition: opacity 192ms var(--venia-global-anim-out),
11
11
  visibility 192ms var(--venia-global-anim-out),
12
12
  /* Adding delay to move container off the screen after previous transitions happened */
13
13
  left 0s 192ms;
14
14
  width: calc(100vw - 2rem); /* TODO @TW: review */
15
- transform: translate3d(-50%, 0, 0);
15
+ }
16
+
17
+ .root_closed {
18
+ composes: root;
16
19
 
17
- /* TODO @TW: review (B6) */
18
- /* composes: invisible from global; */
19
- visibility: hidden;
20
+ composes: left-[-100vw] from global;
21
+
22
+ @apply invisible;
20
23
  }
21
24
 
22
25
  .root_open {
@@ -27,9 +30,7 @@
27
30
  transition: opacity 224ms var(--venia-global-anim-in),
28
31
  visibility 224ms var(--venia-global-anim-in), left 0s;
29
32
 
30
- /* TODO @TW: review (B6) */
31
- /* composes: visible from global; */
32
- visibility: visible;
33
+ @apply visible;
33
34
  }
34
35
 
35
36
  /* These heights may change based on PWA-605 and should be based on 1.5 and 2.5 visible items. */
@@ -79,11 +80,8 @@
79
80
 
80
81
  .stockStatusMessageContainer {
81
82
  composes: col-end-span2 from global;
82
- }
83
83
 
84
- /* TODO @TW: cannot compose */
85
- .stockStatusMessageContainer:empty {
86
- display: none;
84
+ composes: empty_hidden from global;
87
85
  }
88
86
 
89
87
  .body {
@@ -104,7 +102,7 @@
104
102
  .quantity_loading {
105
103
  composes: quantity;
106
104
 
107
- composes: opacity-50 from global;
105
+ @apply opacity-50;
108
106
  }
109
107
 
110
108
  .price {
@@ -116,9 +114,9 @@
116
114
  }
117
115
 
118
116
  .price_loading {
119
- composes: quantity;
117
+ composes: price;
120
118
 
121
- composes: opacity-50 from global;
119
+ @apply opacity-50;
122
120
  }
123
121
 
124
122
  .footer {
@@ -141,8 +139,8 @@
141
139
  .checkoutButton {
142
140
  composes: root_highPriority from '../Button/button.module.css';
143
141
 
144
- composes: bg-brand-dark from global;
145
- composes: border-0 from global;
142
+ @apply bg-brand-dark;
143
+ @apply border-0;
146
144
  composes: font-bold from global;
147
145
  composes: m-auto from global;
148
146
  composes: w-[10rem] from global;
@@ -49,5 +49,5 @@
49
49
  composes: lg_border-2 from global;
50
50
  composes: lg_border-solid from global;
51
51
  composes: lg_border-subtle from global;
52
- composes: lg_rounded-md from global;
52
+ composes: lg_rounded-box from global;
53
53
  }
@@ -10,29 +10,23 @@
10
10
  composes: top-0 from global;
11
11
  composes: w-full from global;
12
12
  composes: z-menu from global;
13
+ composes: invisible from global;
13
14
  grid-template-rows: auto 1fr auto;
14
15
  transform: translate3d(-100%, 0, 0);
15
16
  transition-duration: 192ms;
16
17
  transition-property: opacity, transform, visibility;
17
18
  transition-timing-function: var(--venia-global-anim-out);
18
-
19
- /* TODO @TW: review (B6) */
20
- /* composes: invisible from global; */
21
- visibility: hidden;
22
19
  }
23
20
 
24
21
  .root_open {
25
22
  composes: root;
26
23
 
27
- composes: opacity-100 from global;
24
+ @apply opacity-100;
28
25
  composes: shadow-modal from global;
26
+ @apply visible;
29
27
  transform: translate3d(0, 0, 0);
30
28
  transition-duration: 384ms;
31
29
  transition-timing-function: var(--venia-global-anim-in);
32
-
33
- /* TODO @TW: review (B6) */
34
- /* composes: visible from global; */
35
- visibility: visible;
36
30
  }
37
31
 
38
32
  .header {
@@ -53,25 +47,19 @@
53
47
  composes: min-h-0 from global;
54
48
  composes: opacity-100 from global;
55
49
  composes: overflow-auto from global;
50
+ composes: visible from global;
56
51
  transition-duration: 192ms;
57
52
  transition-property: opacity, visibility;
58
53
  transition-timing-function: var(--venia-global-anim-out);
59
-
60
- /* TODO @TW: review (B6) */
61
- /* composes: visible from global; */
62
- visibility: visible;
63
54
  }
64
55
 
65
56
  .body_masked {
66
57
  composes: body;
67
58
 
68
- composes: opacity-0 from global;
59
+ @apply opacity-0;
60
+ @apply invisible;
69
61
  transition-duration: 384ms;
70
62
  transition-timing-function: var(--venia-global-anim-in);
71
-
72
- /* TODO @TW: review (B6) */
73
- /* composes: invisible from global; */
74
- visibility: hidden;
75
63
  }
76
64
 
77
65
  .footer {
@@ -96,25 +84,19 @@
96
84
  composes: overflow-auto from global;
97
85
  composes: right-0 from global;
98
86
  composes: top-lg from global;
87
+ composes: invisible from global;
99
88
  transform: translate3d(-100%, 0, 0);
100
89
  transition-duration: 192ms;
101
90
  transition-property: opacity, transform, visibility;
102
91
  transition-timing-function: var(--venia-global-anim-out);
103
-
104
- /* TODO @TW: review (B6) */
105
- /* composes: invisible from global; */
106
- visibility: hidden;
107
92
  }
108
93
 
109
94
  .modal_open {
110
95
  composes: modal;
111
96
 
112
- composes: opacity-100 from global;
97
+ @apply opacity-100;
98
+ @apply visible;
113
99
  transform: translate3d(0, 0, 0);
114
100
  transition-duration: 384ms;
115
101
  transition-timing-function: var(--venia-global-anim-in);
116
-
117
- /* TODO @TW: review (B6) */
118
- /* composes: visible from global; */
119
- visibility: visible;
120
102
  }
@@ -16,25 +16,24 @@
16
16
  composes: relative from global;
17
17
  }
18
18
 
19
- /* TODO @TW: cannot compose */
20
19
  .form input {
21
- /* TODO @TW: review */
22
- padding-right: calc(1.875rem * var(--iconsAfter) + 5.625rem);
20
+ padding-right: calc(
21
+ theme(spacing[7.5]) * var(--iconsAfter) + theme(spacing[2.5]) +
22
+ theme(spacing[20])
23
+ );
23
24
  }
24
25
 
25
- @media (max-width: 799px) {
26
- /* TODO @TW: cannot compose */
26
+ @media screen(-md) {
27
27
  .form input {
28
- /* TODO @TW: review */
29
- padding-right: calc(1.875rem * var(--iconsAfter) + 0.625rem);
28
+ padding-right: calc(
29
+ theme(spacing[7.5]) * var(--iconsAfter) + theme(spacing[2.5])
30
+ );
30
31
  }
31
32
  }
32
33
 
33
- /* TODO @TW: cannot compose */
34
34
  .form label {
35
- position: absolute;
36
- z-index: -1;
37
- /* composes: z-behind from global; */
35
+ @apply absolute;
36
+ @apply z-behind;
38
37
  }
39
38
 
40
39
  .buttonsContainer {
@@ -8,7 +8,7 @@
8
8
  composes: lg_gap-y-1.5 from global;
9
9
  }
10
10
 
11
- @media (min-width: 960px) {
11
+ @media screen(lg) {
12
12
  .root {
13
13
  grid-template-columns: auto repeat(3, 1fr) auto;
14
14
  grid-template-rows: repeat(5, auto);
@@ -64,7 +64,7 @@
64
64
  * Mobile-specific styles.
65
65
  */
66
66
 
67
- @media (max-width: 959px) {
67
+ @media screen(-lg) {
68
68
  .shippingInformationContainer {
69
69
  grid-row: 1 / span 1;
70
70
  grid-column: 1 / span 1;
@@ -10,7 +10,7 @@
10
10
  composes: lg_border-solid from global;
11
11
  composes: lg_border-subtle from global;
12
12
  composes: lg_p-md from global;
13
- composes: lg_rounded-md from global;
13
+ composes: lg_rounded-box from global;
14
14
  }
15
15
 
16
16
  .heading {
@@ -8,9 +8,8 @@
8
8
  composes: pb-1.5 from global;
9
9
  }
10
10
 
11
- /* TODO @TW: cannot compose */
12
- .method:empty {
13
- display: none;
11
+ .method {
12
+ composes: empty_hidden from global;
14
13
  }
15
14
 
16
15
  .tracking {
@@ -119,11 +119,10 @@ exports[`it does not render order details if loading is true 1`] = `
119
119
  <span
120
120
  className="orderStatusBadge"
121
121
  >
122
- Delivered
122
+ Complete
123
123
  </span>
124
124
  <div
125
125
  componentName="OrderProgressBar"
126
- status="Delivered"
127
126
  />
128
127
  </div>
129
128
  <button
@@ -278,11 +277,10 @@ exports[`it renders collapsed order row 1`] = `
278
277
  <span
279
278
  className="orderStatusBadge"
280
279
  >
281
- Delivered
280
+ Complete
282
281
  </span>
283
282
  <div
284
283
  componentName="OrderProgressBar"
285
- status="Delivered"
286
284
  />
287
285
  </div>
288
286
  <button
@@ -565,11 +563,10 @@ exports[`it renders open order row 1`] = `
565
563
  <span
566
564
  className="orderStatusBadge"
567
565
  >
568
- Delivered
566
+ Complete
569
567
  </span>
570
568
  <div
571
569
  componentName="OrderProgressBar"
572
- status="Delivered"
573
570
  />
574
571
  </div>
575
572
  <button
@@ -862,11 +859,10 @@ exports[`it renders with missing order information 1`] = `
862
859
  <span
863
860
  className="orderStatusBadge"
864
861
  >
865
- Shipped
862
+ Received
866
863
  </span>
867
864
  <div
868
865
  componentName="OrderProgressBar"
869
- status="Shipped"
870
866
  />
871
867
  </div>
872
868
  <button
@@ -226,48 +226,6 @@ test('it renders open order row', () => {
226
226
  expect(tree.toJSON()).toMatchSnapshot();
227
227
  });
228
228
 
229
- test('it renders shipped status', () => {
230
- useOrderRow.mockReturnValue({
231
- loading: false,
232
- imagesData,
233
- isOpen: false,
234
- handleContentToggle: jest.fn()
235
- });
236
-
237
- const orderWithInvoice = {
238
- ...mockOrder,
239
- invoices: [1]
240
- };
241
- const tree = createTestInstance(<OrderRow order={orderWithInvoice} />);
242
- const { root } = tree;
243
- const orderProgressProps = root.findByProps({
244
- componentName: 'OrderProgressBar'
245
- }).props;
246
-
247
- expect(orderProgressProps.status).toBe('Delivered');
248
- });
249
-
250
- test('it renders delivered status', () => {
251
- useOrderRow.mockReturnValue({
252
- loading: false,
253
- imagesData,
254
- isOpen: false,
255
- handleContentToggle: jest.fn()
256
- });
257
-
258
- const completedOrder = {
259
- ...mockOrder,
260
- status: 'Complete'
261
- };
262
- const tree = createTestInstance(<OrderRow order={completedOrder} />);
263
- const { root } = tree;
264
- const orderProgressProps = root.findByProps({
265
- componentName: 'OrderProgressBar'
266
- }).props;
267
-
268
- expect(orderProgressProps.status).toBe('Delivered');
269
- });
270
-
271
229
  test('it renders with missing order information', () => {
272
230
  useOrderRow.mockReturnValue({
273
231
  loading: false,
@@ -55,7 +55,7 @@
55
55
  composes: root_highPriority from '../Button/button.module.css';
56
56
 
57
57
  composes: h-[2rem] from global;
58
- composes: min-w-[5rem] from global;
58
+ @apply min-w-[5rem];
59
59
  composes: w-[5rem] from global;
60
60
  }
61
61
 
@@ -13,35 +13,49 @@ const OrderProgressBar = props => {
13
13
  const statusStepMap = new Map([
14
14
  [
15
15
  formatMessage({
16
- id: 'orderProgressBar.processingText',
17
- defaultMessage: 'Processing'
16
+ id: 'orderProgressBar.newText',
17
+ defaultMessage: 'new'
18
18
  }),
19
19
  1
20
20
  ],
21
21
  [
22
22
  formatMessage({
23
- id: 'orderProgressBar.readyToShipText',
24
- defaultMessage: 'Ready to ship'
23
+ id: 'orderProgressBar.processingText',
24
+ defaultMessage: 'Progressing'
25
25
  }),
26
26
  2
27
27
  ],
28
28
  [
29
29
  formatMessage({
30
- id: 'orderProgressBar.shippedText',
31
- defaultMessage: 'Shipped'
30
+ id: 'orderProgressBar.pendingPaymentText',
31
+ defaultMessage: 'pending_payment'
32
+ }),
33
+ 3
34
+ ],
35
+ [
36
+ formatMessage({
37
+ id: 'orderProgressBar.paymentReviewText',
38
+ defaultMessage: 'payment_review'
32
39
  }),
33
40
  3
34
41
  ],
35
42
  [
36
43
  formatMessage({
37
44
  id: 'orderProgressBar.deliveredText',
38
- defaultMessage: 'Delivered'
45
+ defaultMessage: 'complete'
39
46
  }),
40
47
  4
48
+ ],
49
+ [
50
+ formatMessage({
51
+ id: 'orderProgressBar.closedText',
52
+ defaultMessage: 'Closed'
53
+ }),
54
+ 0
41
55
  ]
42
56
  ]);
43
- const currentStep = statusStepMap.get(status);
44
57
 
58
+ const currentStep = statusStepMap.get(status);
45
59
  const classes = useStyle(defaultClasses, props.classes);
46
60
 
47
61
  const stepElements = useMemo(() => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { arrayOf, number, shape, string } from 'prop-types';
3
3
  import { ChevronDown, ChevronUp } from 'react-feather';
4
- import { FormattedMessage, useIntl } from 'react-intl';
4
+ import { FormattedMessage } from 'react-intl';
5
5
  import Price from '@magento/venia-ui/lib/components/Price';
6
6
  import { useOrderRow } from '@magento/peregrine/lib/talons/OrderHistoryPage/useOrderRow';
7
7
 
@@ -14,14 +14,12 @@ import defaultClasses from './orderRow.module.css';
14
14
 
15
15
  const OrderRow = props => {
16
16
  const { order } = props;
17
- const { formatMessage } = useIntl();
18
17
  const {
19
- invoices,
20
18
  items,
21
19
  number: orderNumber,
22
20
  order_date: orderDate,
23
- shipments,
24
21
  status,
22
+ state,
25
23
  total
26
24
  } = order;
27
25
  const { grand_total: grandTotal } = total;
@@ -38,30 +36,8 @@ const OrderRow = props => {
38
36
  }
39
37
  );
40
38
 
41
- const hasInvoice = !!invoices.length;
42
- const hasShipment = !!shipments.length;
43
- let derivedStatus;
44
- if (status === 'Complete') {
45
- derivedStatus = formatMessage({
46
- id: 'orderRow.deliveredText',
47
- defaultMessage: 'Delivered'
48
- });
49
- } else if (hasShipment) {
50
- derivedStatus = formatMessage({
51
- id: 'orderRow.shippedText',
52
- defaultMessage: 'Shipped'
53
- });
54
- } else if (hasInvoice) {
55
- derivedStatus = formatMessage({
56
- id: 'orderRow.readyToShipText',
57
- defaultMessage: 'Ready to ship'
58
- });
59
- } else {
60
- derivedStatus = formatMessage({
61
- id: 'orderRow.processingText',
62
- defaultMessage: 'Processing'
63
- });
64
- }
39
+ const derivedStatus = status;
40
+ const derivedProgress = state;
65
41
 
66
42
  const talonProps = useOrderRow({ items });
67
43
  const { loading, isOpen, handleContentToggle, imagesData } = talonProps;
@@ -88,7 +64,6 @@ const OrderRow = props => {
88
64
  ) : (
89
65
  '-'
90
66
  );
91
-
92
67
  return (
93
68
  <li className={classes.root}>
94
69
  <div className={classes.orderNumberContainer}>
@@ -125,7 +100,7 @@ const OrderRow = props => {
125
100
  <span className={classes.orderStatusBadge}>
126
101
  {derivedStatus}
127
102
  </span>
128
- <OrderProgressBar status={derivedStatus} />
103
+ <OrderProgressBar status={derivedProgress} />
129
104
  </div>
130
105
  <button
131
106
  className={classes.contentToggleContainer}
@@ -141,7 +116,6 @@ const OrderRow = props => {
141
116
  };
142
117
 
143
118
  export default OrderRow;
144
-
145
119
  OrderRow.propTypes = {
146
120
  classes: shape({
147
121
  root: string,
@@ -4,10 +4,10 @@
4
4
  composes: border-subtle from global;
5
5
  composes: grid from global;
6
6
  composes: grid-cols-2 from global;
7
- composes: rounded-md from global;
7
+ composes: rounded-box from global;
8
8
  }
9
9
 
10
- @media (min-width: 960px) {
10
+ @media screen(lg) {
11
11
  .root {
12
12
  grid-template-columns:
13
13
  minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(9rem, 1fr)
@@ -73,6 +73,7 @@
73
73
  composes: grid from global;
74
74
  composes: overflow-hidden from global;
75
75
  composes: p-sm from global;
76
+ composes: max-lg_empty_hidden from global;
76
77
 
77
78
  composes: lg_border-b-0 from global;
78
79
  composes: lg_border-l from global;
@@ -134,7 +135,7 @@
134
135
  composes: justify-self-start from global;
135
136
  composes: px-xs from global;
136
137
  composes: py-1 from global;
137
- composes: rounded-md from global;
138
+ composes: rounded-badge from global;
138
139
  composes: text-2xs from global;
139
140
  }
140
141
 
@@ -150,12 +151,7 @@
150
151
  composes: hidden from global;
151
152
  }
152
153
 
153
- @media (max-width: 959px) {
154
- /* TODO @TW: cannot compose */
155
- .orderItemsContainer:empty {
156
- display: none;
157
- }
158
-
154
+ @media screen(-lg) {
159
155
  .orderNumberContainer {
160
156
  grid-column: 1 / span 2;
161
157
  grid-row: 1;
@@ -34,12 +34,12 @@
34
34
 
35
35
  .indicator_loading {
36
36
  composes: indicator_off;
37
- composes: opacity-100 from global;
37
+ @apply opacity-100;
38
38
  transform: translateX(-25%);
39
39
  }
40
40
 
41
41
  .indicator_done {
42
42
  composes: indicator_off;
43
- composes: opacity-100 from global;
43
+ @apply opacity-100;
44
44
  transform: translateX(0%);
45
45
  }
@@ -13,5 +13,5 @@
13
13
  .root_active {
14
14
  composes: root;
15
15
 
16
- composes: border-currentColor from global;
16
+ @apply border-currentColor;
17
17
  }
@@ -8,8 +8,8 @@
8
8
  --stroke: var(--venia-global-color-gray-500);
9
9
 
10
10
  composes: bg-transparent from global;
11
- composes: border-none from global;
12
- composes: border-0 from global;
11
+ @apply border-none;
12
+ @apply border-0;
13
13
  composes: min-w-0 from global;
14
14
  composes: p-0 from global;
15
15
  composes: rounded-none from global;
@@ -9,7 +9,7 @@
9
9
  composes: lg_py-md from global;
10
10
  }
11
11
 
12
- @media (min-width: 960px) {
12
+ @media screen(lg) {
13
13
  .root {
14
14
  grid-template-areas:
15
15
  'images title'
@@ -55,8 +55,7 @@
55
55
  composes: grid from global;
56
56
  composes: items-center from global;
57
57
  composes: leading-normal from global;
58
- composes: px-sm from global;
59
- composes: py-xs from global;
58
+ @apply py-xs;
60
59
  grid-area: title;
61
60
  }
62
61
 
@@ -155,7 +154,7 @@
155
154
  list-style: none;
156
155
  }
157
156
 
158
- @media (min-width: 1024px) {
157
+ @media screen(xl) {
159
158
  .details {
160
159
  align-self: stretch;
161
160
  border-top-width: 1px;
@@ -170,7 +169,7 @@
170
169
  }
171
170
 
172
171
  .related {
173
- composes: border-b-0 from global;
172
+ @apply border-b-0;
174
173
  composes: section;
175
174
  grid-column: 1 / span 2;
176
175
  }
@@ -8,7 +8,7 @@
8
8
  'thumbs';
9
9
  }
10
10
 
11
- @media (min-width: 960px) {
11
+ @media screen(lg) {
12
12
  .root {
13
13
  grid-template-areas: 'thumbs main';
14
14
  /* These values are mirrored in JS for image sizes. Keep them in sync. */
@@ -72,11 +72,10 @@
72
72
  composes: self-center from global;
73
73
  }
74
74
 
75
- /* TODO @TW: cannot compose */
76
75
  .nextButton:focus > .chevron,
77
76
  .previousButton:focus > .chevron {
78
77
  box-shadow: 0 0 4px 2px rgb(var(--venia-global-color-teal));
79
- border-radius: 0.5rem;
78
+ @apply rounded-lg;
80
79
  }
81
80
 
82
81
  .thumbnailList {
@@ -35,7 +35,7 @@
35
35
  }
36
36
 
37
37
  /* For desktop mode where buttons are an image... */
38
- @media (min-width: 960px) {
38
+ @media screen(lg) {
39
39
  .rootSelected {
40
40
  composes: root;
41
41