@bonlineza/luxity-lib 2.38.0 → 2.38.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/CurrencySelect.js +27 -27
- package/GraphQLDropdownSelector.js +8 -8
- package/LuxityDesktopHeader.js +117 -79
- package/LuxityFooter.js +28 -27
- package/LuxityGraphQLDropdownSelector.js +8 -8
- package/LuxityMobileHeader.js +133 -95
- package/LuxitySideNav.js +27 -27
- package/MaterialSelector.js +8 -8
- package/ModelSelector.js +8 -8
- package/Tooltip.js +27 -27
- package/build/bundle.css +1 -1
- package/build/bundle.js +159 -108
- package/package.json +1 -1
package/CurrencySelect.js
CHANGED
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
var relativeInlineStyle = styled.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
43
43
|
var topMiddleBodyStyle = styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
44
44
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
45
|
-
return styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props
|
|
45
|
+
return styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props.$apexWidth, props.$apexWidth, props.theme.colors.base);
|
|
46
46
|
};
|
|
47
47
|
var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
|
|
48
|
-
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props
|
|
48
|
+
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.$bodyWidth);
|
|
49
49
|
};
|
|
50
50
|
var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
|
|
51
51
|
return styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /*Top Arrow*/\n bottom: 100%; /* At the top of the tooltip */\n top: initial;\n left: 50%;\n border-style: solid;\n border-color: transparent transparent ", " transparent;\n"])), props.theme.colors.base);
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
|
|
56
56
|
var getBodyStyle = function getBodyStyle() {
|
|
57
57
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
58
|
-
var _props
|
|
59
|
-
toolTipPosition = _props
|
|
58
|
+
var _props$$toolTipPositi = props.$toolTipPosition,
|
|
59
|
+
$toolTipPosition = _props$$toolTipPositi === void 0 ? '' : _props$$toolTipPositi;
|
|
60
60
|
|
|
61
|
-
switch (toolTipPosition) {
|
|
61
|
+
switch ($toolTipPosition) {
|
|
62
62
|
case 'top':
|
|
63
63
|
return topMiddleBodyStyle;
|
|
64
64
|
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
|
|
73
73
|
var getAfterStyling = function getAfterStyling() {
|
|
74
74
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
75
|
-
var toolTipPosition = props
|
|
75
|
+
var $toolTipPosition = props.$toolTipPosition;
|
|
76
76
|
|
|
77
|
-
switch (toolTipPosition) {
|
|
77
|
+
switch ($toolTipPosition) {
|
|
78
78
|
case 'top':
|
|
79
79
|
return getTopMiddleArrowAfterStyle(props);
|
|
80
80
|
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
var Body = styled__default.span(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
90
|
-
return props
|
|
90
|
+
return props.$bodyWidth;
|
|
91
91
|
}, function (props) {
|
|
92
92
|
return props.theme.colors.base || 'black';
|
|
93
93
|
}, function (props) {
|
|
@@ -163,33 +163,33 @@
|
|
|
163
163
|
});
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
+
/* eslint-disable react/require-default-props */
|
|
167
|
+
|
|
166
168
|
var Tooltip = function Tooltip(_ref) {
|
|
167
|
-
var children = _ref.children,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
var _ref$children = _ref.children,
|
|
170
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
171
|
+
_ref$toolTipText = _ref.toolTipText,
|
|
172
|
+
toolTipText = _ref$toolTipText === void 0 ? '' : _ref$toolTipText,
|
|
173
|
+
_ref$toolTipPosition = _ref.toolTipPosition,
|
|
174
|
+
toolTipPosition = _ref$toolTipPosition === void 0 ? 'top' : _ref$toolTipPosition,
|
|
175
|
+
_ref$bodyWidth = _ref.bodyWidth,
|
|
176
|
+
bodyWidth = _ref$bodyWidth === void 0 ? '8em' : _ref$bodyWidth,
|
|
177
|
+
_ref$apexWidth = _ref.apexWidth,
|
|
178
|
+
apexWidth = _ref$apexWidth === void 0 ? '5px' : _ref$apexWidth,
|
|
179
|
+
_ref$containerClassNa = _ref.containerClassName,
|
|
180
|
+
containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
|
|
181
|
+
_ref$bodyClassName = _ref.bodyClassName,
|
|
182
|
+
bodyClassName = _ref$bodyClassName === void 0 ? '' : _ref$bodyClassName;
|
|
174
183
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
175
184
|
className: containerClassName
|
|
176
185
|
}, children, /*#__PURE__*/React__default.createElement(Body, {
|
|
177
|
-
toolTipPosition: toolTipPosition,
|
|
178
|
-
bodyWidth: bodyWidth,
|
|
179
|
-
apexWidth: apexWidth,
|
|
186
|
+
$toolTipPosition: toolTipPosition,
|
|
187
|
+
$bodyWidth: bodyWidth,
|
|
188
|
+
$apexWidth: apexWidth,
|
|
180
189
|
className: bodyClassName
|
|
181
190
|
}, toolTipText));
|
|
182
191
|
};
|
|
183
192
|
|
|
184
|
-
Tooltip.defaultProps = {
|
|
185
|
-
children: null,
|
|
186
|
-
toolTipText: '',
|
|
187
|
-
toolTipPosition: 'top',
|
|
188
|
-
bodyWidth: '8em',
|
|
189
|
-
apexWidth: '5px',
|
|
190
|
-
containerClassName: '',
|
|
191
|
-
bodyClassName: ''
|
|
192
|
-
};
|
|
193
193
|
var Tooltip$1 = themed(Tooltip);
|
|
194
194
|
|
|
195
195
|
var CurrencySelect = function CurrencySelect(_ref) {
|
|
@@ -1313,10 +1313,10 @@
|
|
|
1313
1313
|
var relativeInlineStyle = styled.css(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
1314
1314
|
var topMiddleBodyStyle = styled.css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
1315
1315
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
1316
|
-
return styled.css(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props
|
|
1316
|
+
return styled.css(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props.$apexWidth, props.$apexWidth, props.theme.colors.base);
|
|
1317
1317
|
};
|
|
1318
1318
|
var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
|
|
1319
|
-
return styled.css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props
|
|
1319
|
+
return styled.css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.$bodyWidth);
|
|
1320
1320
|
};
|
|
1321
1321
|
var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
|
|
1322
1322
|
return styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /*Top Arrow*/\n bottom: 100%; /* At the top of the tooltip */\n top: initial;\n left: 50%;\n border-style: solid;\n border-color: transparent transparent ", " transparent;\n"])), props.theme.colors.base);
|
|
@@ -1326,10 +1326,10 @@
|
|
|
1326
1326
|
|
|
1327
1327
|
var getBodyStyle = function getBodyStyle() {
|
|
1328
1328
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1329
|
-
var _props
|
|
1330
|
-
toolTipPosition = _props
|
|
1329
|
+
var _props$$toolTipPositi = props.$toolTipPosition,
|
|
1330
|
+
$toolTipPosition = _props$$toolTipPositi === void 0 ? '' : _props$$toolTipPositi;
|
|
1331
1331
|
|
|
1332
|
-
switch (toolTipPosition) {
|
|
1332
|
+
switch ($toolTipPosition) {
|
|
1333
1333
|
case 'top':
|
|
1334
1334
|
return topMiddleBodyStyle;
|
|
1335
1335
|
|
|
@@ -1343,9 +1343,9 @@
|
|
|
1343
1343
|
|
|
1344
1344
|
var getAfterStyling = function getAfterStyling() {
|
|
1345
1345
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1346
|
-
var toolTipPosition = props
|
|
1346
|
+
var $toolTipPosition = props.$toolTipPosition;
|
|
1347
1347
|
|
|
1348
|
-
switch (toolTipPosition) {
|
|
1348
|
+
switch ($toolTipPosition) {
|
|
1349
1349
|
case 'top':
|
|
1350
1350
|
return getTopMiddleArrowAfterStyle(props);
|
|
1351
1351
|
|
|
@@ -1358,7 +1358,7 @@
|
|
|
1358
1358
|
};
|
|
1359
1359
|
|
|
1360
1360
|
var Body$1 = styled__default.span(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
1361
|
-
return props
|
|
1361
|
+
return props.$bodyWidth;
|
|
1362
1362
|
}, function (props) {
|
|
1363
1363
|
return props.theme.colors.base || 'black';
|
|
1364
1364
|
}, function (props) {
|
package/LuxityDesktopHeader.js
CHANGED
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
};
|
|
299
299
|
|
|
300
300
|
var SearchResults = function SearchResults(_ref) {
|
|
301
|
-
var _searchResults$brands, _searchResults$produc,
|
|
301
|
+
var _searchResults$brands, _searchResults$produc, _initialSearchData$tr, _initialSearchData$la, _limitBrands, _limitBrands2, _initialSearchData$la2, _searchResults$produc2;
|
|
302
302
|
|
|
303
303
|
var searchValue = _ref.searchValue,
|
|
304
304
|
searchResults = _ref.searchResults,
|
|
@@ -312,7 +312,10 @@
|
|
|
312
312
|
currency = _ref.currency,
|
|
313
313
|
currencySymbol = _ref.currencySymbol,
|
|
314
314
|
onProductSearchResultClick = _ref.onProductSearchResultClick,
|
|
315
|
-
onBrandSearchResultClick = _ref.onBrandSearchResultClick
|
|
315
|
+
onBrandSearchResultClick = _ref.onBrandSearchResultClick,
|
|
316
|
+
onCreateInterests = _ref.onCreateInterests,
|
|
317
|
+
noResultsImage = _ref.noResultsImage,
|
|
318
|
+
showNoResults = _ref.showNoResults;
|
|
316
319
|
|
|
317
320
|
var _useState = React.useState(false),
|
|
318
321
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -330,15 +333,16 @@
|
|
|
330
333
|
window.removeEventListener('resize', checkIfMobile);
|
|
331
334
|
};
|
|
332
335
|
}, []);
|
|
333
|
-
var
|
|
334
|
-
var hasResults = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$
|
|
336
|
+
var hasSearchBeenPerformed = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim().length) >= 3;
|
|
337
|
+
var hasResults = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$brands = searchResults.brands) === null || _searchResults$brands === void 0 ? void 0 : _searchResults$brands.length) > 0 || (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$produc = searchResults.products) === null || _searchResults$produc === void 0 ? void 0 : _searchResults$produc.length) > 0;
|
|
335
338
|
var hasInitialData = (initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$tr = initialSearchData.trending_brands) === null || _initialSearchData$tr === void 0 ? void 0 : _initialSearchData$tr.length) > 0 || (initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$la = initialSearchData.latest_products) === null || _initialSearchData$la === void 0 ? void 0 : _initialSearchData$la.length) > 0;
|
|
339
|
+
var shouldShowInitialData = isSearchFocused && (!hasSearchBeenPerformed || !hasResults && !showNoResults);
|
|
336
340
|
|
|
337
|
-
if (!
|
|
341
|
+
if (!isSearchFocused) {
|
|
338
342
|
return null;
|
|
339
343
|
}
|
|
340
344
|
|
|
341
|
-
if (!
|
|
345
|
+
if (!hasResults && !hasInitialData && !showNoResults) {
|
|
342
346
|
return null;
|
|
343
347
|
}
|
|
344
348
|
|
|
@@ -419,7 +423,36 @@
|
|
|
419
423
|
}
|
|
420
424
|
|
|
421
425
|
return brands;
|
|
422
|
-
};
|
|
426
|
+
}; // Show no results state
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
if (showNoResults) {
|
|
430
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
431
|
+
className: "search-results",
|
|
432
|
+
ref: searchResultsRef
|
|
433
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
434
|
+
className: "search-results__no-results"
|
|
435
|
+
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
436
|
+
className: "search-results__header"
|
|
437
|
+
}, "TOP MATCHES"), /*#__PURE__*/React__default.createElement("div", {
|
|
438
|
+
className: "search-results__no-results-content"
|
|
439
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
440
|
+
className: "search-results__no-results-image"
|
|
441
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
442
|
+
src: noResultsImage,
|
|
443
|
+
alt: "No results"
|
|
444
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
445
|
+
className: "search-results__no-results-text"
|
|
446
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
447
|
+
className: "search-results__no-results-title"
|
|
448
|
+
}, "There are currently no products in stock that match your selection"), /*#__PURE__*/React__default.createElement("p", {
|
|
449
|
+
className: "search-results__no-results-description"
|
|
450
|
+
}, "Create an interest now and receive instant notifications as your interests list."))), /*#__PURE__*/React__default.createElement("button", {
|
|
451
|
+
type: "button",
|
|
452
|
+
className: "search-results__create-interest-button",
|
|
453
|
+
onClick: onCreateInterests
|
|
454
|
+
}, "Create Interests")));
|
|
455
|
+
}
|
|
423
456
|
|
|
424
457
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
425
458
|
className: "search-results",
|
|
@@ -476,7 +509,7 @@
|
|
|
476
509
|
}
|
|
477
510
|
}, "View all items")), /*#__PURE__*/React__default.createElement("div", {
|
|
478
511
|
className: "search-results__product-list"
|
|
479
|
-
}, shouldShowInitialData ? initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$la2 = initialSearchData.latest_products) === null || _initialSearchData$la2 === void 0 ? void 0 : _initialSearchData$la2.map(renderProductCard) : searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$
|
|
512
|
+
}, shouldShowInitialData ? initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$la2 = initialSearchData.latest_products) === null || _initialSearchData$la2 === void 0 ? void 0 : _initialSearchData$la2.map(renderProductCard) : searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$produc2 = searchResults.products) === null || _searchResults$produc2 === void 0 ? void 0 : _searchResults$produc2.map(renderProductCard)), /*#__PURE__*/React__default.createElement("button", {
|
|
480
513
|
type: "button",
|
|
481
514
|
className: "search-results__view-all-button",
|
|
482
515
|
onClick: function onClick() {
|
|
@@ -497,10 +530,10 @@
|
|
|
497
530
|
var relativeInlineStyle = styled.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
498
531
|
var topMiddleBodyStyle = styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
499
532
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
500
|
-
return styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props
|
|
533
|
+
return styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props.$apexWidth, props.$apexWidth, props.theme.colors.base);
|
|
501
534
|
};
|
|
502
535
|
var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
|
|
503
|
-
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props
|
|
536
|
+
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.$bodyWidth);
|
|
504
537
|
};
|
|
505
538
|
var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
|
|
506
539
|
return styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /*Top Arrow*/\n bottom: 100%; /* At the top of the tooltip */\n top: initial;\n left: 50%;\n border-style: solid;\n border-color: transparent transparent ", " transparent;\n"])), props.theme.colors.base);
|
|
@@ -510,10 +543,10 @@
|
|
|
510
543
|
|
|
511
544
|
var getBodyStyle = function getBodyStyle() {
|
|
512
545
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
513
|
-
var _props
|
|
514
|
-
toolTipPosition = _props
|
|
546
|
+
var _props$$toolTipPositi = props.$toolTipPosition,
|
|
547
|
+
$toolTipPosition = _props$$toolTipPositi === void 0 ? '' : _props$$toolTipPositi;
|
|
515
548
|
|
|
516
|
-
switch (toolTipPosition) {
|
|
549
|
+
switch ($toolTipPosition) {
|
|
517
550
|
case 'top':
|
|
518
551
|
return topMiddleBodyStyle;
|
|
519
552
|
|
|
@@ -527,9 +560,9 @@
|
|
|
527
560
|
|
|
528
561
|
var getAfterStyling = function getAfterStyling() {
|
|
529
562
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
530
|
-
var toolTipPosition = props
|
|
563
|
+
var $toolTipPosition = props.$toolTipPosition;
|
|
531
564
|
|
|
532
|
-
switch (toolTipPosition) {
|
|
565
|
+
switch ($toolTipPosition) {
|
|
533
566
|
case 'top':
|
|
534
567
|
return getTopMiddleArrowAfterStyle(props);
|
|
535
568
|
|
|
@@ -542,7 +575,7 @@
|
|
|
542
575
|
};
|
|
543
576
|
|
|
544
577
|
var Body = styled__default.span(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
545
|
-
return props
|
|
578
|
+
return props.$bodyWidth;
|
|
546
579
|
}, function (props) {
|
|
547
580
|
return props.theme.colors.base || 'black';
|
|
548
581
|
}, function (props) {
|
|
@@ -618,33 +651,33 @@
|
|
|
618
651
|
});
|
|
619
652
|
});
|
|
620
653
|
|
|
654
|
+
/* eslint-disable react/require-default-props */
|
|
655
|
+
|
|
621
656
|
var Tooltip = function Tooltip(_ref) {
|
|
622
|
-
var children = _ref.children,
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
657
|
+
var _ref$children = _ref.children,
|
|
658
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
659
|
+
_ref$toolTipText = _ref.toolTipText,
|
|
660
|
+
toolTipText = _ref$toolTipText === void 0 ? '' : _ref$toolTipText,
|
|
661
|
+
_ref$toolTipPosition = _ref.toolTipPosition,
|
|
662
|
+
toolTipPosition = _ref$toolTipPosition === void 0 ? 'top' : _ref$toolTipPosition,
|
|
663
|
+
_ref$bodyWidth = _ref.bodyWidth,
|
|
664
|
+
bodyWidth = _ref$bodyWidth === void 0 ? '8em' : _ref$bodyWidth,
|
|
665
|
+
_ref$apexWidth = _ref.apexWidth,
|
|
666
|
+
apexWidth = _ref$apexWidth === void 0 ? '5px' : _ref$apexWidth,
|
|
667
|
+
_ref$containerClassNa = _ref.containerClassName,
|
|
668
|
+
containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
|
|
669
|
+
_ref$bodyClassName = _ref.bodyClassName,
|
|
670
|
+
bodyClassName = _ref$bodyClassName === void 0 ? '' : _ref$bodyClassName;
|
|
629
671
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
630
672
|
className: containerClassName
|
|
631
673
|
}, children, /*#__PURE__*/React__default.createElement(Body, {
|
|
632
|
-
toolTipPosition: toolTipPosition,
|
|
633
|
-
bodyWidth: bodyWidth,
|
|
634
|
-
apexWidth: apexWidth,
|
|
674
|
+
$toolTipPosition: toolTipPosition,
|
|
675
|
+
$bodyWidth: bodyWidth,
|
|
676
|
+
$apexWidth: apexWidth,
|
|
635
677
|
className: bodyClassName
|
|
636
678
|
}, toolTipText));
|
|
637
679
|
};
|
|
638
680
|
|
|
639
|
-
Tooltip.defaultProps = {
|
|
640
|
-
children: null,
|
|
641
|
-
toolTipText: '',
|
|
642
|
-
toolTipPosition: 'top',
|
|
643
|
-
bodyWidth: '8em',
|
|
644
|
-
apexWidth: '5px',
|
|
645
|
-
containerClassName: '',
|
|
646
|
-
bodyClassName: ''
|
|
647
|
-
};
|
|
648
681
|
var Tooltip$1 = themed(Tooltip);
|
|
649
682
|
|
|
650
683
|
var CurrencySelect = function CurrencySelect(_ref) {
|
|
@@ -722,7 +755,8 @@
|
|
|
722
755
|
var endpoint = _ref.endpoint,
|
|
723
756
|
onSearchLoading = _ref.onSearchLoading,
|
|
724
757
|
currency = _ref.currency,
|
|
725
|
-
onSearchPreview = _ref.onSearchPreview
|
|
758
|
+
onSearchPreview = _ref.onSearchPreview,
|
|
759
|
+
onNoResults = _ref.onNoResults;
|
|
726
760
|
var currentSearchRequestToken = React.useRef(null);
|
|
727
761
|
var debounce = React.useCallback(function (func, wait) {
|
|
728
762
|
var timeout;
|
|
@@ -759,7 +793,12 @@
|
|
|
759
793
|
setSearchResults({
|
|
760
794
|
brands: [],
|
|
761
795
|
products: []
|
|
762
|
-
});
|
|
796
|
+
}); // Reset no results state when clearing search
|
|
797
|
+
|
|
798
|
+
if (typeof onNoResults === 'function') {
|
|
799
|
+
onNoResults(false);
|
|
800
|
+
}
|
|
801
|
+
|
|
763
802
|
return;
|
|
764
803
|
} // Cancel any ongoing search request to prevent race conditions
|
|
765
804
|
|
|
@@ -770,7 +809,12 @@
|
|
|
770
809
|
|
|
771
810
|
|
|
772
811
|
var newSearchToken = axios.CancelToken.source();
|
|
773
|
-
currentSearchRequestToken.current = newSearchToken; //
|
|
812
|
+
currentSearchRequestToken.current = newSearchToken; // Reset no results state when starting new search (user is typing)
|
|
813
|
+
|
|
814
|
+
if (typeof onNoResults === 'function') {
|
|
815
|
+
onNoResults(false);
|
|
816
|
+
} // Set loading to true when starting the search request
|
|
817
|
+
|
|
774
818
|
|
|
775
819
|
if (typeof onSearchLoading === 'function') {
|
|
776
820
|
onSearchLoading(true);
|
|
@@ -830,7 +874,13 @@
|
|
|
830
874
|
products: products,
|
|
831
875
|
total: totalResults
|
|
832
876
|
};
|
|
833
|
-
setSearchResults(searchResults);
|
|
877
|
+
setSearchResults(searchResults); // Check if we have no results (empty aggregations)
|
|
878
|
+
|
|
879
|
+
var hasNoResults = brandsData.length === 0 && productsData.length === 0;
|
|
880
|
+
|
|
881
|
+
if (typeof onNoResults === 'function') {
|
|
882
|
+
onNoResults(hasNoResults);
|
|
883
|
+
}
|
|
834
884
|
|
|
835
885
|
if (typeof onSearchPreview === 'function') {
|
|
836
886
|
var hasResults = brands.length > 0 || products.length > 0;
|
|
@@ -840,11 +890,7 @@
|
|
|
840
890
|
});
|
|
841
891
|
}
|
|
842
892
|
|
|
843
|
-
currentSearchRequestToken.current = null;
|
|
844
|
-
|
|
845
|
-
if (typeof onSearchLoading === 'function') {
|
|
846
|
-
onSearchLoading(false);
|
|
847
|
-
}
|
|
893
|
+
currentSearchRequestToken.current = null;
|
|
848
894
|
}
|
|
849
895
|
}).catch(function (error) {
|
|
850
896
|
if (!axios.isCancel(error)) {
|
|
@@ -852,14 +898,10 @@
|
|
|
852
898
|
brands: [],
|
|
853
899
|
products: []
|
|
854
900
|
});
|
|
855
|
-
currentSearchRequestToken.current = null;
|
|
856
|
-
|
|
857
|
-
if (typeof onSearchLoading === 'function') {
|
|
858
|
-
onSearchLoading(false);
|
|
859
|
-
}
|
|
901
|
+
currentSearchRequestToken.current = null;
|
|
860
902
|
}
|
|
861
903
|
});
|
|
862
|
-
}, [endpoint, currency, onSearchPreview, onSearchLoading]);
|
|
904
|
+
}, [endpoint, currency, onSearchPreview, onSearchLoading, onNoResults]);
|
|
863
905
|
var debouncedSearch = React.useMemo(function () {
|
|
864
906
|
return debounce(function (searchQuery, setSearchResults) {
|
|
865
907
|
return performSearch(searchQuery, setSearchResults);
|
|
@@ -964,22 +1006,6 @@
|
|
|
964
1006
|
}
|
|
965
1007
|
}, [searchValue, immediateSearch, setIsSearchFocused, setSearchValue]);
|
|
966
1008
|
};
|
|
967
|
-
var useSearchUrlQuery = function useSearchUrlQuery(setSearchValue, debouncedSearch) {
|
|
968
|
-
var hasProcessedUrlQuery = React.useRef(false);
|
|
969
|
-
React.useEffect(function () {
|
|
970
|
-
if (hasProcessedUrlQuery.current) return;
|
|
971
|
-
var urlParams = new URLSearchParams(window.location.search);
|
|
972
|
-
var queryParam = urlParams.get('q');
|
|
973
|
-
var isSearchPage = window.location.pathname.includes('/search');
|
|
974
|
-
|
|
975
|
-
if (queryParam && queryParam.trim() !== '' && isSearchPage) {
|
|
976
|
-
hasProcessedUrlQuery.current = true;
|
|
977
|
-
setSearchValue(queryParam);
|
|
978
|
-
debouncedSearch(queryParam);
|
|
979
|
-
}
|
|
980
|
-
}, [setSearchValue, debouncedSearch]);
|
|
981
|
-
return hasProcessedUrlQuery;
|
|
982
|
-
};
|
|
983
1009
|
|
|
984
1010
|
var removeCategoryByName = function removeCategoryByName(categories, name) {
|
|
985
1011
|
var _categories$filter;
|
|
@@ -1029,17 +1055,9 @@
|
|
|
1029
1055
|
isExclusive = _ref.isExclusive,
|
|
1030
1056
|
shop = _ref.shop,
|
|
1031
1057
|
app = _ref.app,
|
|
1032
|
-
categoryConfig = _ref.categoryConfig
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
endpoint: endpoint,
|
|
1036
|
-
onSearchLoading: onSearchLoading,
|
|
1037
|
-
currency: currency,
|
|
1038
|
-
onSearchPreview: onSearchPreview
|
|
1039
|
-
}),
|
|
1040
|
-
fetchInitialSearchData = _useSearch.fetchInitialSearchData,
|
|
1041
|
-
createDebouncedSearch = _useSearch.createDebouncedSearch,
|
|
1042
|
-
createImmediateSearch = _useSearch.createImmediateSearch;
|
|
1058
|
+
categoryConfig = _ref.categoryConfig,
|
|
1059
|
+
onCreateInterests = _ref.onCreateInterests,
|
|
1060
|
+
noResultsImage = _ref.noResultsImage;
|
|
1043
1061
|
|
|
1044
1062
|
var _useState = React.useState(''),
|
|
1045
1063
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1090,14 +1108,30 @@
|
|
|
1090
1108
|
cachedResults = _useState16[0],
|
|
1091
1109
|
setCachedResults = _useState16[1];
|
|
1092
1110
|
|
|
1111
|
+
var _useState17 = React.useState(false),
|
|
1112
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
1113
|
+
showNoResults = _useState18[0],
|
|
1114
|
+
setShowNoResults = _useState18[1];
|
|
1115
|
+
|
|
1093
1116
|
var searchResultsRef = React.useRef(null);
|
|
1117
|
+
|
|
1118
|
+
var _useSearch = useSearch({
|
|
1119
|
+
endpoint: endpoint,
|
|
1120
|
+
onSearchLoading: onSearchLoading,
|
|
1121
|
+
currency: currency,
|
|
1122
|
+
onSearchPreview: onSearchPreview,
|
|
1123
|
+
onNoResults: setShowNoResults
|
|
1124
|
+
}),
|
|
1125
|
+
fetchInitialSearchData = _useSearch.fetchInitialSearchData,
|
|
1126
|
+
createDebouncedSearch = _useSearch.createDebouncedSearch,
|
|
1127
|
+
createImmediateSearch = _useSearch.createImmediateSearch;
|
|
1128
|
+
|
|
1094
1129
|
var debouncedSearch = createDebouncedSearch(function (results) {
|
|
1095
1130
|
setSearchResults(results);
|
|
1096
1131
|
setCachedResults(results);
|
|
1097
1132
|
});
|
|
1098
1133
|
var immediateSearch = createImmediateSearch(setSearchValue, setSearchResults, onSearchSubmit);
|
|
1099
1134
|
var handleChange = useSearchInputChange(setSearchValue, setIsSearchFocused, debouncedSearch, setSearchResults, setCachedResults);
|
|
1100
|
-
useSearchUrlQuery(setSearchValue, debouncedSearch);
|
|
1101
1135
|
useSearchClickOutside(searchResultsRef, searchResults, setCachedResults, setIsSearchFocused, setSearchResults);
|
|
1102
1136
|
|
|
1103
1137
|
var handleSearchClick = function handleSearchClick() {
|
|
@@ -1224,6 +1258,7 @@
|
|
|
1224
1258
|
products: []
|
|
1225
1259
|
});
|
|
1226
1260
|
setIsSearchFocused(false);
|
|
1261
|
+
setShowNoResults(false);
|
|
1227
1262
|
},
|
|
1228
1263
|
searchResultsRef: searchResultsRef,
|
|
1229
1264
|
onSearchSubmit: onSearchSubmit,
|
|
@@ -1234,7 +1269,10 @@
|
|
|
1234
1269
|
currency: currency,
|
|
1235
1270
|
currencySymbol: currencySymbol,
|
|
1236
1271
|
onProductSearchResultClick: onProductSearchResultClick,
|
|
1237
|
-
onBrandSearchResultClick: onBrandSearchResultClick
|
|
1272
|
+
onBrandSearchResultClick: onBrandSearchResultClick,
|
|
1273
|
+
onCreateInterests: onCreateInterests,
|
|
1274
|
+
noResultsImage: noResultsImage,
|
|
1275
|
+
showNoResults: showNoResults
|
|
1238
1276
|
}), /*#__PURE__*/React__default.createElement("nav", {
|
|
1239
1277
|
className: "navbar__nav-links navbar__nav-links--wrap"
|
|
1240
1278
|
}, renderDropdownLinks(), !!stores.length && /*#__PURE__*/React__default.createElement("li", {
|
package/LuxityFooter.js
CHANGED
|
@@ -1931,10 +1931,10 @@
|
|
|
1931
1931
|
var relativeInlineStyle = styled.css(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
1932
1932
|
var topMiddleBodyStyle = styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
1933
1933
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
1934
|
-
return styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props
|
|
1934
|
+
return styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props.$apexWidth, props.$apexWidth, props.theme.colors.base);
|
|
1935
1935
|
};
|
|
1936
1936
|
var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
|
|
1937
|
-
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props
|
|
1937
|
+
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.$bodyWidth);
|
|
1938
1938
|
};
|
|
1939
1939
|
var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
|
|
1940
1940
|
return styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /*Top Arrow*/\n bottom: 100%; /* At the top of the tooltip */\n top: initial;\n left: 50%;\n border-style: solid;\n border-color: transparent transparent ", " transparent;\n"])), props.theme.colors.base);
|
|
@@ -1944,10 +1944,10 @@
|
|
|
1944
1944
|
|
|
1945
1945
|
var getBodyStyle = function getBodyStyle() {
|
|
1946
1946
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1947
|
-
var _props
|
|
1948
|
-
toolTipPosition = _props
|
|
1947
|
+
var _props$$toolTipPositi = props.$toolTipPosition,
|
|
1948
|
+
$toolTipPosition = _props$$toolTipPositi === void 0 ? '' : _props$$toolTipPositi;
|
|
1949
1949
|
|
|
1950
|
-
switch (toolTipPosition) {
|
|
1950
|
+
switch ($toolTipPosition) {
|
|
1951
1951
|
case 'top':
|
|
1952
1952
|
return topMiddleBodyStyle;
|
|
1953
1953
|
|
|
@@ -1961,9 +1961,9 @@
|
|
|
1961
1961
|
|
|
1962
1962
|
var getAfterStyling = function getAfterStyling() {
|
|
1963
1963
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1964
|
-
var toolTipPosition = props
|
|
1964
|
+
var $toolTipPosition = props.$toolTipPosition;
|
|
1965
1965
|
|
|
1966
|
-
switch (toolTipPosition) {
|
|
1966
|
+
switch ($toolTipPosition) {
|
|
1967
1967
|
case 'top':
|
|
1968
1968
|
return getTopMiddleArrowAfterStyle(props);
|
|
1969
1969
|
|
|
@@ -1976,7 +1976,7 @@
|
|
|
1976
1976
|
};
|
|
1977
1977
|
|
|
1978
1978
|
var Body = styled__default.span(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
1979
|
-
return props
|
|
1979
|
+
return props.$bodyWidth;
|
|
1980
1980
|
}, function (props) {
|
|
1981
1981
|
return props.theme.colors.base || 'black';
|
|
1982
1982
|
}, function (props) {
|
|
@@ -1988,33 +1988,33 @@
|
|
|
1988
1988
|
var _templateObject$3;
|
|
1989
1989
|
var Container = styled__default.div(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n ", ";\n cursor: pointer;\n &:hover ", " {\n opacity: 1;\n visibility: visible;\n }\n"])), relativeInlineStyle, Body);
|
|
1990
1990
|
|
|
1991
|
+
/* eslint-disable react/require-default-props */
|
|
1992
|
+
|
|
1991
1993
|
var Tooltip = function Tooltip(_ref) {
|
|
1992
|
-
var children = _ref.children,
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1994
|
+
var _ref$children = _ref.children,
|
|
1995
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
1996
|
+
_ref$toolTipText = _ref.toolTipText,
|
|
1997
|
+
toolTipText = _ref$toolTipText === void 0 ? '' : _ref$toolTipText,
|
|
1998
|
+
_ref$toolTipPosition = _ref.toolTipPosition,
|
|
1999
|
+
toolTipPosition = _ref$toolTipPosition === void 0 ? 'top' : _ref$toolTipPosition,
|
|
2000
|
+
_ref$bodyWidth = _ref.bodyWidth,
|
|
2001
|
+
bodyWidth = _ref$bodyWidth === void 0 ? '8em' : _ref$bodyWidth,
|
|
2002
|
+
_ref$apexWidth = _ref.apexWidth,
|
|
2003
|
+
apexWidth = _ref$apexWidth === void 0 ? '5px' : _ref$apexWidth,
|
|
2004
|
+
_ref$containerClassNa = _ref.containerClassName,
|
|
2005
|
+
containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
|
|
2006
|
+
_ref$bodyClassName = _ref.bodyClassName,
|
|
2007
|
+
bodyClassName = _ref$bodyClassName === void 0 ? '' : _ref$bodyClassName;
|
|
1999
2008
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
2000
2009
|
className: containerClassName
|
|
2001
2010
|
}, children, /*#__PURE__*/React__default.createElement(Body, {
|
|
2002
|
-
toolTipPosition: toolTipPosition,
|
|
2003
|
-
bodyWidth: bodyWidth,
|
|
2004
|
-
apexWidth: apexWidth,
|
|
2011
|
+
$toolTipPosition: toolTipPosition,
|
|
2012
|
+
$bodyWidth: bodyWidth,
|
|
2013
|
+
$apexWidth: apexWidth,
|
|
2005
2014
|
className: bodyClassName
|
|
2006
2015
|
}, toolTipText));
|
|
2007
2016
|
};
|
|
2008
2017
|
|
|
2009
|
-
Tooltip.defaultProps = {
|
|
2010
|
-
children: null,
|
|
2011
|
-
toolTipText: '',
|
|
2012
|
-
toolTipPosition: 'top',
|
|
2013
|
-
bodyWidth: '8em',
|
|
2014
|
-
apexWidth: '5px',
|
|
2015
|
-
containerClassName: '',
|
|
2016
|
-
bodyClassName: ''
|
|
2017
|
-
};
|
|
2018
2018
|
var Tooltip$1 = themed(Tooltip);
|
|
2019
2019
|
|
|
2020
2020
|
var CurrencySelect = function CurrencySelect(_ref) {
|
|
@@ -2161,6 +2161,7 @@
|
|
|
2161
2161
|
track: link === null || link === void 0 ? void 0 : link.track,
|
|
2162
2162
|
target: link.target
|
|
2163
2163
|
}, link.label) : /*#__PURE__*/React__default.createElement("div", {
|
|
2164
|
+
key: link.label,
|
|
2164
2165
|
className: "footer__text"
|
|
2165
2166
|
}, link.label);
|
|
2166
2167
|
})));
|