@magento/venia-ui 11.6.0-alpha.8 → 11.6.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.
Files changed (29) hide show
  1. package/lib/components/ButtonTab/button.module.css +123 -0
  2. package/lib/components/ButtonTab/buttonTab.js +99 -0
  3. package/lib/components/ButtonTab/index.js +1 -0
  4. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/priceSummary.spec.js.snap +0 -2
  5. package/lib/components/CartPage/PriceSummary/priceSummary.js +1 -0
  6. package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +1 -1
  7. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/guestForm.spec.js.snap +12 -36
  8. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +1 -1
  9. package/lib/components/CheckoutPage/ShippingMethod/__tests__/__snapshots__/shippingMethod.spec.js.snap +8 -16
  10. package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +1 -1
  11. package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +4 -4
  12. package/lib/components/CheckoutPage/checkoutPage.js +3 -0
  13. package/lib/components/CreateAccount/createAccount.js +2 -2
  14. package/lib/components/FilterModal/CurrentFilters/currentFilter.js +1 -1
  15. package/lib/components/FilterModal/FilterList/filterDefault.js +1 -1
  16. package/lib/components/FilterModal/FilterList/filterItemRadio.js +1 -1
  17. package/lib/components/FilterModal/FilterList/filterList.js +2 -2
  18. package/lib/components/FilterModal/filterFooter.js +1 -0
  19. package/lib/components/FilterModal/filterModal.js +1 -1
  20. package/lib/components/FilterModalOpenButton/filterModalOpenButton.js +1 -0
  21. package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.spec.js.snap +4 -4
  22. package/lib/components/Newsletter/newsletter.js +2 -2
  23. package/lib/components/OrderHistoryPage/OrderDetails/items.js +1 -1
  24. package/lib/components/OrderHistoryPage/OrderDetails/orderDetails.js +19 -6
  25. package/lib/components/OrderHistoryPage/collapsedImageGallery.js +6 -6
  26. package/lib/components/ProductSort/productSort.js +1 -0
  27. package/lib/components/SignIn/__tests__/__snapshots__/signIn.spec.js.snap +6 -6
  28. package/lib/components/SignIn/signIn.js +3 -3
  29. package/package.json +3 -3
