@magento/venia-ui 11.6.0-alpha.13 → 11.6.0-alpha.14

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.
@@ -179,7 +179,7 @@ const CreateAccount = props => {
179
179
  <GoogleReCaptcha {...recaptchaWidgetProps} />
180
180
  <div className={classes.actions}>
181
181
  <Button
182
- disabled={isDisabled}
182
+ disabled={Boolean(isDisabled)}
183
183
  type="submit"
184
184
  className={classes.create_account_button}
185
185
  data-cy="OrderConfirmationPage-CreateAccount-createAccountButton"
@@ -173,7 +173,7 @@ exports[`CheckoutPage renders an error and disables review order button if there
173
173
  onTouchCancel={[Function]}
174
174
  onTouchEnd={[Function]}
175
175
  onTouchMove={[Function]}
176
- onTouchStart={[Function]}
176
+ onTouchStart={[MockFunction toggleSignInContent]}
177
177
  type="button"
178
178
  >
179
179
  <span
@@ -537,7 +537,7 @@ exports[`CheckoutPage renders checkout content for guest on desktop 1`] = `
537
537
  onTouchCancel={[Function]}
538
538
  onTouchEnd={[Function]}
539
539
  onTouchMove={[Function]}
540
- onTouchStart={[Function]}
540
+ onTouchStart={[MockFunction toggleSignInContent]}
541
541
  type="button"
542
542
  >
543
543
  <span
@@ -679,7 +679,7 @@ exports[`CheckoutPage renders checkout content for guest on mobile 1`] = `
679
679
  onTouchCancel={[Function]}
680
680
  onTouchEnd={[Function]}
681
681
  onTouchMove={[Function]}
682
- onTouchStart={[Function]}
682
+ onTouchStart={[MockFunction toggleSignInContent]}
683
683
  type="button"
684
684
  >
685
685
  <span
@@ -177,6 +177,7 @@ const CheckoutPage = props => {
177
177
  className={classes.signInButton}
178
178
  data-cy="CheckoutPage-signInButton"
179
179
  onClick={toggleSignInContent}
180
+ onTouchStart={toggleSignInContent}
180
181
  priority="normal"
181
182
  >
182
183
  <FormattedMessage
@@ -282,6 +283,7 @@ const CheckoutPage = props => {
282
283
  checkoutStep === CHECKOUT_STEP.REVIEW ? (
283
284
  <Button
284
285
  onClick={handlePlaceOrder}
286
+ onTouchStart={handlePlaceOrder}
285
287
  onKeyDown={handlePlaceOrderEnterKeyPress}
286
288
  priority="high"
287
289
  className={classes.place_order_button}
@@ -57,7 +57,7 @@ const FilterDefault = props => {
57
57
  field={`${label}-${value_index}`}
58
58
  fieldValue={!!isSelected}
59
59
  label={title}
60
- ariaLabel={ariaLabel}
60
+ aria-label={ariaLabel}
61
61
  data-cy="FilterDefault-checkbox"
62
62
  onClick={onMouseDown}
63
63
  {...restProps}
@@ -45,7 +45,7 @@ const FilterItemRadio = props => {
45
45
  value={value}
46
46
  onChange={handleOnchange}
47
47
  data-cy="FilterDefault-radio"
48
- ariaLabel={ariaLabel}
48
+ aria-label={ariaLabel}
49
49
  />
50
50
  );
51
51
 
@@ -36,8 +36,8 @@ const FilterList = props => {
36
36
  var maxRange = Number(items[items.length - 1].value.split('_')[1]);
37
37
  if (filterState !== undefined) {
38
38
  const filterArray = [...filterState];
39
- var currentMinVal = Number(filterArray[0].value.split('_')[0]);
40
- var currentMaxVal = Number(filterArray[0].value.split('_')[1]);
39
+ var currentMinVal = Number(filterArray[0]?.value?.split('_')[0]);
40
+ var currentMaxVal = Number(filterArray[0]?.value?.split('_')[1]);
41
41
  }
42
42
  }
43
43
 
@@ -26,6 +26,7 @@ const FilterFooter = props => {
26
26
  <Button
27
27
  disabled={!touched}
28
28
  onClick={applyFilters}
29
+ onTouchStart={applyFilters}
29
30
  data-cy="FilterFooter-button"
30
31
  aria-label={buttonLabel}
31
32
  aria-disabled={!touched}
@@ -80,7 +80,7 @@ const FilterModal = props => {
80
80
  <LinkButton
81
81
  type="button"
82
82
  onClick={handleReset}
83
- ariaLabel={clearAllAriaLabel}
83
+ aria-label={clearAllAriaLabel}
84
84
  data-cy="FilterModal-clearButton"
85
85
  >
86
86
  <FormattedMessage
@@ -24,6 +24,7 @@ const FilterModalOpenButton = props => {
24
24
  }}
25
25
  data-cy="FilterModalOpenButton-button"
26
26
  onClick={handleOpen}
27
+ onTouchStart={handleOpen}
27
28
  onKeyDown={handleKeypress}
28
29
  type="button"
29
30
  aria-live="polite"
@@ -13,7 +13,7 @@ const Items = props => {
13
13
  const classes = useStyle(defaultClasses, props.classes);
14
14
 
15
15
  const itemsComponent = items.map(item => (
16
- <Item key={item.id} {...item} {...imagesData[item.product_sku]} />
16
+ <Item key={item.id} {...item} {...imagesData[0][item.product_sku]} />
17
17
  ));
18
18
 
19
19
  return (
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { arrayOf, number, shape, string } from 'prop-types';
2
+ import PropTypes, { shape, string, number, arrayOf } from 'prop-types';
3
3
  import { FormattedMessage } from 'react-intl';
4
4
 
5
5
  import { Printer } from 'react-feather';
@@ -38,6 +38,8 @@ const OrderDetails = props => {
38
38
 
39
39
  const hasTotals = total.grand_total && total.grand_total.currency;
40
40
 
41
+ const imagesArray = Array.isArray(imagesData) ? imagesData : [imagesData];
42
+
41
43
  return (
42
44
  <div className={classes.root}>
43
45
  <div className={classes.shippingInformationContainer}>
@@ -64,7 +66,7 @@ const OrderDetails = props => {
64
66
  </div>
65
67
  <div className={classes.itemsContainer}>
66
68
  <ConditionalWrapper condition={items && items.length}>
67
- <Items data={{ imagesData, items }} />
69
+ <Items data={{ imagesData: imagesArray, items }} />
68
70
  </ConditionalWrapper>
69
71
  </div>
70
72
  <div className={classes.orderTotalContainer}>
@@ -91,8 +93,6 @@ const OrderDetails = props => {
91
93
  );
92
94
  };
93
95
 
94
- export default OrderDetails;
95
-
96
96
  OrderDetails.propTypes = {
97
97
  classes: shape({
98
98
  root: string,
@@ -105,7 +105,18 @@ OrderDetails.propTypes = {
105
105
  printButton: string,
106
106
  printLabel: string
107
107
  }),
108
- imagesData: arrayOf(
108
+ imagesData: PropTypes.oneOfType([
109
+ arrayOf(
110
+ shape({
111
+ id: number,
112
+ sku: string,
113
+ thumbnail: shape({
114
+ url: string
115
+ }),
116
+ url_key: string,
117
+ url_suffix: string
118
+ })
119
+ ),
109
120
  shape({
110
121
  id: number,
111
122
  sku: string,
@@ -115,7 +126,7 @@ OrderDetails.propTypes = {
115
126
  url_key: string,
116
127
  url_suffix: string
117
128
  })
118
- ),
129
+ ]),
119
130
  orderData: shape({
120
131
  billing_address: shape({
121
132
  city: string,
@@ -205,3 +216,5 @@ OrderDetails.propTypes = {
205
216
  })
206
217
  })
207
218
  };
219
+
220
+ export default OrderDetails;
@@ -1,5 +1,5 @@
1
1
  import React, { useMemo } from 'react';
2
- import { arrayOf, object, shape, string } from 'prop-types';
2
+ import PropTypes from 'prop-types';
3
3
 
4
4
  import { useStyle } from '../../classify';
5
5
  import Image from '../Image';
@@ -27,7 +27,7 @@ const CollapsedImageGallery = props => {
27
27
 
28
28
  return (
29
29
  <Image
30
- key={Object.keys(items)[index]}
30
+ key={name || index}
31
31
  alt={name}
32
32
  src={url}
33
33
  width={48}
@@ -58,9 +58,9 @@ const CollapsedImageGallery = props => {
58
58
  export default CollapsedImageGallery;
59
59
 
60
60
  CollapsedImageGallery.propTypes = {
61
- classes: shape({
62
- root: string,
63
- remainderCount: string
61
+ classes: PropTypes.shape({
62
+ root: PropTypes.string,
63
+ remainderCount: PropTypes.string
64
64
  }),
65
- items: arrayOf(object)
65
+ items: PropTypes.object.isRequired
66
66
  };
@@ -185,6 +185,7 @@ const ProductSort = props => {
185
185
  root_lowPriority: classes.sortButton
186
186
  }}
187
187
  onClick={handleSortClick}
188
+ onTouchStart={handleSortClick}
188
189
  data-cy="ProductSort-sortButton"
189
190
  onKeyDown={handleKeypress}
190
191
  aria-label={result}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magento/venia-ui",
3
- "version": "11.6.0-alpha.13",
3
+ "version": "11.6.0-alpha.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -80,8 +80,8 @@
80
80
  "peerDependencies": {
81
81
  "@apollo/client": "~3.5.0",
82
82
  "@magento/babel-preset-peregrine": "~1.3.3",
83
- "@magento/peregrine": "14.5.1-alpha.13",
84
- "@magento/pwa-buildpack": "11.5.4-alpha.13",
83
+ "@magento/peregrine": "14.5.1-alpha.14",
84
+ "@magento/pwa-buildpack": "11.5.4-alpha.14",
85
85
  "apollo-cache-persist": "~0.1.1",
86
86
  "braintree-web-drop-in": "~1.43.0",
87
87
  "graphql": "~15.5.0",