@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.
@@ -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.apexWidth, props.apexWidth, props.theme.colors.base);
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.bodyWidth);
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$toolTipPositio = props.toolTipPosition,
1330
- toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
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.toolTipPosition;
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.bodyWidth;
1361
+ return props.$bodyWidth;
1362
1362
  }, function (props) {
1363
1363
  return props.theme.colors.base || 'black';
1364
1364
  }, function (props) {
@@ -455,10 +455,10 @@
455
455
  var relativeInlineStyle = styled.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
456
456
  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"])));
457
457
  var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
458
- 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);
458
+ 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);
459
459
  };
460
460
  var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
461
- return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.bodyWidth);
461
+ return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.$bodyWidth);
462
462
  };
463
463
  var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
464
464
  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);
@@ -468,10 +468,10 @@
468
468
 
469
469
  var getBodyStyle = function getBodyStyle() {
470
470
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
471
- var _props$toolTipPositio = props.toolTipPosition,
472
- toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
471
+ var _props$$toolTipPositi = props.$toolTipPosition,
472
+ $toolTipPosition = _props$$toolTipPositi === void 0 ? '' : _props$$toolTipPositi;
473
473
 
474
- switch (toolTipPosition) {
474
+ switch ($toolTipPosition) {
475
475
  case 'top':
476
476
  return topMiddleBodyStyle;
477
477
 
@@ -485,9 +485,9 @@
485
485
 
486
486
  var getAfterStyling = function getAfterStyling() {
487
487
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
488
- var toolTipPosition = props.toolTipPosition;
488
+ var $toolTipPosition = props.$toolTipPosition;
489
489
 
490
- switch (toolTipPosition) {
490
+ switch ($toolTipPosition) {
491
491
  case 'top':
492
492
  return getTopMiddleArrowAfterStyle(props);
493
493
 
@@ -500,7 +500,7 @@
500
500
  };
501
501
 
502
502
  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) {
503
- return props.bodyWidth;
503
+ return props.$bodyWidth;
504
504
  }, function (props) {
505
505
  return props.theme.colors.base || 'black';
506
506
  }, function (props) {
@@ -576,33 +576,33 @@
576
576
  });
577
577
  });
578
578
 
579
+ /* eslint-disable react/require-default-props */
580
+
579
581
  var Tooltip = function Tooltip(_ref) {
580
- var children = _ref.children,
581
- toolTipText = _ref.toolTipText,
582
- toolTipPosition = _ref.toolTipPosition,
583
- bodyWidth = _ref.bodyWidth,
584
- apexWidth = _ref.apexWidth,
585
- containerClassName = _ref.containerClassName,
586
- bodyClassName = _ref.bodyClassName;
582
+ var _ref$children = _ref.children,
583
+ children = _ref$children === void 0 ? null : _ref$children,
584
+ _ref$toolTipText = _ref.toolTipText,
585
+ toolTipText = _ref$toolTipText === void 0 ? '' : _ref$toolTipText,
586
+ _ref$toolTipPosition = _ref.toolTipPosition,
587
+ toolTipPosition = _ref$toolTipPosition === void 0 ? 'top' : _ref$toolTipPosition,
588
+ _ref$bodyWidth = _ref.bodyWidth,
589
+ bodyWidth = _ref$bodyWidth === void 0 ? '8em' : _ref$bodyWidth,
590
+ _ref$apexWidth = _ref.apexWidth,
591
+ apexWidth = _ref$apexWidth === void 0 ? '5px' : _ref$apexWidth,
592
+ _ref$containerClassNa = _ref.containerClassName,
593
+ containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
594
+ _ref$bodyClassName = _ref.bodyClassName,
595
+ bodyClassName = _ref$bodyClassName === void 0 ? '' : _ref$bodyClassName;
587
596
  return /*#__PURE__*/React__default.createElement(Container, {
588
597
  className: containerClassName
589
598
  }, children, /*#__PURE__*/React__default.createElement(Body, {
590
- toolTipPosition: toolTipPosition,
591
- bodyWidth: bodyWidth,
592
- apexWidth: apexWidth,
599
+ $toolTipPosition: toolTipPosition,
600
+ $bodyWidth: bodyWidth,
601
+ $apexWidth: apexWidth,
593
602
  className: bodyClassName
594
603
  }, toolTipText));
595
604
  };
596
605
 
597
- Tooltip.defaultProps = {
598
- children: null,
599
- toolTipText: '',
600
- toolTipPosition: 'top',
601
- bodyWidth: '8em',
602
- apexWidth: '5px',
603
- containerClassName: '',
604
- bodyClassName: ''
605
- };
606
606
  var Tooltip$1 = themed(Tooltip);
607
607
 
608
608
  var CurrencySelect = function CurrencySelect(_ref) {
@@ -918,7 +918,7 @@
918
918
  };
919
919
 
920
920
  var SearchResults = function SearchResults(_ref) {
921
- var _searchResults$brands, _searchResults$produc, _searchResults$brands2, _searchResults$produc2, _initialSearchData$tr, _initialSearchData$la, _limitBrands, _limitBrands2, _initialSearchData$la2, _searchResults$produc3;
921
+ var _searchResults$brands, _searchResults$produc, _initialSearchData$tr, _initialSearchData$la, _limitBrands, _limitBrands2, _initialSearchData$la2, _searchResults$produc2;
922
922
 
923
923
  var searchValue = _ref.searchValue,
924
924
  searchResults = _ref.searchResults,
@@ -932,7 +932,10 @@
932
932
  currency = _ref.currency,
933
933
  currencySymbol = _ref.currencySymbol,
934
934
  onProductSearchResultClick = _ref.onProductSearchResultClick,
935
- onBrandSearchResultClick = _ref.onBrandSearchResultClick;
935
+ onBrandSearchResultClick = _ref.onBrandSearchResultClick,
936
+ onCreateInterests = _ref.onCreateInterests,
937
+ noResultsImage = _ref.noResultsImage,
938
+ showNoResults = _ref.showNoResults;
936
939
 
937
940
  var _useState = React.useState(false),
938
941
  _useState2 = _slicedToArray(_useState, 2),
@@ -950,15 +953,16 @@
950
953
  window.removeEventListener('resize', checkIfMobile);
951
954
  };
952
955
  }, []);
