@bonlineza/luxity-lib 2.37.8 → 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/build/bundle.js CHANGED
@@ -15804,7 +15804,7 @@
15804
15804
  };
15805
15805
 
15806
15806
  var SearchResults = function SearchResults(_ref) {
15807
- var _searchResults$brands, _searchResults$produc, _searchResults$brands2, _searchResults$produc2, _initialSearchData$tr, _initialSearchData$la, _limitBrands, _limitBrands2, _initialSearchData$la2, _searchResults$produc3;
15807
+ var _searchResults$brands, _searchResults$produc, _initialSearchData$tr, _initialSearchData$la, _limitBrands, _limitBrands2, _initialSearchData$la2, _searchResults$produc2;
15808
15808
 
15809
15809
  var searchValue = _ref.searchValue,
15810
15810
  searchResults = _ref.searchResults,
@@ -15818,7 +15818,10 @@
15818
15818
  currency = _ref.currency,
15819
15819
  currencySymbol = _ref.currencySymbol,
15820
15820
  onProductSearchResultClick = _ref.onProductSearchResultClick,
15821
- onBrandSearchResultClick = _ref.onBrandSearchResultClick;
15821
+ onBrandSearchResultClick = _ref.onBrandSearchResultClick,
15822
+ onCreateInterests = _ref.onCreateInterests,
15823
+ noResultsImage = _ref.noResultsImage,
15824
+ showNoResults = _ref.showNoResults;
15822
15825
 
15823
15826
  var _useState = React.useState(false),
15824
15827
  _useState2 = _slicedToArray(_useState, 2),
@@ -15836,15 +15839,16 @@
15836
15839
  window.removeEventListener('resize', checkIfMobile);
15837
15840
  };
15838
15841
  }, []);
15839
- 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);
15840
- 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;
15842
+ var hasSearchBeenPerformed = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim().length) >= 3;
15843
+ 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;
15841
15844
  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;
15845
+ var shouldShowInitialData = isSearchFocused && (!hasSearchBeenPerformed || !hasResults && !showNoResults);
15842
15846
 
