@magento/venia-ui 9.4.0-alpha.1 → 9.4.0-beta.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.
@@ -70,6 +70,11 @@ const GalleryItem = props => {
70
70
  </div>
71
71
  );
72
72
 
73
+ // fallback to regular price when final price is unavailable
74
+ const priceSource =
75
+ price_range.maximum_price.final_price ||
76
+ price_range.maximum_price.regular_price;
77
+
73
78
  // Hide the Rating component until it is updated with the new look and feel (PWA-2512).
74
79
  const ratingAverage = null;
75
80
  // const ratingAverage = rating_summary ? (
@@ -112,10 +117,8 @@ const GalleryItem = props => {
112
117
  </Link>
113
118
  <div data-cy="GalleryItem-price" className={classes.price}>
114
119
  <Price
115
- value={price_range.maximum_price.final_price.value}
116
- currencyCode={
117
- price_range.maximum_price.final_price.currency
118
- }
120
+ value={priceSource.value}
121
+ currencyCode={priceSource.currency}
119
122
  />
120
123
  </div>
121
124
 
@@ -155,6 +158,10 @@ GalleryItem.propTypes = {
155
158
  final_price: shape({
156
159
  value: number.isRequired,
157
160
  currency: string.isRequired
161
+ }),
162
+ regular_price: shape({
163
+ value: number.isRequired,
164
+ currency: string.isRequired
158
165
  }).isRequired
159
166
  }).isRequired
160
167
  }).isRequired
@@ -7,6 +7,13 @@ exports[`it disables the add to cart button when the talon indicates 1`] = `
7
7
  onReset={[Function]}
8
8
  onSubmit={[Function]}
9
9
  >
10
+ <section
11
+ className="imageCarousel"
12
+ >
13
+ <ProductImageCarousel
14
+ images={Array []}
15
+ />
16
+ </section>
10
17
  <section
11
18
  className="title"
12
19
  >
@@ -32,13 +39,6 @@ exports[`it disables the add to cart button when the talon indicates 1`] = `
32
39
  </span>
33
40
  </p>
34
41
  </section>
35
- <section
36
- className="imageCarousel"
37
- >
38
- <ProductImageCarousel
39
- images={Array []}
40
- />
41
- </section>
42
42
  <FormError