953
- var shouldShowInitialData = isSearchFocused && (!searchValue || searchValue.trim().length < 3) || (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim().length) >= 3 && !(searchResults !== null && searchResults !== void 0 && (_searchResults$brands = searchResults.brands) !== null && _searchResults$brands !== void 0 && _searchResults$brands.length) && !(searchResults !== null && searchResults !== void 0 && (_searchResults$produc = searchResults.products) !== null && _searchResults$produc !== void 0 && _searchResults$produc.length);
954
- var hasResults = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$brands2 = searchResults.brands) === null || _searchResults$brands2 === void 0 ? void 0 : _searchResults$brands2.length) > 0 || (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$produc2 = searchResults.products) === null || _searchResults$produc2 === void 0 ? void 0 : _searchResults$produc2.length) > 0;
956
+ var hasSearchBeenPerformed = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim().length) >= 3;
957
+ 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;
955
958
  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;
959
+ var shouldShowInitialData = isSearchFocused && (!hasSearchBeenPerformed || !hasResults && !showNoResults);
956
960
 
957
- if (!hasResults && !hasInitialData) {
961
+ if (!isSearchFocused) {
958
962
  return null;
959
963
  }
960
964
 
961
- if (!isSearchFocused) {
965
+ if (!hasResults && !hasInitialData && !showNoResults) {
962
966
  return null;
963
967
  }
964
968
 
@@ -1039,7 +1043,36 @@
1039
1043
  }
1040
1044
 
1041
1045
  return brands;
1042
- };
1046
+ }; // Show no results state
1047
+
1048
+
1049
+ if (showNoResults) {
1050
+ return /*#__PURE__*/React__default.createElement("div", {
1051
+ className: "search-results",
1052
+ ref: searchResultsRef
1053
+ }, /*#__PURE__*/React__default.createElement("div", {
1054
+ className: "search-results__no-results"
1055
+ }, /*#__PURE__*/React__default.createElement("h2", {
1056
+ className: "search-results__header"
1057
+ }, "TOP MATCHES"), /*#__PURE__*/React__default.createElement("div", {
1058
+ className: "search-results__no-results-content"
1059
+ }, /*#__PURE__*/React__default.createElement("div", {
1060
+ className: "search-results__no-results-image"
1061
+ }, /*#__PURE__*/React__default.createElement("img", {
1062
+ src: noResultsImage,
1063
+ alt: "No results"
1064
+ })), /*#__PURE__*/React__default.createElement("div", {
1065
+ className: "search-results__no-results-text"
1066
+ }, /*#__PURE__*/React__default.createElement("p", {
1067
+ className: "search-results__no-results-title"
1068
+ }, "There are currently no products in stock that match your selection"), /*#__PURE__*/React__default.createElement("p", {
1069
+ className: "search-results__no-results-description"
1070
+ }, "Create an interest now and receive instant notifications as your interests list."))), /*#__PURE__*/React__default.createElement("button", {
1071
+ type: "button",
1072
+ className: "search-results__create-interest-button",
1073
+ onClick: onCreateInterests
1074
+ }, "Create Interests")));
1075
+ }
1043
1076
 