15843
- if (!hasResults && !hasInitialData) {
15847
+ if (!isSearchFocused) {
15844
15848
  return null;
15845
15849
  }
15846
15850
 
15847
- if (!isSearchFocused) {
15851
+ if (!hasResults && !hasInitialData && !showNoResults) {
15848
15852
  return null;
15849
15853
  }
15850
15854
 
@@ -15863,6 +15867,8 @@
15863
15867
  price: product.price,
15864
15868
  retail_price: product.est_retail_price
15865
15869
  };
15870
+ var displayPrice = product.on_promotion && product.promotion_price ? product.promotion_price : selectedPrice.price;
15871
+ var hasPromotion = product.on_promotion && product.promotion_price;
15866
15872
  return /*#__PURE__*/React__default.createElement("a", {
15867
15873
  key: product.link,
15868
15874
  href: product.link,
@@ -15890,15 +15896,23 @@
15890
15896
  className: "product-card__name"
15891
15897
  }, shouldShowInitialData ? /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement("span", {
15892
15898
  className: "product-card__brand-name"
15893
- }, product.brand.toUpperCase()), ' ', product.name) : product.name), /*#__PURE__*/React__default.createElement("div", {
15899
+ }, product.brand.toUpperCase()), ' ', product.name) : /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement("span", {
15900
+ className: "product-card__brand-name"
15901
+ }, product.brand.toUpperCase()), ' ', product.name)), /*#__PURE__*/React__default.createElement("div", {
15894
15902
  className: "product-card__info-row"
15895
15903
  }, /*#__PURE__*/React__default.createElement("div", {
15896
15904
  className: "product-card__price-group"
15905
+ }, hasPromotion ? /*#__PURE__*/React__default.createElement("div", {
15906
+ className: "product-card__price-with-promotion"
15897
15907
  }, /*#__PURE__*/React__default.createElement("div", {
15908
+ className: "product-card__price product-card__price--promotion"
15909
+ }, formatPrice(displayPrice)), /*#__PURE__*/React__default.createElement("div", {
15910
+ className: "product-card__price product-card__price--original"
15911
+ }, formatPrice(selectedPrice.price))) : /*#__PURE__*/React__default.createElement("div", {
15898
15912
  className: "product-card__price"
15899
- }, formatPrice(selectedPrice.price)), selectedPrice.retail_price > 1 && /*#__PURE__*/React__default.createElement("div", {
15913
+ }, formatPrice(displayPrice)), selectedPrice.retail_price > 1 && selectedPrice.retail_price > displayPrice && /*#__PURE__*/React__default.createElement("div", {
15900
15914
  className: "product-card__retail-price"
15901
- }, "Est. Retail: ", formatPrice(selectedPrice.retail_price))), /*#__PURE__*/React__default.createElement("div", {
15915
+ }, "Est. Retail: ", formatPrice(selectedPrice.retail_price))), product.condition && /*#__PURE__*/React__default.createElement("div", {
15902
15916
  className: "product-card__condition"
15903
15917
  }, /*#__PURE__*/React__default.createElement("span", {
15904
15918
  className: "product-card__condition-label"
@@ -15915,7 +15929,36 @@
15915
15929
  }
15916
15930
 
15917
15931
  return brands;
15918
- };
15932
+ }; // Show no results state
15933
+
15934
+
15935
+ if (showNoResults) {
15936
+ return /*#__PURE__*/React__default.createElement("div", {
15937
+ className: "search-results",
15938
+ ref: searchResultsRef
15939
+ }, /*#__PURE__*/React__default.createElement("div", {
15940
+ className: "search-results__no-results"
15941
+ }, /*#__PURE__*/React__default.createElement("h2", {
15942
+ className: "search-results__header"
15943
+ }, "TOP MATCHES"), /*#__PURE__*/React__default.createElement("div", {
15944
+ className: "search-results__no-results-content"
15945
+ }, /*#__PURE__*/React__default.createElement("div", {
15946
+ className: "search-results__no-results-image"
15947
+ }, /*#__PURE__*/React__default.createElement("img", {
15948
+ src: noResultsImage,
15949
+ alt: "No results"
15950
+ })), /*#__PURE__*/React__default.createElement("div", {
15951
+ className: "search-results__no-results-text"
15952
+ }, /*#__PURE__*/React__default.createElement("p", {
15953
+ className: "search-results__no-results-title"
15954
+ }, "There are currently no products in stock that match your selection"), /*#__PURE__*/React__default.createElement("p", {
15955
+ className: "search-results__no-results-description"
15956
+ }, "Create an interest now and receive instant notifications as your interests list."))), /*#__PURE__*/React__default.createElement("button", {
15957
+ type: "button",
15958
+ className: "search-results__create-interest-button",
15959
+ onClick: onCreateInterests
15960
+ }, "Create Interests")));
15961
+ }
15919
15962
 
15920
15963
  return /*#__PURE__*/React__default.createElement("div", {
15921
15964
  className: "search-results",
@@ -15972,7 +16015,7 @@
15972
16015
  }
15973
16016
  }, "View all items")), /*#__PURE__*/React__default.createElement("div", {
15974
16017
  className: "search-results__product-list"
15975
- }, 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", {
16018
+ }, 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", {
15976
16019
  type: "button",
15977
16020
  className: "search-results__view-all-button",
15978
16021
  onClick: function onClick() {
@@ -15987,22 +16030,36 @@
15987
16030
  }, "View all items")));
15988
16031
  };
15989
16032
 