@@ -0,0 +1,123 @@
1
+ .root {
2
+ composes: border-2 from global;
3
+ composes: border-solid from global;
4
+ composes: cursor-pointer from global;
5
+ composes: font-bold from global;
6
+ composes: inline-flex from global;
7
+ composes: items-center from global;
8
+ composes: justify-center from global;
9
+ composes: leading-tight from global;
10
+ composes: max-w-full from global;
11
+ composes: min-w-[10rem] from global;
12
+ composes: outline-none from global;
13
+ composes: pointer-events-auto from global;
14
+ composes: px-sm from global;
15
+ composes: rounded-button from global;
16
+ composes: text-center from global;
17
+ composes: text-sm from global;
18
+ composes: uppercase from global;
19
+ padding-top: calc(0.5rem + 1px); /* TODO @TW: review */
20
+ padding-bottom: calc(0.5rem - 1px); /* TODO @TW: review */
21
+ min-height: 2.5rem;
22
+ transition-duration: 256ms;
23
+ transition-property: background-color, border-color, color;
24
+ transition-timing-function: var(--venia-global-anim-standard);
25
+
26
+ composes: disabled_bg-gray-400 from global;
27
+ composes: disabled_border-gray-400 from global;
28
+ composes: disabled_opacity-50 from global;
29
+ composes: disabled_pointer-events-none from global;
30
+ composes: disabled_text-white from global;
31
+
32
+ composes: focus_shadow-inputFocus from global;
33
+
34
+ composes: hover_disabled_pointer-events-none from global;
35
+ }
36
+
37
+ .root:active {
38
+ transition-duration: 128ms;
39
+ }
40
+
41
+ .root_lowPriority {
42
+ composes: root;
43
+
44
+ composes: bg-transparent from global;
45
+ composes: border-gray-700 from global;
46
+ composes: text-gray-700 from global;
47
+
48
+ composes: active_border-gray-800 from global;
49
+ composes: active_text-gray-800 from global;
50
+
51
+ composes: hover_border-gray-800 from global;
52
+ composes: hover_text-gray-800 from global;
53
+ }
54
+
55
+ .root_normalPriority {
56
+ composes: root;
57
+
58
+ composes: bg-transparent from global;
59
+ composes: border-brand-dark from global;
60
+ composes: text-brand-dark from global;
61
+
62
+ composes: active_border-brand-darkest from global;
63
+ composes: active_text-brand-darkest from global;
64
+
65
+ composes: hover_border-brand-darkest from global;
66
+ composes: hover_text-brand-darkest from global;
67
+ }
68
+
69
+ .root_highPriority {
70
+ composes: root;
71
+
72
+ composes: bg-brand-dark from global;
73
+ composes: border-brand-dark from global;
74
+ composes: text-white from global;
75
+
76
+ composes: active_bg-brand-darkest from global;
77
+ composes: active_border-brand-darkest from global;
78
+ composes: active_text-white from global;
79
+
80
+ composes: hover_bg-brand-darkest from global;
81
+ composes: hover_border-brand-darkest from global;
82
+ composes: hover_text-white from global;
83
+ }
84
+
85
+ .root_lowPriorityNegative,
86
+ .root_normalPriorityNegative {
87
+ composes: root;
88
+
89
+ composes: bg-transparent from global;
90
+ composes: border-red-600 from global;
91
+ composes: text-red-600 from global;
92
+
93
+ composes: active_border-red-700 from global;
94
+ composes: active_text-red-700 from global;
95
+
96
+ composes: hover_border-red-700 from global;
97
+ composes: hover_text-red-700 from global;
98
+ }
99
+
100
+ .root_highPriorityNegative {
101
+ composes: root;
102
+
103
+ composes: bg-red-600 from global;
104
+ composes: border-red-600 from global;
105
+ composes: text-white from global;
106
+
107
+ composes: active_bg-red-700 from global;
108
+ composes: active_border-red-700 from global;
109
+ composes: active_text-white from global;
110
+
111
+ composes: hover_bg-red-700 from global;
112
+ composes: hover_border-red-700 from global;
113
+ composes: hover_text-white from global;
114
+ }
115
+
116
+ .content {
117
+ composes: gap-1.5 from global;
118
+ composes: grid-flow-col from global;
119
+ composes: inline-grid from global;
120
+ composes: items-center from global;
121
+ composes: justify-center from global;
122
+ composes: justify-items-center from global;
123
+ }
@@ -0,0 +1,99 @@
1
+ import React, { useRef } from 'react';
2
+ import { useButton } from 'react-aria';
3
+ import { oneOf, shape, string, bool } from 'prop-types';
4
+
5
+ import { useStyle } from '../../classify';
6
+ import defaultClasses from './button.module.css';
7
+
8
+ const getRootClassName = (priority, negative) =>
9
+ `root_${priority}Priority${negative ? 'Negative' : ''}`;
10
+
11
+ /**
12
+ * A component for buttons.
13
+ *
14
+ * @typedef Button
15
+ * @kind functional component
16
+ *
17
+ * @param {props} props React component props
18
+ *
19
+ * @returns {React.Element} A React component that displays a single button.
20
+ */
21
+ const Button = props => {
22
+ const {
23
+ children,
24
+ classes: propClasses,
25
+ priority,
26
+ negative,
27
+ disabled,
28
+ onPress,
29
+ ...restProps
30
+ } = props;
31
+
32
+ const buttonRef = useRef();
33
+
34
+ const { buttonProps } = useButton(
35
+ {
36
+ isDisabled: disabled,
37
+ onPress,
38
+ ...restProps
39
+ },
40
+ buttonRef
41
+ );
42
+
43
+ const classes = useStyle(defaultClasses, propClasses);
44
+ const rootClassName = classes[getRootClassName(priority, negative)];
45
+
46
+ return (
47
+ <button
48
+ ref={buttonRef}
49
+ className={rootClassName}
50
+ {...buttonProps}
51
+ {...restProps}
52
+ >
53
+ {children}
54
+ </button>
55
+ );
56
+ };
57
+
58
+ /**
59
+ * Props for {@link Button}
60
+ *
61
+ * @typedef props
62
+ *
63
+ * @property {Object} classes An object containing the class names for the
64
+ * Button component.
65
+ * @property {string} classes.content classes for the button content
66
+ * @property {string} classes.root classes for root container
67
+ * @property {string} classes.root_highPriority classes for Button if
68
+ * high priority.
69
+ * @property {string} classes.root_lowPriority classes for Button if
70
+ * low priority.
71
+ * @property {string} classes.root_normalPriority classes for Button if
72
+ * normal priority.
73
+ * @property {string} priority the priority/importance of the Button
74
+ * @property {string} type the type of the Button
75
+ * @property {bool} negative whether the button should be displayed in red for a negative action
76
+ * @property {bool} disabled is the button disabled
77
+ */
78
+ Button.propTypes = {
79
+ classes: shape({
80
+ content: string,
81
+ root: string,
82
+ root_highPriority: string,
83
+ root_lowPriority: string,
84
+ root_normalPriority: string
85
+ }),
86
+ priority: oneOf(['high', 'low', 'normal']).isRequired,
87
+ type: oneOf(['button', 'reset', 'submit']).isRequired,
88
+ negative: bool,
89
+ disabled: bool
90
+ };
91
+
92
+ Button.defaultProps = {
93
+ priority: 'normal',
94
+ type: 'button',
95
+ negative: false,
96
+ disabled: false
97
+ };
98
+
99
+ export default Button;
@@ -0,0 +1 @@
1
+ export { default } from './buttonTab';
@@ -87,7 +87,6 @@ exports[`renders PriceSummary correctly on cart page 1`] = `
87
87
  onTouchCancel={[Function]}
88
88
  onTouchEnd={[Function]}
89
89
  onTouchMove={[Function]}
90
- onTouchStart={[Function]}
91
90
  type="button"
92
91
  >
93
92
  <span
@@ -283,7 +282,6 @@ exports[`renders summary with loading state if query is loading 1`] = `
283
282
  onTouchCancel={[Function]}