1044
1077
  return /*#__PURE__*/React__default.createElement("div", {
1045
1078
  className: "search-results",
@@ -1096,7 +1129,7 @@
1096
1129
  }
1097
1130
  }, "View all items")), /*#__PURE__*/React__default.createElement("div", {
1098
1131
  className: "search-results__product-list"
1099
- }, 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$produc3 = searchResults.products) === null || _searchResults$produc3 === void 0 ? void 0 : _searchResults$produc3.map(renderProductCard)), /*#__PURE__*/React__default.createElement("button", {
1132
+ }, 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", {
1100
1133
  type: "button",
1101
1134
  className: "search-results__view-all-button",
1102
1135
  onClick: function onClick() {
@@ -1139,7 +1172,8 @@
1139
1172
  var endpoint = _ref.endpoint,
1140
1173
  onSearchLoading = _ref.onSearchLoading,
1141
1174
  currency = _ref.currency,
1142
- onSearchPreview = _ref.onSearchPreview;
1175
+ onSearchPreview = _ref.onSearchPreview,
1176
+ onNoResults = _ref.onNoResults;
1143
1177
  var currentSearchRequestToken = React.useRef(null);
1144
1178
  var debounce = React.useCallback(function (func, wait) {
1145
1179
  var timeout;
@@ -1176,7 +1210,12 @@
1176
1210
  setSearchResults({
1177
1211
  brands: [],
1178
1212
  products: []
1179
- });
1213
+ }); // Reset no results state when clearing search
1214
+
1215
+ if (typeof onNoResults === 'function') {
1216
+ onNoResults(false);
1217
+ }
1218
+
1180
1219
  return;
1181
1220
  } // Cancel any ongoing search request to prevent race conditions
1182
1221
 
@@ -1187,7 +1226,12 @@
1187
1226
 
1188
1227
 
1189
1228
  var newSearchToken = axios.CancelToken.source();
1190
- currentSearchRequestToken.current = newSearchToken; // Set loading to true when starting the search request
1229
+ currentSearchRequestToken.current = newSearchToken; // Reset no results state when starting new search (user is typing)
1230
+
1231
+ if (typeof onNoResults === 'function') {
1232
+ onNoResults(false);
1233
+ } // Set loading to true when starting the search request
1234
+
1191
1235
 
1192
1236
  if (typeof onSearchLoading === 'function') {
1193
1237
  onSearchLoading(true);
@@ -1247,7 +1291,13 @@
1247
1291
  products: products,
1248
1292
  total: totalResults
1249
1293
  };
1250
- setSearchResults(searchResults);
1294
+ setSearchResults(searchResults); // Check if we have no results (empty aggregations)
1295
+
1296
+ var hasNoResults = brandsData.length === 0 && productsData.length === 0;
1297
+
1298
+ if (typeof onNoResults === 'function') {
1299
+ onNoResults(hasNoResults);
1300
+ }
1251
1301
 
1252
1302
  if (typeof onSearchPreview === 'function') {
1253
1303
  var hasResults = brands.length > 0 || products.length > 0;
@@ -1257,11 +1307,7 @@
1257
1307
  });
1258
1308
  }
1259
1309
 
1260
- currentSearchRequestToken.current = null; // Set loading to false when search completes successfully
1261
-
1262
- if (typeof onSearchLoading === 'function') {
1263
- onSearchLoading(false);
1264
- }
1310
+ currentSearchRequestToken.current = null;
1265
1311
  }