15990
- var searchProducts = function searchProducts(search, limit, currencyCode) {
16033
+ var searchBrandsAggregations = function searchBrandsAggregations(search, currencyCode) {
16034
+ return {
16035
+ query: "\n query GetProductFilterAggregations($search: String!) {\n luxity_products_aggregations(search: $search) {\n luxity_brand {\n name\n }\n }\n }\n ",
16036
+ variables: {
16037
+ search: search,
16038
+ currency_code: currencyCode
16039
+ }
16040
+ };
16041
+ }; // NEW: Get top products for search dropdown (right side)
16042
+
16043
+ var searchProductsFilter = function searchProductsFilter(search, limit, currencyCode) {
15991
16044
  return {
15992
- query: "\n query SearchProducts($search: String!, $limit: Int!, $currencyCode: String!) {\n luxity_products_serach_results(search: $search, limit: $limit, currency_code: $currencyCode) {\n brands {\n name\n link\n }\n products {\n name\n link\n price\n est_retail_price\n condition\n featured_image\n }\n luxity_product_ids\n }\n }\n ",
16045
+ query: "\n query LUXITY_PRODUCTS_FILTER(\n $search: String!\n $limit: Int!\n $page: Int!\n $sort_by: String!\n $with_sold: Boolean!\n $currency_code: String!\n ) {\n luxity_products_filter(\n search: $search\n limit: $limit\n page: $page\n sort_by: $sort_by\n with_sold: $with_sold\n ) {\n data {\n id\n product {\n sku\n name\n price(currency_code: $currency_code)\n promotion_price(currency_code: $currency_code)\n est_retail_price(currency_code: $currency_code)\n condition\n currency_symbol(currency_code: $currency_code)\n }\n category_type\n gender\n status\n featured_image\n on_promotion\n promotion_discount\n luxity_brand {\n id\n name\n slug\n }\n }\n total\n }\n }\n ",
15993
16046
  variables: {
15994
16047
  search: search,
15995
16048
  limit: limit,
15996
- currencyCode: currencyCode
16049
+ page: 1,
16050
+ sort_by: 'newest',
16051
+ with_sold: false,
16052
+ currency_code: currencyCode
15997
16053
  }
15998
16054
  };
15999
16055
  };
16000
16056
 
16001
16057
  var useSearch = function useSearch(_ref) {
16002
16058
  var endpoint = _ref.endpoint,
16003
- onProductIdsReceived = _ref.onProductIdsReceived,
16059
+ onSearchLoading = _ref.onSearchLoading,
16004
16060
  currency = _ref.currency,
16005
- onSearchPreview = _ref.onSearchPreview;
16061
+ onSearchPreview = _ref.onSearchPreview,
16062
+ onNoResults = _ref.onNoResults;
16006
16063
  var currentSearchRequestToken = React.useRef(null);
16007
16064
  var debounce = React.useCallback(function (func, wait) {
16008
16065
  var timeout;
@@ -16038,9 +16095,13 @@
16038
16095
  if (!searchQuery || searchQuery.trim() === '') {
16039
16096
  setSearchResults({
16040
16097
  brands: [],
16041
- products: [],
16042
- luxity_product_ids: []
16043
- });
16098
+ products: []
16099
+ }); // Reset no results state when clearing search
16100
+
16101
+ if (typeof onNoResults === 'function') {
16102
+ onNoResults(false);
16103
+ }
16104
+
16044
16105
  return;
16045
16106
  } // Cancel any ongoing search request to prevent race conditions
16046
16107
 
@@ -16051,22 +16112,81 @@
16051
16112
 
16052
16113
 
16053
16114
  var newSearchToken = axios.CancelToken.source();
16054
- currentSearchRequestToken.current = newSearchToken;
16055
- axios.post(endpoint, searchProducts(searchQuery, 3, currency), {
16115
+ currentSearchRequestToken.current = newSearchToken; // Reset no results state when starting new search (user is typing)
16116
+
16117
+ if (typeof onNoResults === 'function') {
16118
+ onNoResults(false);
16119
+ } // Set loading to true when starting the search request
16120
+
16121
+
16122
+ if (typeof onSearchLoading === 'function') {
16123
+ onSearchLoading(true);
16124
+ } // Make TWO parallel queries: brands aggregations + products filter
16125
+
16126
+
16127
+ Promise.all([// Query 1: Get brands aggregations
16128
+ axios.post(endpoint, searchBrandsAggregations(searchQuery, currency), {
16129
+ cancelToken: newSearchToken.token
16130
+ }), // Query 2: Get top 3 products
16131
+ axios.post(endpoint, searchProductsFilter(searchQuery, 3, currency), {
16056
16132
  cancelToken: newSearchToken.token
16057
- }).then(function (response) {
16133
+ })]).then(function (_ref3) {
16134
+ var _ref4 = _slicedToArray(_ref3, 2),
16135
+ brandsResponse = _ref4[0],
16136
+ productsResponse = _ref4[1];
16137
+
16058
16138
  if (currentSearchRequestToken.current === newSearchToken) {
16059
- var searchResults = response.data.data.luxity_products_serach_results;
16060
- setSearchResults(searchResults);
16139
+ var _brandsResponse$data$, _productsResponse$dat, _productsResponse$dat2;
16140
+
16141
+ // Extract brands from aggregations
16142
+ var brandsData = ((_brandsResponse$data$ = brandsResponse.data.data.luxity_products_aggregations) === null || _brandsResponse$data$ === void 0 ? void 0 : _brandsResponse$data$.luxity_brand) || []; // Extract products from filter
16143
+
16144
+ var productsData = ((_productsResponse$dat = productsResponse.data.data.luxity_products_filter) === null || _productsResponse$dat === void 0 ? void 0 : _productsResponse$dat.data) || [];
16145
+ var totalResults = ((_productsResponse$dat2 = productsResponse.data.data.luxity_products_filter) === null || _productsResponse$dat2 === void 0 ? void 0 : _productsResponse$dat2.total) || 0; // Map brands to old structure: { name, link }
16146
+
16147
+ var brands = brandsData.slice(0, 10).map(function (brand) {
16148
+ return {
16149
+ name: brand.name,
16150
+ link: "/products/brands/".concat(brand.name.toLowerCase().replace(/\s+/g, '-')) // Convert to slug
16151
+
16152
+ };
16153
+ }); // Map products to old structure with prices
16154
+
16155
+ var products = productsData.map(function (product) {
16156
+ return {
16157
+ name: product.product.name,
16158
+ brand: product.luxity_brand.name,
16159
+ link: "/products/".concat(product.id),
16160
+ // Using product ID for link
16161
+ price: product.product.price || 0,
16162
+ promotion_price: product.product.promotion_price || null,
16163
+ est_retail_price: product.product.est_retail_price || 0,
16164
+ condition: product.product.condition || '',
16165
+ currency_symbol: product.product.currency_symbol || '',
16166
+ featured_image: product.featured_image,
16167
+ on_promotion: product.on_promotion || false,
16168
+ promotion_discount: product.promotion_discount || 0,
16169
+ // Keep new fields for potential future use
16170
+ id: product.id,
16171
+ category_type: product.category_type,
16172
+ luxity_brand: product.luxity_brand
16173
+ };
16174
+ });
16175
+ var searchResults = {
16176
+ brands: brands,
16177
+ products: products,
16178
+ total: totalResults
16179
+ };
16180
+ setSearchResults(searchResults); // Check if we have no results (empty aggregations)
16061
16181
 
16062
- if (searchResults && searchResults.luxity_product_ids) {
16063
- onProductIdsReceived(searchResults.luxity_product_ids);
16182
+ var hasNoResults = brandsData.length === 0 && productsData.length === 0;
16183
+
16184
+ if (typeof onNoResults === 'function') {
16185
+ onNoResults(hasNoResults);
16064
16186
  }
16065
16187
 
16066
16188
  if (typeof onSearchPreview === 'function') {
16067
- var _searchResults$brands, _searchResults$produc;
16068
-
16069
- var hasResults = ((_searchResults$brands = searchResults.brands) === null || _searchResults$brands === void 0 ? void 0 : _searchResults$brands.length) > 0 || ((_searchResults$produc = searchResults.products) === null || _searchResults$produc === void 0 ? void 0 : _searchResults$produc.length) > 0;
16189
+ var hasResults = brands.length > 0 || products.length > 0;
16070
16190
  onSearchPreview({
16071
16191
  search_string: searchQuery,
16072
16192
  has_results: hasResults
@@ -16079,13 +16199,12 @@
16079
16199
  if (!axios.isCancel(error)) {
16080
16200
  setSearchResults({
16081
16201
  brands: [],
16082
- products: [],
16083
- luxity_product_ids: []
16202
+ products: []
16084
16203
  });
16085
16204
  currentSearchRequestToken.current = null;
16086
16205
  }
16087
16206
  });
16088
- }, [endpoint, currency, onSearchPreview, onProductIdsReceived]);
16207
+ }, [endpoint, currency, onSearchPreview, onSearchLoading, onNoResults]);
16089
16208
  var debouncedSearch = React.useMemo(function () {
16090
16209
  return debounce(function (searchQuery, setSearchResults) {
16091
16210
  return performSearch(searchQuery, setSearchResults);
@@ -16225,7 +16344,7 @@
16225
16344
  onSearchPreview = _ref.onSearchPreview,
16226
16345
  onProductSearchResultClick = _ref.onProductSearchResultClick,
16227
16346
  onBrandSearchResultClick = _ref.onBrandSearchResultClick,
16228
- onProductIdsReceived = _ref.onProductIdsReceived,
16347
+ onSearchLoading = _ref.onSearchLoading,
16229
16348
  currency = _ref.currency,
16230
16349
  currencySymbol = _ref.currencySymbol,
16231
16350
  currencyOptions = _ref.currencyOptions,
@@ -16239,17 +16358,9 @@
16239
16358
  isExclusive = _ref.isExclusive,
16240
16359
  shop = _ref.shop,
16241
16360
  app = _ref.app,
16242
- categoryConfig = _ref.categoryConfig;
16243
-
16244
- var _useSearch = useSearch({
16245
- endpoint: endpoint,
16246
- onProductIdsReceived: onProductIdsReceived,
16247
- currency: currency,
16248
- onSearchPreview: onSearchPreview
16249
- }),
16250
- fetchInitialSearchData = _useSearch.fetchInitialSearchData,
16251
- createDebouncedSearch = _useSearch.createDebouncedSearch,
16252
- createImmediateSearch = _useSearch.createImmediateSearch;
16361
+ categoryConfig = _ref.categoryConfig,
16362
+ onCreateInterests = _ref.onCreateInterests,
16363
+ noResultsImage = _ref.noResultsImage;
16253
16364
 
16254
16365
  var _useState = React.useState(''),
16255
16366
  _useState2 = _slicedToArray(_useState, 2),
@@ -16300,7 +16411,24 @@
16300
16411
  cachedResults = _useState16[0],
16301
16412
  setCachedResults = _useState16[1];
16302
16413
 
16414
+ var _useState17 = React.useState(false),
16415
+ _useState18 = _slicedToArray(_useState17, 2),
16416
+ showNoResults = _useState18[0],
16417
+ setShowNoResults = _useState18[1];
16418
+
16303
16419
  var searchResultsRef = React.useRef(null);
16420
+
16421
+ var _useSearch = useSearch({
16422
+ endpoint: endpoint,
16423
+ onSearchLoading: onSearchLoading,
16424
+ currency: currency,
16425
+ onSearchPreview: onSearchPreview,
16426
+ onNoResults: setShowNoResults
16427
+ }),
16428
+ fetchInitialSearchData = _useSearch.fetchInitialSearchData,
16429
+ createDebouncedSearch = _useSearch.createDebouncedSearch,
16430
+ createImmediateSearch = _useSearch.createImmediateSearch;
16431
+
16304
16432
  var debouncedSearch = createDebouncedSearch(function (results) {
16305
16433
  setSearchResults(results);
16306
16434
  setCachedResults(results);
@@ -16433,6 +16561,7 @@
16433
16561
  products: []
16434
16562
  });
16435
16563
  setIsSearchFocused(false);
16564
+ setShowNoResults(false);
16436
16565
  },
16437
16566
  searchResultsRef: searchResultsRef,
16438
16567
  onSearchSubmit: onSearchSubmit,
@@ -16443,7 +16572,10 @@
16443
16572
  currency: currency,
16444
16573
  currencySymbol: currencySymbol,
16445
16574
  onProductSearchResultClick: onProductSearchResultClick,
16446
- onBrandSearchResultClick: onBrandSearchResultClick
16575
+ onBrandSearchResultClick: onBrandSearchResultClick,
16576
+ onCreateInterests: onCreateInterests,
16577
+ noResultsImage: noResultsImage,
16578
+ showNoResults: showNoResults
16447
16579
  }), /*#__PURE__*/React__default.createElement("nav", {
16448
16580
  className: "navbar__nav-links navbar__nav-links--wrap"
16449
16581
  }, renderDropdownLinks(), !!stores.length && /*#__PURE__*/React__default.createElement("li", {
@@ -17140,7 +17272,7 @@
17140
17272
  onSearchPreview = _ref.onSearchPreview,
17141
17273
  onProductSearchResultClick = _ref.onProductSearchResultClick,
17142
17274
  onBrandSearchResultClick = _ref.onBrandSearchResultClick,
17143
- onProductIdsReceived = _ref.onProductIdsReceived,
17275
+ onSearchLoading = _ref.onSearchLoading,
17144
17276
  onLogoutClick = _ref.onLogoutClick,
17145
17277
  onInterestClick = _ref.onInterestClick,
17146
17278
  onAddressClick = _ref.onAddressClick,
@@ -17161,61 +17293,69 @@
17161
17293
  shop = _ref.shop,
17162
17294
  app = _ref.app,
17163
17295
  categoryConfig = _ref.categoryConfig,
17164
- name = _ref.name;
17296
+ name = _ref.name,
17297
+ onCreateInterests = _ref.onCreateInterests,
17298
+ noResultsImage = _ref.noResultsImage;
17299
+
17300
+ var _useState = React.useState(false),
17301
+ _useState2 = _slicedToArray(_useState, 2),
17302
+ showNoResults = _useState2[0],
17303
+ setShowNoResults = _useState2[1];
17165
17304
 
17166
17305
  var _useSearch = useSearch({
17167
17306
  endpoint: endpoint,
17168
- onProductIdsReceived: onProductIdsReceived,
17307
+ onSearchLoading: onSearchLoading,
17169
17308
  currency: currency,
17170
- onSearchPreview: onSearchPreview
17309
+ onSearchPreview: onSearchPreview,
17310
+ onNoResults: setShowNoResults
17171
17311
  }),
17172
17312
  fetchInitialSearchData = _useSearch.fetchInitialSearchData,
17173
17313
  createDebouncedSearch = _useSearch.createDebouncedSearch,
17174
17314
  createImmediateSearch = _useSearch.createImmediateSearch;
17175
17315
 
17176
- var _useState = React.useState(''),
17177
- _useState2 = _slicedToArray(_useState, 2),
17178
- searchValue = _useState2[0],
17179
- setSearchValue = _useState2[1];
17180
-
17181
- var _useState3 = React.useState(false),
17316
+ var _useState3 = React.useState(''),
17182
17317
  _useState4 = _slicedToArray(_useState3, 2),
17183
- showSearchBar = _useState4[0],
17184
- setShowSearchbar = _useState4[1];
17318
+ searchValue = _useState4[0],
17319
+ setSearchValue = _useState4[1];
17185
17320
 
17186
17321
  var _useState5 = React.useState(false),
17187
17322
  _useState6 = _slicedToArray(_useState5, 2),
17188
- showSideNav = _useState6[0],
17189
- setShowSideNav = _useState6[1];
17323
+ showSearchBar = _useState6[0],
17324
+ setShowSearchbar = _useState6[1];
17190
17325
 
17191
- var _useState7 = React.useState({
17192
- brands: [],
17193
- products: []
17194
- }),
17326
+ var _useState7 = React.useState(false),
17195
17327
  _useState8 = _slicedToArray(_useState7, 2),
17196
- searchResults = _useState8[0],
17197
- setSearchResults = _useState8[1];
17328
+ showSideNav = _useState8[0],
17329
+ setShowSideNav = _useState8[1];
17198
17330
 
17199
17331
  var _useState9 = React.useState({
17200
17332
  brands: [],
17201
17333
  products: []
17202
17334
  }),
17203
17335
  _useState10 = _slicedToArray(_useState9, 2),
17204
- cachedResults = _useState10[0],
17205
- setCachedResults = _useState10[1];
17336
+ searchResults = _useState10[0],
17337
+ setSearchResults = _useState10[1];
17206
17338
 
17207
- var _useState11 = React.useState(false),
17339
+ var _useState11 = React.useState({
17340
+ brands: [],
17341
+ products: []
17342
+ }),
17208
17343
  _useState12 = _slicedToArray(_useState11, 2),
17209
- isSearchFocused = _useState12[0],
17210
- setIsSearchFocused = _useState12[1];
17344
+ cachedResults = _useState12[0],
17345
+ setCachedResults = _useState12[1];
17211
17346
 
17212
- var _useState13 = React.useState({
17347
+ var _useState13 = React.useState(false),
17348
+ _useState14 = _slicedToArray(_useState13, 2),
17349
+ isSearchFocused = _useState14[0],
17350
+ setIsSearchFocused = _useState14[1];
17351
+
17352
+ var _useState15 = React.useState({
17213
17353
  trending_brands: [],
17214
17354
  latest_products: []
17215
17355
  }),
17216
- _useState14 = _slicedToArray(_useState13, 2),
17217
- initialSearchView = _useState14[0],
17218
- setInitialSearchView = _useState14[1];
17356
+ _useState16 = _slicedToArray(_useState15, 2),
17357
+ initialSearchView = _useState16[0],
17358
+ setInitialSearchView = _useState16[1];
17219
17359
 
17220
17360
  var searchResultsRef = React.useRef(null);
17221
17361
  var searchInputRef = React.useRef(null);
@@ -17257,6 +17397,7 @@
17257
17397
  brands: [],
17258
17398
  products: []
17259
17399
  });
17400
+ setShowNoResults(false);
17260
17401
  }
17261
17402
  };
17262
17403
 
@@ -17441,6 +17582,7 @@
17441
17582
  products: []
17442
17583
  });
17443
17584
  setIsSearchFocused(false);
17585
+ setShowNoResults(false);
17444
17586
  },
17445
17587
  onSearchSubmit: onSearchSubmit,
17446
17588
  setSearchValue: setSearchValue,
@@ -17451,7 +17593,10 @@
17451
17593
  currency: currency,
17452
17594
  currencySymbol: currencySymbol,
17453
17595
  onProductSearchResultClick: onProductSearchResultClick,
17454
- onBrandSearchResultClick: onBrandSearchResultClick
17596
+ onBrandSearchResultClick: onBrandSearchResultClick,
17597
+ onCreateInterests: onCreateInterests,
17598
+ noResultsImage: noResultsImage,
17599
+ showNoResults: showNoResults
17455
17600
  }))), shop && /*#__PURE__*/React__default.createElement(LuxitySideNav, {
17456
17601
  accordionIcon: accordionIcon,
17457
17602
  logoSrc: logoSrc,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonlineza/luxity-lib",
3
- "version": "2.37.8",
3
+ "version": "2.38.1",
4
4
  "scripts": {
5
5
  "start": "start-storybook -p 9001 -c .storybook -s ./public",
6
6
  "clean": "rimraf ./build/*.*",