@magento/venia-ui 9.7.0 → 10.0.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.
- package/i18n/en_US.json +23 -2
- package/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +1 -1
- package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.shimmer.spec.js.snap +6 -0
- package/lib/components/AccountChip/__tests__/__snapshots__/accountChip.spec.js.snap +3 -0
- package/lib/components/AccountChip/accountChip.js +14 -1
- package/lib/components/AccountInformationPage/__tests__/__snapshots__/editForm.spec.js.snap +15 -0
- package/lib/components/AddressBookPage/__tests__/__snapshots__/addEditDialog.spec.js.snap +28 -0
- package/lib/components/App/__tests__/app.spec.js +3 -1
- package/lib/components/App/app.js +1 -1
- package/lib/components/CartPage/GiftCards/__tests__/__snapshots__/giftCards.spec.js.snap +2 -0
- package/lib/components/CartPage/PriceAdjustments/CouponCode/__tests__/__snapshots__/couponCode.spec.js.snap +9 -3
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/__tests__/__snapshots__/shippingForm.spec.js.snap +15 -0
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/priceSummary.spec.js.snap +0 -2
- package/lib/components/CartPage/PriceSummary/priceSummary.js +2 -0
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +4 -0
- package/lib/components/CartPage/ProductListing/__tests__/__snapshots__/product.spec.js.snap +6 -0
- package/lib/components/CartPage/ProductListing/__tests__/__snapshots__/quantity.spec.js.snap +1 -0
- package/lib/components/CategoryTree/categoryBranch.js +1 -1
- package/lib/components/CategoryTree/categoryLeaf.js +1 -1
- package/lib/components/CategoryTree/categoryTree.js +1 -1
- package/lib/components/Checkout/__tests__/__snapshots__/addressForm.spec.js.snap +16 -0
- package/lib/components/Checkout/__tests__/__snapshots__/paymentsForm.spec.js.snap +7 -0
- package/lib/components/Checkout/section.module.css +0 -1
- package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +3 -0
- package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/createAccount.spec.js.snap +20 -0
- package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +16 -0
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/customerForm.spec.js.snap +46 -0
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/guestForm.spec.js.snap +68 -0
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +36 -0
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +36 -0
- package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +1 -1
- package/lib/components/CheckoutPage/checkoutPage.js +4 -0
- package/lib/components/Country/__tests__/__snapshots__/country.spec.js.snap +2 -0
- package/lib/components/CreateAccount/__tests__/__snapshots__/createAccount.spec.js.snap +36 -10
- package/lib/components/CreateAccount/createAccount.js +18 -0
- package/lib/components/Field/fieldIcons.js +3 -1
- package/lib/components/FilterModalOpenButton/filterModalOpenButton.js +12 -2
- package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/__snapshots__/forgotPasswordForm.spec.js.snap +2 -0
- package/lib/components/Gallery/__tests__/__snapshots__/gallery.spec.js.snap +2 -0
- package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +3 -0
- package/lib/components/Gallery/item.js +1 -0
- package/lib/components/Header/__tests__/__snapshots__/accountTrigger.spec.js.snap +1 -1
- package/lib/components/Header/accountTrigger.js +12 -5
- package/lib/components/Image/placeholderImage.js +1 -0
- package/lib/components/LegacyMiniCart/__tests__/__snapshots__/kebab.spec.js.snap +2 -0
- package/lib/components/LegacyMiniCart/__tests__/__snapshots__/miniCart.spec.js.snap +3 -0
- package/lib/components/LegacyMiniCart/kebab.js +14 -0
- package/lib/components/Link/__tests__/link.spec.js +8 -6
- package/lib/components/Link/link.js +1 -1
- package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +8 -0
- package/lib/components/MiniCart/ProductList/item.js +11 -0
- package/lib/components/MyAccount/ResetPassword/__tests__/__snapshots__/resetPassword.spec.js.snap +16 -4
- package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.spec.js.snap +2 -0
- package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +1 -0
- package/lib/components/OrderHistoryPage/__tests__/__snapshots__/orderHistoryPage.spec.js.snap +13 -0
- package/lib/components/OrderHistoryPage/__tests__/__snapshots__/orderRow.spec.js.snap +4 -0
- package/lib/components/OrderHistoryPage/__tests__/__snapshots__/resetButton.spec.js.snap +3 -0
- package/lib/components/OrderHistoryPage/collapsedImageGallery.js +3 -3
- package/lib/components/OrderHistoryPage/orderHistoryPage.js +1 -0
- package/lib/components/OrderHistoryPage/orderRow.js +1 -0
- package/lib/components/OrderHistoryPage/resetButton.js +13 -2
- package/lib/components/PageLoadingIndicator/__tests__/pageLoadingIndicator.spec.js +1 -1
- package/lib/components/PageLoadingIndicator/pageLoadingIndicator.js +1 -1
- package/lib/components/Password/__tests__/__snapshots__/password.spec.js.snap +13 -3
- package/lib/components/Password/password.js +24 -2
- package/lib/components/ProductImageCarousel/__tests__/__snapshots__/carousel.spec.js.snap +18 -16
- package/lib/components/ProductImageCarousel/__tests__/__snapshots__/thumbnail.spec.js.snap +12 -12
- package/lib/components/ProductImageCarousel/__tests__/thumbnail.spec.js +2 -2
- package/lib/components/ProductImageCarousel/thumbnail.js +4 -5
- package/lib/components/ProductImageCarousel/thumbnail.module.css +0 -1
- package/lib/components/ProductOptions/__tests__/__snapshots__/swatch.spec.js.snap +6 -0
- package/lib/components/ProductOptions/__tests__/__snapshots__/swatchList.spec.js.snap +1 -0
- package/lib/components/ProductOptions/__tests__/swatch.spec.js +2 -1
- package/lib/components/ProductOptions/option.js +1 -0
- package/lib/components/ProductOptions/swatch.js +5 -2
- package/lib/components/ProductOptions/swatchList.js +5 -2
- package/lib/components/ProductSort/__tests__/__snapshots__/productSort.spec.js.snap +1 -0
- package/lib/components/ProductSort/productSort.js +17 -0
- package/lib/components/QuantityStepper/quantityStepper.module.css +0 -2
- package/lib/components/Region/__tests__/__snapshots__/region.spec.js.snap +3 -0
- package/lib/components/SearchBar/__tests__/__snapshots__/searchField.spec.js.snap +1 -0
- package/lib/components/SearchBar/__tests__/__snapshots__/suggestedProduct.spec.js.snap +1 -0
- package/lib/components/SearchBar/searchBar.js +6 -1
- package/lib/components/SearchBar/searchField.js +4 -2
- package/lib/components/SearchPage/__tests__/__snapshots__/searchPage.spec.js.snap +28 -28
- package/lib/components/SearchPage/searchPage.js +6 -4
- package/lib/components/SignIn/__tests__/__snapshots__/signIn.spec.js.snap +12 -0
- package/lib/components/SignIn/signIn.js +10 -0
- package/lib/components/Trigger/__tests__/__snapshots__/trigger.spec.js.snap +8 -2
- package/lib/components/Trigger/trigger.js +30 -5
- package/lib/components/Wishlist/WishlistDialog/CreateWishlistForm/__tests__/__snapshots__/createWishlistForm.spec.js.snap +2 -0
- package/lib/components/WishlistPage/__tests__/__snapshots__/createWishlist.ee.spec.js.snap +1 -0
- package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistEditFavoritesListDialog.spec.js.snap +4 -0
- package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistItem.spec.js.snap +2 -0
- package/lib/index.module.css +7 -9
- package/package.json +2 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`renders root class if not the active Thumbnail 1`] = `
|
|
4
|
-
<
|
|
5
|
-
aria-
|
|
4
|
+
<button
|
|
5
|
+
aria-label="Next Image"
|
|
6
6
|
className="root"
|
|
7
7
|
onClick={[Function]}
|
|
8
|
-
role="button"
|
|
9
8
|
>
|
|
10
9
|
<div
|
|
11
10
|
className="root container"
|
|
12
11
|
>
|
|
13
12
|
<img
|
|
14
13
|
alt="test-thumbnail"
|
|
14
|
+
aria-hidden="true"
|
|
15
15
|
className="image placeholder"
|
|
16
16
|
height={170}
|
|
17
17
|
loading="eager"
|
|
@@ -50,21 +50,21 @@ exports[`renders root class if not the active Thumbnail 1`] = `
|
|
|
50
50
|
width={135}
|
|
51
51
|
/>
|
|
52
52
|
</div>
|
|
53
|
-
</
|
|
53
|
+
</button>
|
|
54
54
|
`;
|
|
55
55
|
|
|
56
56
|
exports[`renders the Thumbnail component correctly 1`] = `
|
|
57
|
-
<
|
|
58
|
-
aria-
|
|
57
|
+
<button
|
|
58
|
+
aria-label="Current Image"
|
|
59
59
|
className="rootSelected"
|
|
60
60
|
onClick={[Function]}
|
|
61
|
-
role="button"
|
|
62
61
|
>
|
|
63
62
|
<div
|
|
64
63
|
className="root container"
|
|
65
64
|
>
|
|
66
65
|
<img
|
|
67
66
|
alt="test-thumbnail"
|
|
67
|
+
aria-hidden="true"
|
|
68
68
|
className="image placeholder"
|
|
69
69
|
height={170}
|
|
70
70
|
loading="eager"
|
|
@@ -103,21 +103,21 @@ exports[`renders the Thumbnail component correctly 1`] = `
|
|
|
103
103
|
width={135}
|
|
104
104
|
/>
|
|
105
105
|
</div>
|
|
106
|
-
</
|
|
106
|
+
</button>
|
|
107
107
|
`;
|
|
108
108
|
|
|
109
109
|
exports[`renders transparent placeholder when no file name is provided 1`] = `
|
|
110
|
-
<
|
|
111
|
-
aria-
|
|
110
|
+
<button
|
|
111
|
+
aria-label="Current Image"
|
|
112
112
|
className="rootSelected"
|
|
113
113
|
onClick={[Function]}
|
|
114
|
-
role="button"
|
|
115
114
|
>
|
|
116
115
|
<div
|
|
117
116
|
className="root container"
|
|
118
117
|
>
|
|
119
118
|
<img
|
|
120
119
|
alt="placeholder-thumbnail"
|
|
120
|
+
aria-hidden="true"
|
|
121
121
|
className="image placeholder"
|
|
122
122
|
loading="eager"
|
|
123
123
|
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc0JyBoZWlnaHQ9JzUnPjxyZWN0IHdpZHRoPSc0JyBoZWlnaHQ9JzUnIHN0eWxlPSdmaWxsOiBub25lJyAvPjwvc3ZnPg=="
|
|
@@ -133,5 +133,5 @@ exports[`renders transparent placeholder when no file name is provided 1`] = `
|
|
|
133
133
|
style={Object {}}
|
|
134
134
|
/>
|
|
135
135
|
</div>
|
|
136
|
-
</
|
|
136
|
+
</button>
|
|
137
137
|
`;
|
|
@@ -36,7 +36,7 @@ test('clicking calls click handler with item index', () => {
|
|
|
36
36
|
</WindowSizeContextProvider>
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
component.root.findByType('
|
|
39
|
+
component.root.findByType('button').props.onClick();
|
|
40
40
|
|
|
41
41
|
expect(onClickHandler).toHaveBeenCalledWith(itemIndex);
|
|
42
42
|
|
|
@@ -72,5 +72,5 @@ test('renders root class if not the active Thumbnail', () => {
|
|
|
72
72
|
);
|
|
73
73
|
|
|
74
74
|
expect(component.toJSON()).toMatchSnapshot();
|
|
75
|
-
expect(component.root.findByType('
|
|
75
|
+
expect(component.root.findByType('button').props.className).toEqual('root');
|
|
76
76
|
});
|
|
@@ -39,7 +39,7 @@ const Thumbnail = props => {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
const { handleClick } = talonProps;
|
|
42
|
-
|
|
42
|
+
const selectedItem = isActive ? 'Current Image' : 'Next Image';
|
|
43
43
|
const windowSize = useWindowSize();
|
|
44
44
|
const isDesktop = windowSize.innerWidth >= 1024;
|
|
45
45
|
|
|
@@ -66,14 +66,13 @@ const Thumbnail = props => {
|
|
|
66
66
|
}, [file, isDesktop, label, classes.image]);
|
|
67
67
|
|
|
68
68
|
return (
|
|
69
|
-
<
|
|
69
|
+
<button
|
|
70
70
|
className={isActive ? classes.rootSelected : classes.root}
|
|
71
71
|
onClick={handleClick}
|
|
72
|
-
|
|
73
|
-
aria-hidden="true"
|
|
72
|
+
aria-label={selectedItem}
|
|
74
73
|
>
|
|
75
74
|
{thumbnailImage}
|
|
76
|
-
</
|
|
75
|
+
</button>
|
|
77
76
|
);
|
|
78
77
|
};
|
|
79
78
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`appends "_focused" to className if hasFocus is true 1`] = `
|
|
4
4
|
<button
|
|
5
|
+
aria-label="Color's option red"
|
|
5
6
|
className="root_focused"
|
|
6
7
|
onClick={[Function]}
|
|
7
8
|
style={
|
|
@@ -37,6 +38,7 @@ exports[`appends "_focused" to className if hasFocus is true 1`] = `
|
|
|
37
38
|
|
|
38
39
|
exports[`appends "_outOfStock" to className if isEverythingOutOfStock is true 1`] = `
|
|
39
40
|
<button
|
|
41
|
+
aria-label="Color's option red"
|
|
40
42
|
className="root_outOfStock"
|
|
41
43
|
disabled={true}
|
|
42
44
|
onClick={[Function]}
|
|
@@ -73,6 +75,7 @@ exports[`appends "_outOfStock" to className if isEverythingOutOfStock is true 1`
|
|
|
73
75
|
|
|
74
76
|
exports[`appends "_outOfStock" to className if isOptionOutOfStock is true 1`] = `
|
|
75
77
|
<button
|
|
78
|
+
aria-label="Color's option red"
|
|
76
79
|
className="root_outOfStock"
|
|
77
80
|
disabled={true}
|
|
78
81
|
onClick={[Function]}
|
|
@@ -88,6 +91,7 @@ exports[`appends "_outOfStock" to className if isOptionOutOfStock is true 1`] =
|
|
|
88
91
|
|
|
89
92
|
exports[`appends "_selected" to className if isSelected is true 1`] = `
|
|
90
93
|
<button
|
|
94
|
+
aria-label="Color's Selected option red"
|
|
91
95
|
className="root_selected"
|
|
92
96
|
onClick={[Function]}
|
|
93
97
|
style={
|
|
@@ -123,6 +127,7 @@ exports[`appends "_selected" to className if isSelected is true 1`] = `
|
|
|
123
127
|
|
|
124
128
|
exports[`renders a Swatch correctly 1`] = `
|
|
125
129
|
<button
|
|
130
|
+
aria-label="Color's option red"
|
|
126
131
|
className="root"
|
|
127
132
|
onClick={[Function]}
|
|
128
133
|
style={
|
|
@@ -158,6 +163,7 @@ exports[`renders a Swatch correctly 1`] = `
|
|
|
158
163
|
|
|
159
164
|
exports[`renders an icon if isSelected is true 1`] = `
|
|
160
165
|
<button
|
|
166
|
+
aria-label="Color's Selected option red"
|
|
161
167
|
className="root_selected"
|
|
162
168
|
onClick={[Function]}
|
|
163
169
|
style={
|
|
@@ -40,7 +40,8 @@ const Swatch = props => {
|
|
|
40
40
|
onClick,
|
|
41
41
|
style,
|
|
42
42
|
isEverythingOutOfStock,
|
|
43
|
-
isOptionOutOfStock
|
|
43
|
+
isOptionOutOfStock,
|
|
44
|
+
attributeLabel
|
|
44
45
|
} = props;
|
|
45
46
|
|
|
46
47
|
const talonProps = useSwatch({
|
|
@@ -83,7 +84,8 @@ const Swatch = props => {
|
|
|
83
84
|
'--venia-swatch-bg': swatchValue
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
+
const selectedText = isSelected ? 'Selected' : '';
|
|
88
|
+
const ariaLabel = `${attributeLabel}'s ${selectedText} option ${label}`;
|
|
87
89
|
const className =
|
|
88
90
|
classes[
|
|
89
91
|
getClassName(
|
|
@@ -104,6 +106,7 @@ const Swatch = props => {
|
|
|
104
106
|
type="button"
|
|
105
107
|
data-cy="Swatch-root"
|
|
106
108
|
disabled={isEverythingOutOfStock || isOptionOutOfStock}
|
|
109
|
+
aria-label={ariaLabel}
|
|
107
110
|
>
|
|
108
111
|
{!isOptionOutOfStock && (
|
|
109
112
|
<Icon classes={{ root: checkStyle }} src={CheckIcon} />
|
|
@@ -12,7 +12,8 @@ const SwatchList = props => {
|
|
|
12
12
|
items,
|
|
13
13
|
onSelectionChange,
|
|
14
14
|
isEverythingOutOfStock,
|
|
15
|
-
outOfStockVariants
|
|
15
|
+
outOfStockVariants,
|
|
16
|
+
attributeLabel
|
|
16
17
|
} = props;
|
|
17
18
|
|
|
18
19
|
const classes = useStyle(defaultClasses, props.classes);
|
|
@@ -35,6 +36,7 @@ const SwatchList = props => {
|
|
|
35
36
|
onClick={onSelectionChange}
|
|
36
37
|
isEverythingOutOfStock={isEverythingOutOfStock}
|
|
37
38
|
isOptionOutOfStock={isOptionOutOfStock}
|
|
39
|
+
attributeLabel={attributeLabel}
|
|
38
40
|
/>
|
|
39
41
|
);
|
|
40
42
|
}),
|
|
@@ -44,7 +46,8 @@ const SwatchList = props => {
|
|
|
44
46
|
items,
|
|
45
47
|
onSelectionChange,
|
|
46
48
|
isEverythingOutOfStock,
|
|
47
|
-
outOfStockVariants
|
|
49
|
+
outOfStockVariants,
|
|
50
|
+
attributeLabel
|
|
48
51
|
]
|
|
49
52
|
);
|
|
50
53
|
|
|
@@ -157,6 +157,21 @@ const ProductSort = props => {
|
|
|
157
157
|
setExpanded(!expanded);
|
|
158
158
|
};
|
|
159
159
|
|
|
160
|
+
const handleKeypress = e => {
|
|
161
|
+
if (e.code == 'Enter') {
|
|
162
|
+
setExpanded(expanded);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const result = expanded
|
|
166
|
+
? formatMessage({
|
|
167
|
+
id: 'productSort.sortButtonExpanded',
|
|
168
|
+
defaultMessage: 'Sort Button Expanded'
|
|
169
|
+
})
|
|
170
|
+
: formatMessage({
|
|
171
|
+
id: 'productSort.sortButtonCollapsed',
|
|
172
|
+
defaultMessage: 'Sort Button Collapsed'
|
|
173
|
+
});
|
|
174
|
+
|
|
160
175
|
return (
|
|
161
176
|
<div
|
|
162
177
|
ref={elementRef}
|
|
@@ -171,6 +186,8 @@ const ProductSort = props => {
|
|
|
171
186
|
}}
|
|
172
187
|
onClick={handleSortClick}
|
|
173
188
|
data-cy="ProductSort-sortButton"
|
|
189
|
+
onKeyDown={handleKeypress}
|
|
190
|
+
aria-label={result}
|
|
174
191
|
>
|
|
175
192
|
<span className={classes.mobileText}>
|
|
176
193
|
<FormattedMessage
|
|
@@ -50,6 +50,7 @@ exports[`renders disabled dropdown while loading 1`] = `
|
|
|
50
50
|
className="before"
|
|
51
51
|
/>
|
|
52
52
|
<span
|
|
53
|
+
aria-hidden="false"
|
|
53
54
|
className="after"
|
|
54
55
|
>
|
|
55
56
|
<span
|
|
@@ -139,6 +140,7 @@ exports[`renders dropdown with regions 1`] = `
|
|
|
139
140
|
className="before"
|
|
140
141
|
/>
|
|
141
142
|
<span
|
|
143
|
+
aria-hidden="false"
|
|
142
144
|
className="after"
|
|
143
145
|
>
|
|
144
146
|
<span
|
|
@@ -211,6 +213,7 @@ exports[`renders input with no regions 1`] = `
|
|
|
211
213
|
className="before"
|
|
212
214
|
/>
|
|
213
215
|
<span
|
|
216
|
+
aria-hidden="false"
|
|
214
217
|
className="after"
|
|
215
218
|
/>
|
|
216
219
|
</span>
|
|
@@ -7,6 +7,7 @@ Array [
|
|
|
7
7
|
>
|
|
8
8
|
<img
|
|
9
9
|
alt="Product Name"
|
|
10
|
+
aria-hidden="true"
|
|
10
11
|
className="image placeholder"
|
|
11
12
|
loading="eager"
|
|
12
13
|
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc0JyBoZWlnaHQ9JzUnPjxyZWN0IHdpZHRoPSc0JyBoZWlnaHQ9JzUnIHN0eWxlPSdmaWxsOiBub25lJyAvPjwvc3ZnPg=="
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { bool, shape, string } from 'prop-types';
|
|
3
3
|
import { Form } from 'informed';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
4
5
|
import { useSearchBar } from '@magento/peregrine/lib/talons/SearchBar';
|
|
5
6
|
|
|
6
7
|
import { useStyle } from '../../classify';
|
|
@@ -24,7 +25,7 @@ const SearchBar = React.forwardRef((props, ref) => {
|
|
|
24
25
|
|
|
25
26
|
const classes = useStyle(defaultClasses, props.classes);
|
|
26
27
|
const rootClassName = isOpen ? classes.root_open : classes.root;
|
|
27
|
-
|
|
28
|
+
const { formatMessage } = useIntl();
|
|
28
29
|
return (
|
|
29
30
|
<div className={rootClassName} data-cy="SearchBar-root" ref={ref}>
|
|
30
31
|
<div ref={containerRef} className={classes.container}>
|
|
@@ -43,6 +44,10 @@ const SearchBar = React.forwardRef((props, ref) => {
|
|
|
43
44
|
</div>
|
|
44
45
|
<div className={classes.search}>
|
|
45
46
|
<SearchField
|
|
47
|
+
addLabel={formatMessage({
|
|
48
|
+
id: 'global.clearText',
|
|
49
|
+
defaultMessage: 'Clear Text'
|
|
50
|
+
})}
|
|
46
51
|
isSearchOpen={isOpen}
|
|
47
52
|
onChange={handleChange}
|
|
48
53
|
onFocus={handleFocus}
|
|
@@ -11,11 +11,13 @@ const clearIcon = <Icon src={ClearIcon} size={24} />;
|
|
|
11
11
|
const searchIcon = <Icon src={SearchIcon} size={24} />;
|
|
12
12
|
|
|
13
13
|
const SearchField = props => {
|
|
14
|
-
const { isSearchOpen, onChange, onFocus } = props;
|
|
14
|
+
const { isSearchOpen, onChange, onFocus, addLabel } = props;
|
|
15
15
|
const { inputRef, resetForm, value } = useSearchField({ isSearchOpen });
|
|
16
16
|
|
|
17
17
|
const resetButton = value ? (
|
|
18
|
-
<Trigger action={resetForm}
|
|
18
|
+
<Trigger action={resetForm} addLabel={addLabel}>
|
|
19
|
+
{clearIcon}
|
|
20
|
+
</Trigger>
|
|
19
21
|
) : null;
|
|
20
22
|
|
|
21
23
|
return (
|
|
@@ -59,10 +59,10 @@ exports[`Search Page Component error view does not render when data is present 1
|
|
|
59
59
|
</section>
|
|
60
60
|
</div>
|
|
61
61
|
<Title>
|
|
62
|
-
|
|
62
|
+
undefined's Search Result for term undefined
|
|
63
63
|
</Title>
|
|
64
64
|
<Meta
|
|
65
|
-
content="
|
|
65
|
+
content="undefined's Search Result for term undefined"
|
|
66
66
|
name="title"
|
|
67
67
|
/>
|
|
68
68
|
<Meta
|
|
@@ -105,10 +105,10 @@ exports[`Search Page Component error view renders when data is not present and n
|
|
|
105
105
|
</div>
|
|
106
106
|
</div>
|
|
107
107
|
<Title>
|
|
108
|
-
|
|
108
|
+
undefined's Search Result for term undefined
|
|
109
109
|
</Title>
|
|
110
110
|
<Meta
|
|
111
|
-
content="
|
|
111
|
+
content="undefined's Search Result for term undefined"
|
|
112
112
|
name="title"
|
|
113
113
|
/>
|
|
114
114
|
<Meta
|
|
@@ -177,10 +177,10 @@ exports[`Search Page Component filter button/modal does not render if there are
|
|
|
177
177
|
</section>
|
|
178
178
|
</div>
|
|
179
179
|
<Title>
|
|
180
|
-
|
|
180
|
+
undefined's Search Result for term undefined
|
|
181
181
|
</Title>
|
|
182
182
|
<Meta
|
|
183
|
-
content="
|
|
183
|
+
content="undefined's Search Result for term undefined"
|
|
184
184
|
name="title"
|
|
185
185
|
/>
|
|
186
186
|
<Meta
|
|
@@ -272,10 +272,10 @@ exports[`Search Page Component filter button/modal renders when there are filter
|
|
|
272
272
|
/>
|
|
273
273
|
</div>
|
|
274
274
|
<Title>
|
|
275
|
-
|
|
275
|
+
undefined's Search Result for term undefined
|
|
276
276
|
</Title>
|
|
277
277
|
<Meta
|
|
278
|
-
content="
|
|
278
|
+
content="undefined's Search Result for term undefined"
|
|
279
279
|
name="title"
|
|
280
280
|
/>
|
|
281
281
|
<Meta
|
|
@@ -343,10 +343,10 @@ exports[`Search Page Component loading indicator does not render when data is pr
|
|
|
343
343
|
</section>
|
|
344
344
|
</div>
|
|
345
345
|
<Title>
|
|
346
|
-
|
|
346
|
+
undefined's Search Result for term undefined
|
|
347
347
|
</Title>
|
|
348
348
|
<Meta
|
|
349
|
-
content="
|
|
349
|
+
content="undefined's Search Result for term undefined"
|
|
350
350
|
name="title"
|
|
351
351
|
/>
|
|
352
352
|
<Meta
|
|
@@ -415,10 +415,10 @@ exports[`Search Page Component loading indicator renders when data is not presen
|
|
|
415
415
|
/>
|
|
416
416
|
</div>
|
|
417
417
|
<Title>
|
|
418
|
-
|
|
418
|
+
undefined's Search Result for term undefined
|
|
419
419
|
</Title>
|
|
420
420
|
<Meta
|
|
421
|
-
content="
|
|
421
|
+
content="undefined's Search Result for term undefined"
|
|
422
422
|
name="title"
|
|
423
423
|
/>
|
|
424
424
|
<Meta
|
|
@@ -471,10 +471,10 @@ exports[`Search Page Component search results does not render if data returned h
|
|
|
471
471
|
</div>
|
|
472
472
|
</div>
|
|
473
473
|
<Title>
|
|
474
|
-
|
|
474
|
+
undefined's Search Result for term undefined
|
|
475
475
|
</Title>
|
|
476
476
|
<Meta
|
|
477
|
-
content="
|
|
477
|
+
content="undefined's Search Result for term undefined"
|
|
478
478
|
name="title"
|
|
479
479
|
/>
|
|
480
480
|
<Meta
|
|
@@ -575,10 +575,10 @@ exports[`Search Page Component search results heading renders a generic message
|
|
|
575
575
|
</section>
|
|
576
576
|
</div>
|
|
577
577
|
<Title>
|
|
578
|
-
|
|
578
|
+
undefined's Search Result for term false
|
|
579
579
|
</Title>
|
|
580
580
|
<Meta
|
|
581
|
-
content="
|
|
581
|
+
content="undefined's Search Result for term false"
|
|
582
582
|
name="title"
|
|
583
583
|
/>
|
|
584
584
|
<Meta
|
|
@@ -686,10 +686,10 @@ exports[`Search Page Component search results heading renders a specific message
|
|
|
686
686
|
</section>
|
|
687
687
|
</div>
|
|
688
688
|
<Title>
|
|
689
|
-
Search
|
|
689
|
+
undefined's Search Result for term Search Term
|
|
690
690
|
</Title>
|
|
691
691
|
<Meta
|
|
692
|
-
content="Search
|
|
692
|
+
content="undefined's Search Result for term Search Term"
|
|
693
693
|
name="title"
|
|
694
694
|
/>
|
|
695
695
|
<Meta
|
|
@@ -757,10 +757,10 @@ exports[`Search Page Component search results renders if data has items 1`] = `
|
|
|
757
757
|
</section>
|
|
758
758
|
</div>
|
|
759
759
|
<Title>
|
|
760
|
-
|
|
760
|
+
undefined's Search Result for term undefined
|
|
761
761
|
</Title>
|
|
762
762
|
<Meta
|
|
763
|
-
content="
|
|
763
|
+
content="undefined's Search Result for term undefined"
|
|
764
764
|
name="title"
|
|
765
765
|
/>
|
|
766
766
|
<Meta
|
|
@@ -814,10 +814,10 @@ exports[`Search Page Component sort button/container does not render if total co
|
|
|
814
814
|
</div>
|
|
815
815
|
</div>
|
|
816
816
|
<Title>
|
|
817
|
-
|
|
817
|
+
undefined's Search Result for term undefined
|
|
818
818
|
</Title>
|
|
819
819
|
<Meta
|
|
820
|
-
content="
|
|
820
|
+
content="undefined's Search Result for term undefined"
|
|
821
821
|
name="title"
|
|
822
822
|
/>
|
|
823
823
|
<Meta
|
|
@@ -918,10 +918,10 @@ exports[`Search Page Component sort button/container renders when total count >
|
|
|
918
918
|
</section>
|
|
919
919
|
</div>
|
|
920
920
|
<Title>
|
|
921
|
-
|
|
921
|
+
undefined's Search Result for term undefined
|
|
922
922
|
</Title>
|
|
923
923
|
<Meta
|
|
924
|
-
content="
|
|
924
|
+
content="undefined's Search Result for term undefined"
|
|
925
925
|
name="title"
|
|
926
926
|
/>
|
|
927
927
|
<Meta
|
|
@@ -975,10 +975,10 @@ exports[`Search Page Component total count renders 0 items if data.products.tota
|
|
|
975
975
|
</div>
|
|
976
976
|
</div>
|
|
977
977
|
<Title>
|
|
978
|
-
|
|
978
|
+
undefined's Search Result for term undefined
|
|
979
979
|
</Title>
|
|
980
980
|
<Meta
|
|
981
|
-
content="
|
|
981
|
+
content="undefined's Search Result for term undefined"
|
|
982
982
|
name="title"
|
|
983
983
|
/>
|
|
984
984
|
<Meta
|
|
@@ -1079,10 +1079,10 @@ exports[`Search Page Component total count renders results from data 1`] = `
|
|
|
1079
1079
|
</section>
|
|
1080
1080
|
</div>
|
|
1081
1081
|
<Title>
|
|
1082
|
-
|
|
1082
|
+
undefined's Search Result for term undefined
|
|
1083
1083
|
</Title>
|
|
1084
1084
|
<Meta
|
|
1085
|
-
content="
|
|
1085
|
+
content="undefined's Search Result for term undefined"
|
|
1086
1086
|
name="title"
|
|
1087
1087
|
/>
|
|
1088
1088
|
<Meta
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, Suspense, useMemo } from 'react';
|
|
2
2
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
3
3
|
import { shape, string } from 'prop-types';
|
|
4
|
-
|
|
5
4
|
import { useSearchPage } from '@magento/peregrine/lib/talons/SearchPage/useSearchPage';
|
|
6
5
|
|
|
7
6
|
import { useStyle } from '../../classify';
|
|
@@ -34,11 +33,14 @@ const SearchPage = props => {
|
|
|
34
33
|
pageControl,
|
|
35
34
|
searchCategory,
|
|
36
35
|
searchTerm,
|
|
37
|
-
sortProps
|
|
36
|
+
sortProps,
|
|
37
|
+
currentStoreName
|
|
38
38
|
} = talonProps;
|
|
39
39
|
|
|
40
40
|
const { formatMessage } = useIntl();
|
|
41
|
+
|
|
41
42
|
const [currentSort] = sortProps;
|
|
43
|
+
const metaTitle = `${currentStoreName}'s Search Result for term ${searchTerm}`;
|
|
42
44
|
const content = useMemo(() => {
|
|
43
45
|
if (!data && loading) {
|
|
44
46
|
return (
|
|
@@ -216,8 +218,8 @@ const SearchPage = props => {
|
|
|
216
218
|
{content}
|
|
217
219
|
<Suspense fallback={null}>{maybeFilterModal}</Suspense>
|
|
218
220
|
</div>
|
|
219
|
-
<Title>{
|
|
220
|
-
<Meta name="title" content={
|
|
221
|
+
<Title>{metaTitle}</Title>
|
|
222
|
+
<Meta name="title" content={metaTitle} />
|
|
221
223
|
<Meta name="description" content={metaLabel} />
|
|
222
224
|
</article>
|
|
223
225
|
);
|