1266
1312
  }).catch(function (error) {
1267
1313
  if (!axios.isCancel(error)) {
@@ -1269,14 +1315,10 @@
1269
1315
  brands: [],
1270
1316
  products: []
1271
1317
  });
1272
- currentSearchRequestToken.current = null; // Set loading to false when search fails
1273
-
1274
- if (typeof onSearchLoading === 'function') {
1275
- onSearchLoading(false);
1276
- }
1318
+ currentSearchRequestToken.current = null;
1277
1319
  }
1278
1320
  });
1279
- }, [endpoint, currency, onSearchPreview, onSearchLoading]);
1321
+ }, [endpoint, currency, onSearchPreview, onSearchLoading, onNoResults]);
1280
1322
  var debouncedSearch = React.useMemo(function () {
1281
1323
  return debounce(function (searchQuery, setSearchResults) {
1282
1324
  return performSearch(searchQuery, setSearchResults);
@@ -1381,22 +1423,6 @@
1381
1423
  }
1382
1424
  }, [searchValue, immediateSearch, setIsSearchFocused, setSearchValue]);
1383
1425
  };
1384
- var useSearchUrlQuery = function useSearchUrlQuery(setSearchValue, debouncedSearch) {
1385
- var hasProcessedUrlQuery = React.useRef(false);
1386
- React.useEffect(function () {
1387
- if (hasProcessedUrlQuery.current) return;
1388
- var urlParams = new URLSearchParams(window.location.search);
1389
- var queryParam = urlParams.get('q');
1390
- var isSearchPage = window.location.pathname.includes('/search');
1391
-
1392
- if (queryParam && queryParam.trim() !== '' && isSearchPage) {
1393
- hasProcessedUrlQuery.current = true;
1394
- setSearchValue(queryParam);
1395
- debouncedSearch(queryParam);
1396
- }
1397
- }, [setSearchValue, debouncedSearch]);
1398
- return hasProcessedUrlQuery;
1399
- };
1400
1426
 