43
43
  classes={
44
44
  Object {
@@ -182,6 +182,13 @@ exports[`it does not render options if the product is not a ConfigurableProduct
182
182
  onReset={[Function]}
183
183
  onSubmit={[Function]}
184
184
  >
185
+ <section
186
+ className="imageCarousel"
187
+ >
188
+ <ProductImageCarousel
189
+ images={Array []}
190
+ />
191
+ </section>
185
192
  <section
186
193
  className="title"
187
194
  >
@@ -207,13 +214,6 @@ exports[`it does not render options if the product is not a ConfigurableProduct
207
214
  </span>
208
215
  </p>
209
216
  </section>
210
- <section
211
- className="imageCarousel"
212
- >
213
- <ProductImageCarousel
214
- images={Array []}
215
- />
216
- </section>
217
217
  <FormError
218
218
  classes={
219
219
  Object {
@@ -327,6 +327,13 @@ exports[`it renders an error for an invalid cart 1`] = `
327
327
  onReset={[Function]}
328
328
  onSubmit={[Function]}
329
329
  >
330
+ <section
331
+ className="imageCarousel"
332
+ >
333
+ <ProductImageCarousel
334
+ images={Array []}
335
+ />
336
+ </section>
330
337
  <section
331
338
  className="title"
332
339
  >
@@ -352,13 +359,6 @@ exports[`it renders an error for an invalid cart 1`] = `
352
359
  </span>
353
360
  </p>
354
361
  </section>
355
- <section
356
- className="imageCarousel"
357
- >
358
- <ProductImageCarousel
359
- images={Array []}
360
- />
361
- </section>
362
362
  <FormError
363
363
  classes={
364
364
  Object {
@@ -506,6 +506,13 @@ exports[`it renders an error for an invalid user token when adding to cart 1`] =
506
506
  onReset={[Function]}
507
507
  onSubmit={[Function]}
508
508
  >
509
+ <section
510
+ className="imageCarousel"
511
+ >
512
+ <ProductImageCarousel
513
+ images={Array []}
514
+ />
515
+ </section>
509
516
  <section
510
517
  className="title"
511
518
  >
@@ -531,13 +538,6 @@ exports[`it renders an error for an invalid user token when adding to cart 1`] =
531
538
  </span>
532
539
  </p>
533
540
  </section>
534
- <section
535
- className="imageCarousel"
536
- >
537
- <ProductImageCarousel
538
- images={Array []}
539
- />
540
- </section>
541
541
  <FormError
542
542
  classes={
543
543
  Object {
@@ -690,6 +690,13 @@ Array [
690
690
  onReset={[Function]}
691
691
  onSubmit={[Function]}
692
692
  >
693
+ <section
694
+ className="imageCarousel"
695
+ >
696
+ <ProductImageCarousel
697
+ images={Array []}
698
+ />
699
+ </section>
693
700
  <section
694
701
  className="title"
695
702
  >
@@ -715,13 +722,6 @@ Array [
715
722
  </span>
716
723
  </p>
717
724
  </section>
718
- <section
719
- className="imageCarousel"
720
- >
721
- <ProductImageCarousel
722
- images={Array []}
723
- />
724
- </section>
725
725
  <FormError
726
726
  classes={
727
727
  Object {
@@ -866,6 +866,13 @@ exports[`it renders correctly 1`] = `
866
866
  onReset={[Function]}
867
867
  onSubmit={[Function]}
868
868
  >
869
+ <section
870
+ className="imageCarousel"
871
+ >
872
+ <ProductImageCarousel
873
+ images={Array []}
874
+ />
875
+ </section>
869
876
  <section
870
877
  className="title"
871
878
  >
@@ -891,13 +898,6 @@ exports[`it renders correctly 1`] = `
891
898
  </span>
892
899
  </p>
893
900
  </section>
894
- <section
895
- className="imageCarousel"
896
- >
897
- <ProductImageCarousel
898
- images={Array []}
899
- />
900
- </section>
901
901
  <FormError
902
902
  classes={
903
903
  Object {
@@ -1041,6 +1041,13 @@ exports[`it renders field level errors for quantity - message 1 1`] = `
1041
1041
  onReset={[Function]}
1042
1042
  onSubmit={[Function]}
1043
1043
  >
1044
+ <section
1045
+ className="imageCarousel"
1046
+ >
1047
+ <ProductImageCarousel
1048
+ images={Array []}
1049
+ />
1050
+ </section>
1044
1051
  <section
1045
1052
  className="title"
1046
1053
  >
@@ -1066,13 +1073,6 @@ exports[`it renders field level errors for quantity - message 1 1`] = `
1066
1073
  </span>
1067
1074
  </p>
1068
1075
  </section>
1069
- <section
1070
- className="imageCarousel"
1071
- >
1072
- <ProductImageCarousel
1073
- images={Array []}
1074
- />
1075
- </section>
1076
1076
  <FormError
1077
1077
  classes={
1078
1078
  Object {
@@ -1216,6 +1216,13 @@ exports[`it renders field level errors for quantity - message 2 1`] = `
1216
1216
  onReset={[Function]}
1217
1217
  onSubmit={[Function]}
1218
1218
  >
1219
+ <section
1220
+ className="imageCarousel"
1221
+ >
1222
+ <ProductImageCarousel
1223
+ images={Array []}
1224
+ />
1225
+ </section>
1219
1226
  <section
1220
1227
  className="title"
1221
1228
  >
@@ -1241,13 +1248,6 @@ exports[`it renders field level errors for quantity - message 2 1`] = `
1241
1248
  </span>
1242
1249
  </p>
1243
1250
  </section>
1244
- <section
1245
- className="imageCarousel"
1246
- >
1247
- <ProductImageCarousel
1248
- images={Array []}
1249
- />
1250
- </section>
1251
1251
  <FormError
1252
1252
  classes={
1253
1253
  Object {
@@ -1391,6 +1391,13 @@ exports[`it renders field level errors for quantity - message 3 1`] = `
1391
1391
  onReset={[Function]}
1392
1392
  onSubmit={[Function]}
1393
1393
  >
1394
+ <section
1395
+ className="imageCarousel"
1396
+ >
1397
+ <ProductImageCarousel
1398
+ images={Array []}
1399
+ />
1400
+ </section>
1394
1401
  <section
1395
1402
  className="title"
1396
1403
  >
@@ -1416,13 +1423,6 @@ exports[`it renders field level errors for quantity - message 3 1`] = `
1416
1423
  </span>
1417
1424
  </p>
1418
1425
  </section>
1419
- <section
1420
- className="imageCarousel"
1421
- >
1422
- <ProductImageCarousel
1423
- images={Array []}
1424
- />
1425
- </section>
1426
1426
  <FormError
1427
1427
  classes={
1428
1428
  Object {
@@ -1566,6 +1566,13 @@ exports[`it renders form level errors 1`] = `
1566
1566
  onReset={[Function]}
1567
1567
  onSubmit={[Function]}
1568
1568
  >
1569
+ <section
1570
+ className="imageCarousel"
1571
+ >
1572
+ <ProductImageCarousel
1573
+ images={Array []}
1574
+ />
1575
+ </section>
1569
1576
  <section
1570
1577
  className="title"
1571
1578
  >
@@ -1591,13 +1598,6 @@ exports[`it renders form level errors 1`] = `
1591
1598
  </span>
1592
1599
  </p>
1593
1600
  </section>
1594
- <section
1595
- className="imageCarousel"
1596
- >
1597
- <ProductImageCarousel
1598
- images={Array []}
1599
- />
1600
- </section>
1601
1601
  <FormError
1602
1602
  classes={
1603
1603
  Object {
@@ -1745,6 +1745,13 @@ exports[`it renders message with unsupported product type 1`] = `
1745
1745
  onReset={[Function]}
1746
1746
  onSubmit={[Function]}
1747
1747
  >
1748
+ <section
1749
+ className="imageCarousel"
1750
+ >
1751
+ <ProductImageCarousel
1752
+ images={Array []}
1753
+ />
1754
+ </section>
1748
1755
  <section
1749
1756
  className="title"
1750
1757
  >
@@ -1770,13 +1777,6 @@ exports[`it renders message with unsupported product type 1`] = `
1770
1777
  </span>
1771
1778
  </p>
1772
1779
  </section>
1773
- <section
1774
- className="imageCarousel"
1775
- >
1776
- <ProductImageCarousel
1777
- images={Array []}
1778
- />
1779
- </section>
1780
1780
  <FormError
1781
1781
  classes={
1782
1782
  Object {
@@ -1933,6 +1933,13 @@ exports[`out of stock disabled CTA button is rendered if out of stock 1`] = `
1933
1933
  onReset={[Function]}
1934
1934
  onSubmit={[Function]}
1935
1935
  >
1936
+ <section
1937
+ className="imageCarousel"
1938
+ >
1939
+ <ProductImageCarousel
1940
+ images={Array []}
1941
+ />
1942
+ </section>
1936
1943
  <section
1937
1944
  className="title"
1938
1945
  >
@@ -1958,13 +1965,6 @@ exports[`out of stock disabled CTA button is rendered if out of stock 1`] = `
1958
1965
  </span>
1959
1966
  </p>
1960
1967
  </section>
1961
- <section
1962
- className="imageCarousel"
1963
- >
1964
- <ProductImageCarousel
1965
- images={Array []}
1966
- />
1967
- </section>
1968
1968
  <FormError
1969
1969
  classes={
1970
1970
  Object {
@@ -2078,6 +2078,13 @@ exports[`renders a WishlistButton with props 1`] = `
2078
2078
  onReset={[Function]}
2079
2079
  onSubmit={[Function]}
2080
2080
  >
2081
+ <section
2082
+ className="imageCarousel"
2083
+ >
2084
+ <ProductImageCarousel
2085
+ images={Array []}
2086
+ />
2087
+ </section>
2081
2088
  <section
2082
2089
  className="title"
2083
2090
  >
@@ -2103,13 +2110,6 @@ exports[`renders a WishlistButton with props 1`] = `
2103
2110
  </span>
2104
2111
  </p>
2105
2112
  </section>
2106
- <section
2107
- className="imageCarousel"
2108
- >
2109
- <ProductImageCarousel
2110
- images={Array []}
2111
- />
2112
- </section>
2113
2113
  <FormError
2114
2114
  classes={
2115
2115
  Object {
@@ -224,6 +224,9 @@ const ProductFullDetail = props => {
224
224
  data-cy="ProductFullDetail-root"
225
225
  onSubmit={handleAddToCart}
226
226
  >
227
+ <section className={classes.imageCarousel}>
228
+ <Carousel images={mediaGalleryEntries} />
229
+ </section>
227
230
  <section className={classes.title}>
228
231
  <h1
229
232
  className={classes.productName}
@@ -242,9 +245,6 @@ const ProductFullDetail = props => {
242
245
  </p>
243
246
  {shortDescription}
244
247
  </section>
245
- <section className={classes.imageCarousel}>
246
- <Carousel images={mediaGalleryEntries} />
247
- </section>
248
248
  <FormError
249
249
  classes={{
250
250
  root: classes.formErrors
@@ -21,6 +21,10 @@
21
21
  grid-template-columns: minmax(0, 1.5625fr) minmax(0, 1fr);
22
22
  grid-template-rows: repeat(5, min-content) 1fr [fold];
23
23
  }
24
+
25
+ .title {
26
+ grid-template-columns: 1fr max-content;
27
+ }
24
28
  }
25
29
 
26
30
  .section {
@@ -33,7 +37,7 @@
33
37
  composes: my-0 from global;
34
38
  composes: mx-sm from global;
35
39
  composes: px-0 from global;
36
- composes: py-sm from global;
40
+ composes: py-xs from global;
37
41
  }
38
42
 
39
43
  .sectionTitle {
@@ -46,16 +50,14 @@
46
50
  }
47
51
 
48
52
  .title {
49
- composes: gap-xs from global;
53
+ composes: section;
54
+ composes: gap-2 from global;
50
55
  composes: grid from global;
51
56
  composes: items-center from global;
52
57
  composes: leading-normal from global;
53
58
  composes: px-sm from global;
54
59
  composes: py-xs from global;
55
60
  grid-area: title;
56
- grid-template-columns: 1fr max-content;
57
-
58
- composes: lg_p-sm from global;
59
61
  }
60
62
 
61
63
  .productName {
@@ -68,6 +70,7 @@
68
70
 
69
71
  .productPrice {
70
72
  composes: block from global;
73
+ composes: mb-2 from global;
71
74
  }
72
75
 
73
76
  .imageCarousel {
@@ -17,6 +17,7 @@ const SuggestedProduct = props => {
17
17
  small_image,
18
18
  name,
19
19
  onNavigate,
20
+ price,
20
21
  price_range,
21
22
  url_suffix
22
23
  } = props;
@@ -32,9 +33,14 @@ const SuggestedProduct = props => {
32
33
  url_suffix
33
34
  ]);
34
35
 
36
+ // fall back to deprecated field if price range is unavailable
35
37
  const priceProps = {
36
- currencyCode: price_range?.maximum_price?.final_price?.currency,
37
- value: price_range?.maximum_price?.final_price?.value
38
+ currencyCode:
39
+ price_range?.maximum_price?.final_price?.currency ||
40
+ price.regularPrice.amount.currency,
41
+ value:
42
+ price_range?.maximum_price?.final_price?.value ||
43
+ price.regularPrice.amount.value
38
44
  };
39
45
 
40
46
  return (
@@ -72,6 +78,14 @@ SuggestedProduct.propTypes = {
72
78
  })
73
79
  })
74
80
  }).isRequired,
81
+ price_range: shape({
82
+ maximum_price: shape({
83
+ final_price: shape({
84
+ currency: string,
85
+ value: number
86
+ })
87
+ })
88
+ }),
75
89
  classes: shape({
76
90
  root: string,
77
91
  image: string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magento/venia-ui",
3
- "version": "9.4.0-alpha.1",
3
+ "version": "9.4.0-beta.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -79,9 +79,9 @@
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@apollo/client": "~3.4.0",
82
- "@magento/babel-preset-peregrine": "1.2.1-alpha.1",
83
- "@magento/peregrine": "12.4.0-alpha.1",
84
- "@magento/pwa-buildpack": "11.3.0-alpha.1",
82
+ "@magento/babel-preset-peregrine": "1.2.1-beta.1",
83
+ "@magento/peregrine": "12.4.0-beta.1",
84
+ "@magento/pwa-buildpack": "11.3.0-beta.1",
85
85
  "apollo-cache-persist": "~0.1.1",
86
86
  "braintree-web-drop-in": "~1.16.0",
87
87
  "graphql": "~15.5.0",