284
283
  onTouchEnd={[Function]}
285
284
  onTouchMove={[Function]}
286
- onTouchStart={[Function]}
287
285
  type="button"
288
286
  >
289
287
  <span
@@ -91,6 +91,7 @@ const PriceSummary = props => {
91
91
  disabled={isPriceUpdating}
92
92
  priority={'high'}
93
93
  onClick={handleProceedToCheckout}
94
+ onTouchStart={handleProceedToCheckout}
94
95
  onKeyDown={handleEnterKeyPress}
95
96
  data-cy="PriceSummary-checkoutButton"
96
97
  >
@@ -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"
@@ -451,11 +451,7 @@ Array [
451
451
  onTouchStart={[Function]}
452
452
  type="submit"
453
453
  >
454
- <span
455
- className="content"
456
- >
457
- Continue to Shipping Method
458
- </span>
454
+ Continue to Shipping Method
459
455
  </button>
460
456
  </div>
461
457
  </form>,
@@ -917,11 +913,7 @@ Array [
917
913
  onTouchStart={[Function]}
918
914
  type="submit"
919
915
  >
920
- <span
921
- className="content"
922
- >
923
- Continue to Shipping Method
924
- </span>
916
+ Continue to Shipping Method
925
917
  </button>
926
918
  </div>
927
919
  </form>,
@@ -1371,14 +1363,10 @@ Array [
1371
1363
  onTouchStart={[Function]}
1372
1364
  type="button"
1373
1365
  >
1374
- <span
1375
- className="content"
1376
- >
1377
- <mock-FormattedMessage
1378
- defaultMessage="Cancel"
1379
- id="global.cancelButton"
1380
- />
1381
- </span>
1366
+ <mock-FormattedMessage
1367
+ defaultMessage="Cancel"
1368
+ id="global.cancelButton"
1369
+ />
1382
1370
  </button>
1383
1371
  <button
1384
1372
  className="root_highPriority"
@@ -1396,11 +1384,7 @@ Array [
1396
1384
  onTouchStart={[Function]}
1397
1385
  type="submit"
1398
1386
  >
1399
- <span
1400
- className="content"
1401
- >
1402
- Update
1403
- </span>
1387
+ Update
1404
1388
  </button>
1405
1389
  </div>
1406
1390
  </form>,
@@ -1850,14 +1834,10 @@ Array [
1850
1834
  onTouchStart={[Function]}
1851
1835
  type="button"
1852
1836
  >
1853
- <span
1854
- className="content"
1855
- >
1856
- <mock-FormattedMessage
1857
- defaultMessage="Cancel"
1858
- id="global.cancelButton"
1859
- />
1860
- </span>
1837
+ <mock-FormattedMessage
1838
+ defaultMessage="Cancel"
1839
+ id="global.cancelButton"
1840
+ />
1861
1841
  </button>
1862
1842
  <button
1863
1843
  className="root_highPriority"
@@ -1875,11 +1855,7 @@ Array [
1875
1855
  onTouchStart={[Function]}
1876
1856
  type="submit"
1877
1857
  >
1878
- <span
1879
- className="content"
1880
- >
1881
- Update
1882
- </span>
1858
+ Update
1883
1859
  </button>
1884
1860
  </div>
1885
1861
  </form>,
@@ -8,7 +8,7 @@ import { useToasts } from '@magento/peregrine';
8
8
 
9
9
  import { useStyle } from '../../../../classify';
10
10
  import { isRequired } from '../../../../util/formValidators';
11
- import Button from '../../../Button';
11
+ import Button from '../../../ButtonTab';
12
12
  import Country from '../../../Country';
13
13
  import Field, { Message } from '../../../Field';
14
14
  import FormError from '../../../FormError';
@@ -107,14 +107,10 @@ exports[`it disables inputs when the page is updating 1`] = `
107
107
  onTouchStart={[Function]}
108
108
  type="submit"
109
109
  >
110
- <span
111
- className="content"
112
- >
113
- <mock-FormattedMessage
114
- defaultMessage="Continue to Payment Information"
115
- id="shippingMethod.continueToNextStep"
116
- />
117
- </span>
110
+ <mock-FormattedMessage
111
+ defaultMessage="Continue to Payment Information"
112
+ id="shippingMethod.continueToNextStep"
113
+ />
118
114
  </button>
119
115
  </div>
120
116
  </form>
@@ -228,14 +224,10 @@ exports[`it renders correctly 1`] = `
228
224
  onTouchStart={[Function]}
229
225
  type="submit"
230
226
  >
231
- <span
232
- className="content"
233
- >
234
- <mock-FormattedMessage
235
- defaultMessage="Continue to Payment Information"
236
- id="shippingMethod.continueToNextStep"
237
- />
238
- </span>
227
+ <mock-FormattedMessage
228
+ defaultMessage="Continue to Payment Information"
229
+ id="shippingMethod.continueToNextStep"
230
+ />
239
231
  </button>
240
232
  </div>
241
233
  </form>
@@ -9,7 +9,7 @@ import {
9
9
  } from '@magento/peregrine/lib/talons/CheckoutPage/ShippingMethod/useShippingMethod';
10
10
 
11
11
  import { useStyle } from '../../../classify';
12
- import Button from '../../Button';
12
+ import Button from '../../ButtonTab';
13
13
  import FormError from '../../FormError';
14
14
  import LoadingIndicator from '../../LoadingIndicator';
15
15
  import CompletedView from './completedView';
@@ -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
@@ -237,7 +237,6 @@ exports[`CheckoutPage renders an error and disables review order button if there
237
237
  onTouchCancel={[Function]}
238
238
  onTouchEnd={[Function]}
239
239
  onTouchMove={[Function]}
240
- onTouchStart={[Function]}
241
240
  type="button"
242
241
  >
243
242
  <span
@@ -538,7 +537,7 @@ exports[`CheckoutPage renders checkout content for guest on desktop 1`] = `
538
537
  onTouchCancel={[Function]}
539
538
  onTouchEnd={[Function]}
540
539
  onTouchMove={[Function]}
541
- onTouchStart={[Function]}
540
+ onTouchStart={[MockFunction toggleSignInContent]}
542
541
  type="button"
543
542
  >
544
543
  <span
@@ -680,7 +679,7 @@ exports[`CheckoutPage renders checkout content for guest on mobile 1`] = `
680
679
  onTouchCancel={[Function]}
681
680
  onTouchEnd={[Function]}
682
681
  onTouchMove={[Function]}
683
- onTouchStart={[Function]}
682
+ onTouchStart={[MockFunction toggleSignInContent]}
684
683
  type="button"
685
684
  >
686
685
  <span
@@ -890,6 +889,7 @@ Object {
890
889
  "negative": false,
891
890
  "onClick": [MockFunction handleReviewOrder],
892
891
  "onKeyDown": undefined,
892
+ "onTouchStart": [MockFunction handleReviewOrder],
893
893
  "priority": "high",
894
894
  "type": "button",
895
895
  }
@@ -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
@@ -253,6 +254,7 @@ const CheckoutPage = props => {
253
254
  checkoutStep === CHECKOUT_STEP.PAYMENT ? (
254
255
  <Button
255
256
  onClick={handleReviewOrder}
257
+ onTouchStart={handleReviewOrder}
256
258
  onKeyDown={handleReviewOrderEnterKeyPress}
257
259
  priority="high"
258
260
  className={classes.review_order_button}
@@ -281,6 +283,7 @@ const CheckoutPage = props => {
281
283
  checkoutStep === CHECKOUT_STEP.REVIEW ? (
282
284
  <Button
283
285
  onClick={handlePlaceOrder}
286
+ onTouchStart={handlePlaceOrder}
284
287
  onKeyDown={handlePlaceOrderEnterKeyPress}
285
288
  priority="high"
286
289
  className={classes.place_order_button}
@@ -46,7 +46,7 @@ const CreateAccount = props => {
46
46
  <Button
47
47
  data-cy="CreateAccount-cancelButton"
48
48
  className={classes.cancelButton}
49
- disabled={isDisabled}
49
+ disabled={Boolean(isDisabled)}
50
50
  type="button"
51
51
  priority="low"
52
52
  onClick={handleCancel}
@@ -62,7 +62,7 @@ const CreateAccount = props => {
62
62
  const submitButton = (
63
63
  <Button
64
64
  className={classes.submitButton}
65
- disabled={isDisabled}
65
+ disabled={Boolean(isDisabled)}
66
66
  type="submit"
67
67
  priority="high"
68
68
  onKeyDown={handleEnterKeyPress}
@@ -44,7 +44,7 @@ const CurrentFilter = props => {
44
44
  <span className={classes.root} data-cy="CurrentFilter-root">
45
45
  <Trigger
46
46
  action={handleClick}
47
- ariaLabel={ariaLabel}
47
+ aria-label={ariaLabel}
48
48
  data-cy="CurrentFilter-trigger"
49
49
  >
50
50
  <Icon size={20} src={Remove} />
@@ -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"
@@ -39,7 +39,7 @@ exports[`#Newsletter display renders correctly 1`] = `
39
39
  >
40
40
  <label
41
41
  className="label"
42
- htmlFor="email"
42
+ htmlFor="emailNews"
43
43
  >
44
44
  Email
45
45
  </label>
@@ -58,7 +58,7 @@ exports[`#Newsletter display renders correctly 1`] = `
58
58
  <input
59
59
  autoComplete="email"
60
60
  className="input"
61
- id="email"
61
+ id="emailNews"
62
62
  name="email"
63
63
  onBlur={[Function]}
64
64
  onChange={[Function]}
@@ -126,7 +126,7 @@ exports[`#Newsletter submit displays an error message if the email already subsc
126
126
  >
127
127
  <label
128
128
  className="label"
129
- htmlFor="email"
129
+ htmlFor="emailNews"
130
130
  >
131
131
  Email
132
132
  </label>
@@ -145,7 +145,7 @@ exports[`#Newsletter submit displays an error message if the email already subsc
145
145
  <input
146
146
  autoComplete="email"
147
147
  className="input"
148
- id="email"
148
+ id="emailNews"
149
149
  name="email"
150
150
  onBlur={[Function]}
151
151
  onChange={[Function]}
@@ -96,7 +96,7 @@ const Newsletter = props => {
96
96
  onSubmit={handleSubmit}
97
97
  >
98
98
  <Field
99
- id="email"
99
+ id="emailNews"
100
100
  label={formatMessage({
101
101
  id: 'global.email',
102
102
  defaultMessage: 'Email'
@@ -105,7 +105,7 @@ const Newsletter = props => {
105
105
  <TextInput
106
106
  autoComplete="email"
107
107
  field="email"
108
- id="email"
108
+ id="emailNews"
109
109
  validate={isRequired}
110
110
  />
111
111
  </Field>
@@ -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}
@@ -37,7 +37,7 @@ exports[`displays an error message if there is a sign in error 1`] = `
37
37
  >
38
38
  <label
39
39
  className="label"
40
- htmlFor="email"
40
+ htmlFor="emailSignIn"
41
41
  >
42
42
  Email address
43
43
  </label>
@@ -57,7 +57,7 @@ exports[`displays an error message if there is a sign in error 1`] = `
57
57
  aria-label="Email Required"
58
58
  autoComplete="email"
59
59
  className="input"
60
- id="email"
60
+ id="emailSignIn"
61
61
  name="email"
62
62
  onBlur={[Function]}
63
63
  onChange={[Function]}
@@ -169,7 +169,7 @@ exports[`renders correctly 1`] = `
169
169
  >
170
170
  <label
171
171
  className="label"
172
- htmlFor="email"
172
+ htmlFor="emailSignIn"
173
173
  >
174
174
  Email address
175
175
  </label>
@@ -189,7 +189,7 @@ exports[`renders correctly 1`] = `
189
189
  aria-label="Email Required"
190
190
  autoComplete="email"
191
191
  className="input"
192
- id="email"
192
+ id="emailSignIn"
193
193
  name="email"
194
194
  onBlur={[Function]}
195
195
  onChange={[Function]}
@@ -301,7 +301,7 @@ exports[`renders prefilled form with initial values 1`] = `
301
301
  >
302
302
  <label
303
303
  className="label"
304
- htmlFor="email"
304
+ htmlFor="emailSignIn"
305
305
  >
306
306
  Email address
307
307
  </label>
@@ -321,7 +321,7 @@ exports[`renders prefilled form with initial values 1`] = `
321
321
  aria-label="Email Required"
322
322
  autoComplete="email"
323
323
  className="input"
324
- id="email"
324
+ id="emailSignIn"
325
325
  name="email"
326
326
  onBlur={[Function]}
327
327
  onChange={[Function]}
@@ -67,14 +67,14 @@ const SignIn = props => {
67
67
  initialValues={initialValues && initialValues}
68
68
  >
69
69
  <Field
70
- id="email"
70
+ id="emailSignIn"
71
71
  label={formatMessage({
72
72
  id: 'signIn.emailAddressText',
73
73
  defaultMessage: 'Email address'
74
74
  })}
75
75
  >
76
76
  <TextInput
77
- id="email"
77
+ id="emailSignIn"
78
78
  data-cy="SignIn-email"
79
79
  autoComplete="email"
80
80
  field="email"
@@ -124,7 +124,7 @@ const SignIn = props => {
124
124
  type="submit"
125
125
  onKeyDown={signinHandleEnterKeyPress}
126
126
  data-cy="SignInButton-root_highPriority"
127
- disabled={isBusy}
127
+ disabled={Boolean(isBusy)}
128
128
  >
129
129
  <FormattedMessage
130
130
  id={'signIn.signInText'}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magento/venia-ui",
3
- "version": "11.6.0-alpha.8",
3
+ "version": "11.6.0-beta.1",
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.8",
84
- "@magento/pwa-buildpack": "11.5.4-alpha.8",
83
+ "@magento/peregrine": "14.5.1-beta.1",
84
+ "@magento/pwa-buildpack": "11.5.4-beta.1",
85
85
  "apollo-cache-persist": "~0.1.1",
86
86
  "braintree-web-drop-in": "~1.43.0",
87
87
  "graphql": "~15.5.0",