1401
1427
  var LuxityMobileHeader = function LuxityMobileHeader(_ref) {
1402
1428
  var logoSrc = _ref.logoSrc,
@@ -1452,61 +1478,69 @@
1452
1478
  shop = _ref.shop,
1453
1479
  app = _ref.app,
1454
1480
  categoryConfig = _ref.categoryConfig,
1455
- name = _ref.name;
1481
+ name = _ref.name,
1482
+ onCreateInterests = _ref.onCreateInterests,
1483
+ noResultsImage = _ref.noResultsImage;
1484
+
1485
+ var _useState = React.useState(false),
1486
+ _useState2 = _slicedToArray(_useState, 2),
1487
+ showNoResults = _useState2[0],
1488
+ setShowNoResults = _useState2[1];
1456
1489
 
1457
1490
  var _useSearch = useSearch({
1458
1491
  endpoint: endpoint,
1459
1492
  onSearchLoading: onSearchLoading,
1460
1493
  currency: currency,
1461
- onSearchPreview: onSearchPreview
1494
+ onSearchPreview: onSearchPreview,
1495
+ onNoResults: setShowNoResults
1462
1496
  }),
1463
1497
  fetchInitialSearchData = _useSearch.fetchInitialSearchData,
1464
1498
  createDebouncedSearch = _useSearch.createDebouncedSearch,
1465
1499
  createImmediateSearch = _useSearch.createImmediateSearch;
1466
1500
 
1467
- var _useState = React.useState(''),
1468
- _useState2 = _slicedToArray(_useState, 2),
1469
- searchValue = _useState2[0],
1470
- setSearchValue = _useState2[1];
1471
-
1472
- var _useState3 = React.useState(false),
1501
+ var _useState3 = React.useState(''),
1473
1502
  _useState4 = _slicedToArray(_useState3, 2),
1474
- showSearchBar = _useState4[0],
1475
- setShowSearchbar = _useState4[1];
1503
+ searchValue = _useState4[0],
1504
+ setSearchValue = _useState4[1];
1476
1505
 
1477
1506
  var _useState5 = React.useState(false),
1478
1507
  _useState6 = _slicedToArray(_useState5, 2),
1479
- showSideNav = _useState6[0],
1480
- setShowSideNav = _useState6[1];
1508
+ showSearchBar = _useState6[0],
1509
+ setShowSearchbar = _useState6[1];
1481
1510
 
1482
- var _useState7 = React.useState({
1483
- brands: [],
1484
- products: []
1485
- }),
1511
+ var _useState7 = React.useState(false),
1486
1512
  _useState8 = _slicedToArray(_useState7, 2),
1487
- searchResults = _useState8[0],
1488
- setSearchResults = _useState8[1];
1513
+ showSideNav = _useState8[0],
1514
+ setShowSideNav = _useState8[1];
1489
1515
 
1490
1516
  var _useState9 = React.useState({
1491
1517
  brands: [],
1492
1518
  products: []
1493
1519
  }),
1494
1520
  _useState10 = _slicedToArray(_useState9, 2),
1495
- cachedResults = _useState10[0],
1496
- setCachedResults = _useState10[1];
1521
+ searchResults = _useState10[0],
1522
+ setSearchResults = _useState10[1];
1497
1523
 
1498
- var _useState11 = React.useState(false),
1524
+ var _useState11 = React.useState({
1525
+ brands: [],
1526
+ products: []
1527
+ }),
1499
1528
  _useState12 = _slicedToArray(_useState11, 2),
1500
- isSearchFocused = _useState12[0],
1501
- setIsSearchFocused = _useState12[1];
1529
+ cachedResults = _useState12[0],
1530
+ setCachedResults = _useState12[1];
1502
1531
 
1503
- var _useState13 = React.useState({
1532
+ var _useState13 = React.useState(false),
1533
+ _useState14 = _slicedToArray(_useState13, 2),
1534
+ isSearchFocused = _useState14[0],
1535
+ setIsSearchFocused = _useState14[1];
1536
+
1537
+ var _useState15 = React.useState({
1504
1538
  trending_brands: [],
1505
1539
  latest_products: []
1506
1540
  }),
1507
- _useState14 = _slicedToArray(_useState13, 2),
1508
- initialSearchView = _useState14[0],
1509
- setInitialSearchView = _useState14[1];
1541
+ _useState16 = _slicedToArray(_useState15, 2),
1542
+ initialSearchView = _useState16[0],
1543
+ setInitialSearchView = _useState16[1];
1510
1544
 
1511
1545
  var searchResultsRef = React.useRef(null);
1512
1546
  var searchInputRef = React.useRef(null);
@@ -1516,7 +1550,6 @@
1516
1550
  });
1517
1551
  var immediateSearch = createImmediateSearch(setSearchValue, setSearchResults, onSearchSubmit);
1518
1552
  var handleChange = useSearchInputChange(setSearchValue, setIsSearchFocused, debouncedSearch, setSearchResults, setCachedResults);
1519
- useSearchUrlQuery(setSearchValue, debouncedSearch);
1520
1553
  var handleKeyDown = useSearchInputKeyDown(searchValue, immediateSearch, setIsSearchFocused, setSearchValue);
1521
1554
  React.useMemo(function () {
1522
1555
  if (!initialSearchData) {
@@ -1549,6 +1582,7 @@
1549
1582
  brands: [],
1550
1583
  products: []
1551
1584
  });
1585
+ setShowNoResults(false);
1552
1586
  }
1553
1587
  };
1554
1588
 
@@ -1733,6 +1767,7 @@
1733
1767
  products: []
1734
1768
  });
1735
1769
  setIsSearchFocused(false);
1770
+ setShowNoResults(false);
1736
1771
  },
1737
1772
  onSearchSubmit: onSearchSubmit,
1738
1773
  setSearchValue: setSearchValue,
@@ -1743,7 +1778,10 @@
1743
1778
  currency: currency,
1744
1779
  currencySymbol: currencySymbol,
1745
1780
  onProductSearchResultClick: onProductSearchResultClick,
1746
- onBrandSearchResultClick: onBrandSearchResultClick
1781
+ onBrandSearchResultClick: onBrandSearchResultClick,
1782
+ onCreateInterests: onCreateInterests,
1783
+ noResultsImage: noResultsImage,
1784
+ showNoResults: showNoResults
1747
1785
  }))), shop && /*#__PURE__*/React__default.createElement(LuxitySideNav, {
1748
1786
  accordionIcon: accordionIcon,
1749
1787
  logoSrc: logoSrc,
package/LuxitySideNav.js CHANGED
@@ -271,10 +271,10 @@
271
271
  var relativeInlineStyle = styled.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
272
272
  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"])));
273
273
  var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
274
- 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);
274
+ 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);
275
275
  };
276
276
  var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
277
- return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.bodyWidth);
277
+ return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.$bodyWidth);
278
278
  };
279
279
  var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
280
280
  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);
@@ -284,10 +284,10 @@
284
284
 
285
285
  var getBodyStyle = function getBodyStyle() {
286
286
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
287
- var _props$toolTipPositio = props.toolTipPosition,
288
- toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
287
+ var _props$$toolTipPositi = props.$toolTipPosition,
288
+ $toolTipPosition = _props$$toolTipPositi === void 0 ? '' : _props$$toolTipPositi;
289
289
 
290
- switch (toolTipPosition) {
290
+ switch ($toolTipPosition) {
291
291
  case 'top':
292
292
  return topMiddleBodyStyle;
293
293
 
@@ -301,9 +301,9 @@
301
301
 
302
302
  var getAfterStyling = function getAfterStyling() {
303
303
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
304
- var toolTipPosition = props.toolTipPosition;
304
+ var $toolTipPosition = props.$toolTipPosition;
305
305
 
306
- switch (toolTipPosition) {
306
+ switch ($toolTipPosition) {
307
307
  case 'top':
308
308
  return getTopMiddleArrowAfterStyle(props);
309
309
 
@@ -316,7 +316,7 @@
316
316
  };
317
317
 
318
318
  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) {
319
- return props.bodyWidth;
319
+ return props.$bodyWidth;
320
320
  }, function (props) {
321
321
  return props.theme.colors.base || 'black';
322
322
  }, function (props) {
@@ -392,33 +392,33 @@
392
392
  });
393
393
  });
394
394
 
395
+ /* eslint-disable react/require-default-props */
396
+
395
397
  var Tooltip = function Tooltip(_ref) {
396
- var children = _ref.children,
397
- toolTipText = _ref.toolTipText,
398
- toolTipPosition = _ref.toolTipPosition,
399
- bodyWidth = _ref.bodyWidth,
400
- apexWidth = _ref.apexWidth,
401
- containerClassName = _ref.containerClassName,
402
- bodyClassName = _ref.bodyClassName;
398
+ var _ref$children = _ref.children,
399
+ children = _ref$children === void 0 ? null : _ref$children,
400
+ _ref$toolTipText = _ref.toolTipText,
401
+ toolTipText = _ref$toolTipText === void 0 ? '' : _ref$toolTipText,
402
+ _ref$toolTipPosition = _ref.toolTipPosition,
403
+ toolTipPosition = _ref$toolTipPosition === void 0 ? 'top' : _ref$toolTipPosition,
404
+ _ref$bodyWidth = _ref.bodyWidth,
405
+ bodyWidth = _ref$bodyWidth === void 0 ? '8em' : _ref$bodyWidth,
406
+ _ref$apexWidth = _ref.apexWidth,
407
+ apexWidth = _ref$apexWidth === void 0 ? '5px' : _ref$apexWidth,
408
+ _ref$containerClassNa = _ref.containerClassName,
409
+ containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
410
+ _ref$bodyClassName = _ref.bodyClassName,
411
+ bodyClassName = _ref$bodyClassName === void 0 ? '' : _ref$bodyClassName;
403
412
  return /*#__PURE__*/React__default.createElement(Container, {
404
413
  className: containerClassName
405
414
  }, children, /*#__PURE__*/React__default.createElement(Body, {
406
- toolTipPosition: toolTipPosition,
407
- bodyWidth: bodyWidth,
408
- apexWidth: apexWidth,
415
+ $toolTipPosition: toolTipPosition,
416
+ $bodyWidth: bodyWidth,
417
+ $apexWidth: apexWidth,
409
418
  className: bodyClassName
410
419
  }, toolTipText));
411
420
  };
412
421
 
413
- Tooltip.defaultProps = {
414
- children: null,
415
- toolTipText: '',
416
- toolTipPosition: 'top',
417
- bodyWidth: '8em',
418
- apexWidth: '5px',
419
- containerClassName: '',
420
- bodyClassName: ''
421
- };
422
422
  var Tooltip$1 = themed(Tooltip);
423
423
 
424
424
  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.apexWidth, props.apexWidth, props.theme.colors.base);
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.bodyWidth);
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$toolTipPositio = props.toolTipPosition,
1330
- toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
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.toolTipPosition;
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.bodyWidth;
1361
+ return props.$bodyWidth;
1362
1362
  }, function (props) {
1363
1363
  return props.theme.colors.base || 'black';
1364
1364
  }, function (props) {