@sentecacommerce-theme/lib 0.13.5-alpha.9 → 0.13.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/cjs/analytics/addToCart.js +0 -1
  2. package/dist/cjs/analytics/initiateCheckout.js +0 -1
  3. package/dist/cjs/analytics/viewContent.js +0 -1
  4. package/dist/cjs/components/Portal/index.js +1 -1
  5. package/dist/cjs/hooks/useProgressBar/hooks/useGetSetState.js +1 -24
  6. package/dist/cjs/hooks/useVouchers/index.js +1 -2
  7. package/dist/cjs/navigation/components/SearchBox/Components/Container/index.js +1 -1
  8. package/dist/cjs/navigation/components/SearchBox/Components/EmptyBox/index.js +19 -18
  9. package/dist/cjs/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +1 -1
  10. package/dist/cjs/navigation/components/SearchBox/Components/Products/index.js +2 -2
  11. package/dist/cjs/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
  12. package/dist/cjs/navigation/components/SearchBox/index.js +11 -11
  13. package/dist/esm/analytics/Pixel/mainScript.js +0 -1
  14. package/dist/esm/analytics/addToCart.js +0 -1
  15. package/dist/esm/analytics/initiateCheckout.js +0 -1
  16. package/dist/esm/analytics/pageView.js +1 -1
  17. package/dist/esm/analytics/viewContent.js +0 -1
  18. package/dist/esm/components/GoogleOneTap/index.js +1 -1
  19. package/dist/esm/components/Portal/index.js +1 -1
  20. package/dist/esm/hooks/useProgressBar/hooks/useGetSetState.js +1 -1
  21. package/dist/esm/hooks/useVouchers/index.js +1 -2
  22. package/dist/esm/navigation/components/SearchBox/Components/Container/index.js +1 -1
  23. package/dist/esm/navigation/components/SearchBox/Components/EmptyBox/index.js +19 -18
  24. package/dist/esm/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +1 -1
  25. package/dist/esm/navigation/components/SearchBox/Components/Products/index.js +2 -2
  26. package/dist/esm/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
  27. package/dist/esm/navigation/components/SearchBox/index.js +11 -11
  28. package/dist/types/navigation/components/SearchBox/Components/Container/index.d.ts +10 -9
  29. package/dist/types/navigation/components/SearchBox/Components/EmptyBox/index.d.ts +22 -21
  30. package/dist/types/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.d.ts +8 -7
  31. package/dist/types/navigation/components/SearchBox/Components/Products/index.d.ts +9 -8
  32. package/dist/types/navigation/components/SearchBox/index.d.ts +31 -30
  33. package/package.json +3 -2
@@ -8,7 +8,6 @@ var addToCart = function(sku, quantity, price) {
8
8
  var value = (0, _decodePrice).decodePrice(price) * quantity;
9
9
  var currency = price.currencyCode;
10
10
  window.fbq('track', 'AddToCart', {
11
- // eslint-disable-next-line @typescript-eslint/camelcase
12
11
  content_type: 'product',
13
12
  value: value,
14
13
  currency: currency,
@@ -14,7 +14,6 @@ var initiateCheckout = function(order) {
14
14
  var currency = order.currencyCode;
15
15
  var value = (0, _decodePrice).decodePrice(order.grandTotalPrice);
16
16
  window.fbq('track', 'InitiateCheckout', {
17
- // eslint-disable-next-line @typescript-eslint/camelcase
18
17
  content_type: 'product',
19
18
  contents: contents,
20
19
  currency: currency,
@@ -7,7 +7,6 @@ var viewContent = function(data) {
7
7
  var quantity = data.quantity, price = data.price, currency = data.currencyCode, id = data.sku;
8
8
  var value = price * quantity;
9
9
  window.fbq('track', 'ViewContent', {
10
- // eslint-disable-next-line @typescript-eslint/camelcase
11
10
  content_type: 'product',
12
11
  value: value,
13
12
  currency: currency,
@@ -23,7 +23,7 @@ var Portal = function(param) {
23
23
  // In that case, it's important to append to the correct document element.
24
24
  var ownerDocument = mountNode.current.ownerDocument;
25
25
  portalNode.current = ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.createElement(type);
26
- ownerDocument.body.appendChild(portalNode.current);
26
+ ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.body.appendChild(portalNode.current);
27
27
  forceUpdate();
28
28
  return function() {
29
29
  if (portalNode.current && portalNode.current.ownerDocument) {
@@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", {
2
2
  value: true
3
3
  });
4
4
  exports.useGetSetState = void 0;
5
- var _react = _interopRequireWildcard(require("react"));
5
+ var _react = require("react");
6
6
  var _ = require("./");
7
7
  function _defineProperty(obj, key, value) {
8
8
  if (key in obj) {
@@ -17,29 +17,6 @@ function _defineProperty(obj, key, value) {
17
17
  }
18
18
  return obj;
19
19
  }
20
- function _interopRequireWildcard(obj) {
21
- if (obj && obj.__esModule) {
22
- return obj;
23
- } else {
24
- var newObj = {
25
- };
26
- if (obj != null) {
27
- for(var key in obj){
28
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
29
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
30
- };
31
- if (desc.get || desc.set) {
32
- Object.defineProperty(newObj, key, desc);
33
- } else {
34
- newObj[key] = obj[key];
35
- }
36
- }
37
- }
38
- }
39
- newObj.default = obj;
40
- return newObj;
41
- }
42
- }
43
20
  function _objectSpread(target) {
44
21
  for(var i = 1; i < arguments.length; i++){
45
22
  var source = arguments[i] != null ? arguments[i] : {
@@ -14,8 +14,7 @@ function mapVoucherData(element) {
14
14
  var limitValue = element.cartDiscounts[0].resource.maxDiscountValue.centAmount;
15
15
  var limitCurrency = element.cartDiscounts[0].resource.maxDiscountValue.currencyCode;
16
16
  var endDate = new Date(element.validTo).toLocaleDateString('bg-BG');
17
- var isUsed = //@ts-ignore
18
- element.totalApplications >= element.maxApplicationsPerCustomer;
17
+ var isUsed = element.totalApplications >= ((element === null || element === void 0 ? void 0 : element.maxApplicationsPerCustomer) || 1);
19
18
  return {
20
19
  voucherCode: voucherCode,
21
20
  campaign: campaign,
@@ -57,7 +57,7 @@ var Container = function(param) {
57
57
  mobile: onlyMobile,
58
58
  desktop: onlyDesktop
59
59
  }, Boolean(title) && /*#__PURE__*/ _react.default.createElement(Headline, {
60
- color: labelsColor
60
+ color: labelsColor || ''
61
61
  }, title), /*#__PURE__*/ _react.default.createElement(Flex, null, children)));
62
62
  };
63
63
  exports.Container = Container;
@@ -71,6 +71,7 @@ function _templateObject4() {
71
71
  }
72
72
  var EmptyBox = function(param) {
73
73
  var backgroundColor = param.backgroundColor, searchHistory = param.searchHistory, labels = param.labels, labelsColor = param.labelsColor, textColor = param.textColor, onClose = param.onClose, canDisplayPopular = param.canDisplayPopular, canDisplayRecent = param.canDisplayRecent, withRecent = param.withRecent, promoOffers = param.promoOffers, searchValue = param.searchValue, isLoading = param.isLoading;
74
+ var ref, ref1, ref2, ref3;
74
75
  return(/*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, isLoading ? /*#__PURE__*/ _react.default.createElement("div", {
75
76
  style: {
76
77
  width: '100%',
@@ -79,28 +80,28 @@ var EmptyBox = function(param) {
79
80
  }, /*#__PURE__*/ _react.default.createElement(_.Spinner, null)) : /*#__PURE__*/ _react.default.createElement(Wrapper, null, !searchValue || (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length) < 3 ? /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(BlogCol, {
80
81
  backgroundColor: backgroundColor
81
82
  }, /*#__PURE__*/ _react.default.createElement(_.BlogContainer, {
82
- blogTitle: labels.blog.blogTitle,
83
- image: labels.blog.image,
84
- url: labels.blog.url,
85
- description: labels.blog.description,
86
- title: labels.blogLabel,
87
- labelsColor: labelsColor,
88
- textColor: textColor,
83
+ blogTitle: (labels === null || labels === void 0 ? void 0 : (ref = labels.blog) === null || ref === void 0 ? void 0 : ref.blogTitle) || '',
84
+ image: (labels === null || labels === void 0 ? void 0 : (ref1 = labels.blog) === null || ref1 === void 0 ? void 0 : ref1.image) || '',
85
+ url: (labels === null || labels === void 0 ? void 0 : (ref2 = labels.blog) === null || ref2 === void 0 ? void 0 : ref2.url) || '',
86
+ description: (labels === null || labels === void 0 ? void 0 : (ref3 = labels.blog) === null || ref3 === void 0 ? void 0 : ref3.description) || '',
87
+ title: (labels === null || labels === void 0 ? void 0 : labels.blogLabel) || '',
88
+ labelsColor: labelsColor || '',
89
+ textColor: textColor || '',
89
90
  onClose: onClose
90
91
  })), /*#__PURE__*/ _react.default.createElement(SuggestedSearches, null, canDisplayPopular && /*#__PURE__*/ _react.default.createElement(_.PopularSearches, {
91
- title: labels.popularSearchesLabel,
92
+ title: (labels === null || labels === void 0 ? void 0 : labels.popularSearchesLabel) || '',
92
93
  onClose: onClose,
93
- textColor: textColor,
94
- labelsColor: labelsColor
94
+ textColor: textColor || '',
95
+ labelsColor: labelsColor || ''
95
96
  }), withRecent && canDisplayRecent && /*#__PURE__*/ _react.default.createElement(_.RecentSearches, {
96
- title: labels.recentSearchesLabel,
97
+ title: (labels === null || labels === void 0 ? void 0 : labels.recentSearchesLabel) || '',
97
98
  data: searchHistory,
98
99
  onClose: onClose,
99
- textColor: textColor,
100
- labelsColor: labelsColor
100
+ textColor: textColor || '',
101
+ labelsColor: labelsColor || ''
101
102
  }))) : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_.Container, {
102
103
  labelsColor: labelsColor,
103
- title: labels.productsLabel,
104
+ title: (labels === null || labels === void 0 ? void 0 : labels.productsLabel) || '',
104
105
  onlyMobile: true
105
106
  }, /*#__PURE__*/ _react.default.createElement(NoResultsDesc, {
106
107
  className: "SEARCH_BOX_NO_RESULT"
@@ -108,14 +109,14 @@ var EmptyBox = function(param) {
108
109
  backgroundColor: backgroundColor
109
110
  }, /*#__PURE__*/ _react.default.createElement(_.Products, {
110
111
  data: promoOffers,
111
- textColor: textColor,
112
- labelsColor: labelsColor,
112
+ textColor: textColor || '',
113
+ labelsColor: labelsColor || '',
113
114
  onClose: onClose,
114
- title: labels.promoOffersLabel,
115
+ title: (labels === null || labels === void 0 ? void 0 : labels.promoOffersLabel) || '',
115
116
  offers: true
116
117
  })), /*#__PURE__*/ _react.default.createElement(_.Container, {
117
118
  labelsColor: labelsColor,
118
- title: labels.productsLabel,
119
+ title: (labels === null || labels === void 0 ? void 0 : labels.productsLabel) || '',
119
120
  onlyDesktop: true
120
121
  }, /*#__PURE__*/ _react.default.createElement(NoResultsDesc, {
121
122
  className: "SEARCH_BOX_NO_RESULT"
@@ -160,7 +160,7 @@ var ProductCard = function(param) {
160
160
  fontWeight: 400
161
161
  }
162
162
  }, name), /*#__PURE__*/ _react.default.createElement(PriceContainer, null, discountPrice ? /*#__PURE__*/ _react.default.createElement(Price, null, /*#__PURE__*/ _react.default.createElement(NewPrice, null, discountPrice.displayValue), /*#__PURE__*/ _react.default.createElement(OriginalPrice, null, price.displayValue)) : /*#__PURE__*/ _react.default.createElement(ProductCardPrice, {
163
- color: priceColor
163
+ color: priceColor || ''
164
164
  }, price.displayValue)))))), /*#__PURE__*/ _react.default.createElement(Divider, {
165
165
  isLast: isLast
166
166
  })));
@@ -37,7 +37,7 @@ var Products = function(param) {
37
37
  labelsColor: labelsColor,
38
38
  title: title,
39
39
  offers: offers,
40
- noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
40
+ noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
41
41
  }, Boolean(data === null || data === void 0 ? void 0 : data.length) ? /*#__PURE__*/ _react.default.createElement("div", {
42
42
  className: "row ".concat(offers ? 'flex-column' : '')
43
43
  }, data === null || data === void 0 ? void 0 : data.map(function(product, index) {
@@ -48,7 +48,7 @@ var Products = function(param) {
48
48
  labelsColor: labelsColor,
49
49
  priceColor: priceColor,
50
50
  onClose: onClose,
51
- isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1,
51
+ isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1 || null,
52
52
  offers: offers,
53
53
  productSpacing: productSpacing
54
54
  }));
@@ -15,7 +15,7 @@ var RecentSearches = function(param) {
15
15
  return(/*#__PURE__*/ _react.default.createElement(_.Container, {
16
16
  labelsColor: labelsColor,
17
17
  title: title,
18
- noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
18
+ noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
19
19
  }, data && /*#__PURE__*/ _react.default.createElement(_recentsSearchesList.RecentSearchesList, {
20
20
  data: data,
21
21
  onClose: onClose,
@@ -173,7 +173,7 @@ var BottomMenuEnum1;
173
173
  })(BottomMenuEnum1 || (BottomMenuEnum1 = {
174
174
  }));
175
175
  var SearchBox = function(param) {
176
- var isLoading = param.isLoading, onClose = param.onClose, suggestedBrands = param.suggestedBrands, suggestedCategories = param.suggestedCategories, suggestions = param.suggestions, searchValue = param.searchValue, _withRecent = param.withRecent, withRecent = _withRecent === void 0 ? true : _withRecent, labels = param.labels, bottomMenu = param.bottomMenu, labelsColor = param.labelsColor, textColor = param.textColor, priceColor = param.priceColor, backgroundColor = param.backgroundColor, onSearchSubmit = param.onSearchSubmit, top = param.top, delay = param.delay, isContainer = param.isContainer, noCloseButton = param.noCloseButton, productSpacing = param.productSpacing, closeButtonOnTop = param.closeButtonOnTop, _hasPopularSearches = param.hasPopularSearches, hasPopularSearches = _hasPopularSearches === void 0 ? false : _hasPopularSearches;
176
+ var isLoading = param.isLoading, onClose = param.onClose, suggestedBrands = param.suggestedBrands, suggestedCategories = param.suggestedCategories, suggestions = param.suggestions, searchValue = param.searchValue, _withRecent = param.withRecent, withRecent = _withRecent === void 0 ? true : _withRecent, labels = param.labels, bottomMenu = param.bottomMenu, labelsColor = param.labelsColor, textColor = param.textColor, priceColor = param.priceColor, backgroundColor = param.backgroundColor, onSearchSubmit = param.onSearchSubmit, top = param.top, delay = param.delay, isContainer = param.isContainer, noCloseButton = param.noCloseButton, productSpacing = param.productSpacing, closeButtonOnTop = param.closeButtonOnTop, _hasPopularSearches = param.hasPopularSearches, hasPopularSearches = _hasPopularSearches === void 0 ? null : _hasPopularSearches;
177
177
  var ref = (0, _index).useSearchHistory(), data = ref.data, loadingRecent = ref.isLoading;
178
178
  var canDisplayRecent = !loadingRecent;
179
179
  var searchHistory = data === null || data === void 0 ? void 0 : data.results;
@@ -201,21 +201,21 @@ var SearchBox = function(param) {
201
201
  }, /*#__PURE__*/ _react.default.createElement(SearchBoxContent, {
202
202
  isContainer: isContainer
203
203
  }, /*#__PURE__*/ _react.default.createElement(Row, null, /*#__PURE__*/ _react.default.createElement(_components.Placeholder, null), showResults ? /*#__PURE__*/ _react.default.createElement(ResultsBox, null, /*#__PURE__*/ _react.default.createElement(SuggestedBrandsCol, {
204
- backgroundColor: backgroundColor
204
+ backgroundColor: backgroundColor || ''
205
205
  }, suggestedBrands.length !== 0 && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_components.Suggestions, {
206
206
  data: displayableBrands,
207
207
  onClose: onClose,
208
- searchValue: searchValue,
209
- title: labels.suggestedBrandsLabel,
210
- labelsColor: labelsColor,
211
- textColor: textColor
208
+ searchValue: searchValue || '',
209
+ title: (labels === null || labels === void 0 ? void 0 : labels.suggestedBrandsLabel) || '',
210
+ labelsColor: labelsColor || '',
211
+ textColor: textColor || ''
212
212
  })), suggestedCategories.length > 0 && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_components.Suggestions, {
213
213
  data: suggestedCategories,
214
214
  onClose: onClose,
215
- searchValue: searchValue,
216
- title: labels.suggestedCategoriesLabel,
217
- labelsColor: labelsColor,
218
- textColor: textColor
215
+ searchValue: searchValue || '',
216
+ title: (labels === null || labels === void 0 ? void 0 : labels.suggestedCategoriesLabel) || '',
217
+ labelsColor: labelsColor || '',
218
+ textColor: textColor || ''
219
219
  }))), /*#__PURE__*/ _react.default.createElement(ProductsWrapper, {
220
220
  backgroundColor: backgroundColor
221
221
  }, /*#__PURE__*/ _react.default.createElement(_components.Products, {
@@ -244,7 +244,7 @@ var SearchBox = function(param) {
244
244
  onClose: onClose,
245
245
  searchHistory: searchHistory,
246
246
  textColor: textColor,
247
- canDisplayRecent: canDisplayRecent,
247
+ canDisplayRecent: canDisplayRecent || null,
248
248
  withRecent: withRecent,
249
249
  promoOffers: promoOffers,
250
250
  searchValue: searchValue
@@ -57,7 +57,6 @@ function _objectSpread(target) {
57
57
  }
58
58
  return target;
59
59
  }
60
- ;
61
60
  (function(global) {
62
61
  var log = function log(message) {
63
62
  if (debug) {
@@ -4,7 +4,6 @@ export var addToCart = function(sku, quantity, price) {
4
4
  var value = decodePrice(price) * quantity;
5
5
  var currency = price.currencyCode;
6
6
  window.fbq('track', 'AddToCart', {
7
- // eslint-disable-next-line @typescript-eslint/camelcase
8
7
  content_type: 'product',
9
8
  value: value,
10
9
  currency: currency,
@@ -10,7 +10,6 @@ export var initiateCheckout = function(order) {
10
10
  var currency = order.currencyCode;
11
11
  var value = decodePrice(order.grandTotalPrice);
12
12
  window.fbq('track', 'InitiateCheckout', {
13
- // eslint-disable-next-line @typescript-eslint/camelcase
14
13
  content_type: 'product',
15
14
  contents: contents,
16
15
  currency: currency,
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/camelcase */ import { useConfigState } from '../hooks/useConfig';
1
+ import { useConfigState } from '../hooks/useConfig';
2
2
  export var usePageView = function() {
3
3
  var config = useConfigState();
4
4
  return function(url, title) {
@@ -4,7 +4,6 @@ export var viewContent = function(data) {
4
4
  var quantity = data.quantity, price = data.price, currency = data.currencyCode, id = data.sku;
5
5
  var value = price * quantity;
6
6
  window.fbq('track', 'ViewContent', {
7
- // eslint-disable-next-line @typescript-eslint/camelcase
8
7
  content_type: 'product',
9
8
  value: value,
10
9
  currency: currency,
@@ -1,5 +1,5 @@
1
1
  import regeneratorRuntime from "regenerator-runtime";
2
- /* eslint-disable @typescript-eslint/camelcase */ import React, { useCallback } from 'react';
2
+ import React, { useCallback } from 'react';
3
3
  import Cookies from 'js-cookie';
4
4
  import { useLoginGoogle } from '../..';
5
5
  import { ExternalScript } from '../ExternalScript';
@@ -14,7 +14,7 @@ var Portal = function(param) {
14
14
  // In that case, it's important to append to the correct document element.
15
15
  var ownerDocument = mountNode.current.ownerDocument;
16
16
  portalNode.current = ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.createElement(type);
17
- ownerDocument.body.appendChild(portalNode.current);
17
+ ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.body.appendChild(portalNode.current);
18
18
  forceUpdate();
19
19
  return function() {
20
20
  if (portalNode.current && portalNode.current.ownerDocument) {
@@ -1,4 +1,4 @@
1
- import React, { useRef, useCallback } from 'react';
1
+ import { useRef, useCallback } from 'react';
2
2
  import { useUpdate } from './';
3
3
  function _defineProperty(obj, key, value) {
4
4
  if (key in obj) {
@@ -10,8 +10,7 @@ function mapVoucherData(element) {
10
10
  var limitValue = element.cartDiscounts[0].resource.maxDiscountValue.centAmount;
11
11
  var limitCurrency = element.cartDiscounts[0].resource.maxDiscountValue.currencyCode;
12
12
  var endDate = new Date(element.validTo).toLocaleDateString('bg-BG');
13
- var isUsed = //@ts-ignore
14
- element.totalApplications >= element.maxApplicationsPerCustomer;
13
+ var isUsed = element.totalApplications >= ((element === null || element === void 0 ? void 0 : element.maxApplicationsPerCustomer) || 1);
15
14
  return {
16
15
  voucherCode: voucherCode,
17
16
  campaign: campaign,
@@ -48,7 +48,7 @@ export var Container = function(param) {
48
48
  mobile: onlyMobile,
49
49
  desktop: onlyDesktop
50
50
  }, Boolean(title) && /*#__PURE__*/ React.createElement(Headline, {
51
- color: labelsColor
51
+ color: labelsColor || ''
52
52
  }, title), /*#__PURE__*/ React.createElement(Flex, null, children)));
53
53
  };
54
54
  var Wrapper = styled.div.attrs(function(props) {
@@ -62,6 +62,7 @@ function _templateObject4() {
62
62
  }
63
63
  export var EmptyBox = function(param) {
64
64
  var backgroundColor = param.backgroundColor, searchHistory = param.searchHistory, labels = param.labels, labelsColor = param.labelsColor, textColor = param.textColor, onClose = param.onClose, canDisplayPopular = param.canDisplayPopular, canDisplayRecent = param.canDisplayRecent, withRecent = param.withRecent, promoOffers = param.promoOffers, searchValue = param.searchValue, isLoading = param.isLoading;
65
+ var ref, ref1, ref2, ref3;
65
66
  return(/*#__PURE__*/ React.createElement(React.Fragment, null, isLoading ? /*#__PURE__*/ React.createElement("div", {
66
67
  style: {
67
68
  width: '100%',
@@ -70,28 +71,28 @@ export var EmptyBox = function(param) {
70
71
  }, /*#__PURE__*/ React.createElement(Spinner, null)) : /*#__PURE__*/ React.createElement(Wrapper, null, !searchValue || (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length) < 3 ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(BlogCol, {
71
72
  backgroundColor: backgroundColor
72
73
  }, /*#__PURE__*/ React.createElement(BlogContainer, {
73
- blogTitle: labels.blog.blogTitle,
74
- image: labels.blog.image,
75
- url: labels.blog.url,
76
- description: labels.blog.description,
77
- title: labels.blogLabel,
78
- labelsColor: labelsColor,
79
- textColor: textColor,
74
+ blogTitle: (labels === null || labels === void 0 ? void 0 : (ref = labels.blog) === null || ref === void 0 ? void 0 : ref.blogTitle) || '',
75
+ image: (labels === null || labels === void 0 ? void 0 : (ref1 = labels.blog) === null || ref1 === void 0 ? void 0 : ref1.image) || '',
76
+ url: (labels === null || labels === void 0 ? void 0 : (ref2 = labels.blog) === null || ref2 === void 0 ? void 0 : ref2.url) || '',
77
+ description: (labels === null || labels === void 0 ? void 0 : (ref3 = labels.blog) === null || ref3 === void 0 ? void 0 : ref3.description) || '',
78
+ title: (labels === null || labels === void 0 ? void 0 : labels.blogLabel) || '',
79
+ labelsColor: labelsColor || '',
80
+ textColor: textColor || '',
80
81
  onClose: onClose
81
82
  })), /*#__PURE__*/ React.createElement(SuggestedSearches, null, canDisplayPopular && /*#__PURE__*/ React.createElement(PopularSearches, {
82
- title: labels.popularSearchesLabel,
83
+ title: (labels === null || labels === void 0 ? void 0 : labels.popularSearchesLabel) || '',
83
84
  onClose: onClose,
84
- textColor: textColor,
85
- labelsColor: labelsColor
85
+ textColor: textColor || '',
86
+ labelsColor: labelsColor || ''
86
87
  }), withRecent && canDisplayRecent && /*#__PURE__*/ React.createElement(RecentSearches, {
87
- title: labels.recentSearchesLabel,
88
+ title: (labels === null || labels === void 0 ? void 0 : labels.recentSearchesLabel) || '',
88
89
  data: searchHistory,
89
90
  onClose: onClose,
90
- textColor: textColor,
91
- labelsColor: labelsColor
91
+ textColor: textColor || '',
92
+ labelsColor: labelsColor || ''
92
93
  }))) : /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Container, {
93
94
  labelsColor: labelsColor,
94
- title: labels.productsLabel,
95
+ title: (labels === null || labels === void 0 ? void 0 : labels.productsLabel) || '',
95
96
  onlyMobile: true
96
97
  }, /*#__PURE__*/ React.createElement(NoResultsDesc, {
97
98
  className: "SEARCH_BOX_NO_RESULT"
@@ -99,14 +100,14 @@ export var EmptyBox = function(param) {
99
100
  backgroundColor: backgroundColor
100
101
  }, /*#__PURE__*/ React.createElement(Products, {
101
102
  data: promoOffers,
102
- textColor: textColor,
103
- labelsColor: labelsColor,
103
+ textColor: textColor || '',
104
+ labelsColor: labelsColor || '',
104
105
  onClose: onClose,
105
- title: labels.promoOffersLabel,
106
+ title: (labels === null || labels === void 0 ? void 0 : labels.promoOffersLabel) || '',
106
107
  offers: true
107
108
  })), /*#__PURE__*/ React.createElement(Container, {
108
109
  labelsColor: labelsColor,
109
- title: labels.productsLabel,
110
+ title: (labels === null || labels === void 0 ? void 0 : labels.productsLabel) || '',
110
111
  onlyDesktop: true
111
112
  }, /*#__PURE__*/ React.createElement(NoResultsDesc, {
112
113
  className: "SEARCH_BOX_NO_RESULT"
@@ -151,7 +151,7 @@ export var ProductCard = function(param) {
151
151
  fontWeight: 400
152
152
  }
153
153
  }, name), /*#__PURE__*/ React.createElement(PriceContainer, null, discountPrice ? /*#__PURE__*/ React.createElement(Price, null, /*#__PURE__*/ React.createElement(NewPrice, null, discountPrice.displayValue), /*#__PURE__*/ React.createElement(OriginalPrice, null, price.displayValue)) : /*#__PURE__*/ React.createElement(ProductCardPrice, {
154
- color: priceColor
154
+ color: priceColor || ''
155
155
  }, price.displayValue)))))), /*#__PURE__*/ React.createElement(Divider, {
156
156
  isLast: isLast
157
157
  })));
@@ -28,7 +28,7 @@ export var Products = function(param) {
28
28
  labelsColor: labelsColor,
29
29
  title: title,
30
30
  offers: offers,
31
- noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
31
+ noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
32
32
  }, Boolean(data === null || data === void 0 ? void 0 : data.length) ? /*#__PURE__*/ React.createElement("div", {
33
33
  className: "row ".concat(offers ? 'flex-column' : '')
34
34
  }, data === null || data === void 0 ? void 0 : data.map(function(product, index) {
@@ -39,7 +39,7 @@ export var Products = function(param) {
39
39
  labelsColor: labelsColor,
40
40
  priceColor: priceColor,
41
41
  onClose: onClose,
42
- isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1,
42
+ isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1 || null,
43
43
  offers: offers,
44
44
  productSpacing: productSpacing
45
45
  }));
@@ -6,7 +6,7 @@ export var RecentSearches = function(param) {
6
6
  return(/*#__PURE__*/ React.createElement(Container, {
7
7
  labelsColor: labelsColor,
8
8
  title: title,
9
- noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
9
+ noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
10
10
  }, data && /*#__PURE__*/ React.createElement(RecentSearchesList, {
11
11
  data: data,
12
12
  onClose: onClose,
@@ -141,7 +141,7 @@ var BottomMenuEnum1;
141
141
  })(BottomMenuEnum1 || (BottomMenuEnum1 = {
142
142
  }));
143
143
  export var SearchBox = function(param) {
144
- var isLoading = param.isLoading, onClose = param.onClose, suggestedBrands = param.suggestedBrands, suggestedCategories = param.suggestedCategories, suggestions = param.suggestions, searchValue = param.searchValue, _withRecent = param.withRecent, withRecent = _withRecent === void 0 ? true : _withRecent, labels = param.labels, bottomMenu = param.bottomMenu, labelsColor = param.labelsColor, textColor = param.textColor, priceColor = param.priceColor, backgroundColor = param.backgroundColor, onSearchSubmit = param.onSearchSubmit, top = param.top, delay = param.delay, isContainer = param.isContainer, noCloseButton = param.noCloseButton, productSpacing = param.productSpacing, closeButtonOnTop = param.closeButtonOnTop, _hasPopularSearches = param.hasPopularSearches, hasPopularSearches = _hasPopularSearches === void 0 ? false : _hasPopularSearches;
144
+ var isLoading = param.isLoading, onClose = param.onClose, suggestedBrands = param.suggestedBrands, suggestedCategories = param.suggestedCategories, suggestions = param.suggestions, searchValue = param.searchValue, _withRecent = param.withRecent, withRecent = _withRecent === void 0 ? true : _withRecent, labels = param.labels, bottomMenu = param.bottomMenu, labelsColor = param.labelsColor, textColor = param.textColor, priceColor = param.priceColor, backgroundColor = param.backgroundColor, onSearchSubmit = param.onSearchSubmit, top = param.top, delay = param.delay, isContainer = param.isContainer, noCloseButton = param.noCloseButton, productSpacing = param.productSpacing, closeButtonOnTop = param.closeButtonOnTop, _hasPopularSearches = param.hasPopularSearches, hasPopularSearches = _hasPopularSearches === void 0 ? null : _hasPopularSearches;
145
145
  var ref = useSearchHistory(), data = ref.data, loadingRecent = ref.isLoading;
146
146
  var canDisplayRecent = !loadingRecent;
147
147
  var searchHistory = data === null || data === void 0 ? void 0 : data.results;
@@ -169,21 +169,21 @@ export var SearchBox = function(param) {
169
169
  }, /*#__PURE__*/ React.createElement(SearchBoxContent, {
170
170
  isContainer: isContainer
171
171
  }, /*#__PURE__*/ React.createElement(Row, null, /*#__PURE__*/ React.createElement(Placeholder, null), showResults ? /*#__PURE__*/ React.createElement(ResultsBox, null, /*#__PURE__*/ React.createElement(SuggestedBrandsCol, {
172
- backgroundColor: backgroundColor
172
+ backgroundColor: backgroundColor || ''
173
173
  }, suggestedBrands.length !== 0 && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Suggestions, {
174
174
  data: displayableBrands,
175
175
  onClose: onClose,
176
- searchValue: searchValue,
177
- title: labels.suggestedBrandsLabel,
178
- labelsColor: labelsColor,
179
- textColor: textColor
176
+ searchValue: searchValue || '',
177
+ title: (labels === null || labels === void 0 ? void 0 : labels.suggestedBrandsLabel) || '',
178
+ labelsColor: labelsColor || '',
179
+ textColor: textColor || ''
180
180
  })), suggestedCategories.length > 0 && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Suggestions, {
181
181
  data: suggestedCategories,
182
182
  onClose: onClose,
183
- searchValue: searchValue,
184
- title: labels.suggestedCategoriesLabel,
185
- labelsColor: labelsColor,
186
- textColor: textColor
183
+ searchValue: searchValue || '',
184
+ title: (labels === null || labels === void 0 ? void 0 : labels.suggestedCategoriesLabel) || '',
185
+ labelsColor: labelsColor || '',
186
+ textColor: textColor || ''
187
187
  }))), /*#__PURE__*/ React.createElement(ProductsWrapper, {
188
188
  backgroundColor: backgroundColor
189
189
  }, /*#__PURE__*/ React.createElement(Products, {
@@ -212,7 +212,7 @@ export var SearchBox = function(param) {
212
212
  onClose: onClose,
213
213
  searchHistory: searchHistory,
214
214
  textColor: textColor,
215
- canDisplayRecent: canDisplayRecent,
215
+ canDisplayRecent: canDisplayRecent || null,
216
216
  withRecent: withRecent,
217
217
  promoOffers: promoOffers,
218
218
  searchValue: searchValue
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
+ import { BooleanField, StringField } from '@sentecacommerce-theme/cms';
2
3
  interface ContainerProps {
3
- title?: string;
4
- labelsColor: string;
4
+ title?: StringField;
5
+ labelsColor: StringField;
5
6
  children: React.ReactNode;
6
- isBottom?: boolean;
7
- noData?: boolean;
8
- backgroundColor?: string;
9
- products?: boolean;
10
- onlyMobile?: boolean;
11
- onlyDesktop?: boolean;
12
- offers?: boolean;
7
+ isBottom?: BooleanField;
8
+ noData?: BooleanField;
9
+ backgroundColor?: StringField;
10
+ products?: BooleanField;
11
+ onlyMobile?: BooleanField;
12
+ onlyDesktop?: BooleanField;
13
+ offers?: BooleanField;
13
14
  }
14
15
  export declare const Container: ({ title, labelsColor, children, backgroundColor, onlyMobile, onlyDesktop, }: ContainerProps) => JSX.Element;
15
16
  export {};
@@ -1,28 +1,29 @@
1
+ import type { BooleanField, GroupField, StringField } from '@sentecacommerce-theme/cms';
1
2
  interface EmptyBoxProps {
2
- backgroundColor?: string;
3
+ backgroundColor?: StringField;
3
4
  searchHistory?: any[];
4
- labels: {
5
- promoOffersLabel: string;
6
- productsLabel: string;
7
- recentSearchesLabel: string;
8
- popularSearchesLabel: string;
9
- blogLabel: string;
10
- blog: {
11
- blogTitle: string;
12
- image: string;
13
- url: string;
14
- description: string;
15
- };
16
- };
17
- labelsColor: string;
18
- textColor: string;
5
+ labels: GroupField<{
6
+ promoOffersLabel: StringField;
7
+ productsLabel: StringField;
8
+ recentSearchesLabel: StringField;
9
+ popularSearchesLabel: StringField;
10
+ blogLabel: StringField;
11
+ blog: GroupField<{
12
+ blogTitle: StringField;
13
+ image: StringField;
14
+ url: StringField;
15
+ description: StringField;
16
+ }>;
17
+ }>;
18
+ labelsColor: StringField;
19
+ textColor: StringField;
19
20
  onClose?: () => void;
20
- canDisplayPopular: boolean;
21
- withRecent?: boolean;
22
- canDisplayRecent?: boolean;
21
+ canDisplayPopular: BooleanField;
22
+ withRecent?: BooleanField;
23
+ canDisplayRecent?: BooleanField;
23
24
  promoOffers?: any[];
24
- searchValue?: string;
25
- isLoading?: boolean;
25
+ searchValue?: StringField;
26
+ isLoading?: BooleanField;
26
27
  }
27
28
  export declare const EmptyBox: ({ backgroundColor, searchHistory, labels, labelsColor, textColor, onClose, canDisplayPopular, canDisplayRecent, withRecent, promoOffers, searchValue, isLoading, }: EmptyBoxProps) => JSX.Element;
28
29
  export {};
@@ -1,12 +1,13 @@
1
1
  import { SearchResultDTO } from '@sentecacommerce/sdk';
2
+ import { BooleanField, NumberField, StringField } from '@sentecacommerce-theme/cms';
2
3
  export declare const ProductCard: ({ item, bottomMenu, priceColor, textColor, labelsColor, onClose, isLast, offers, productSpacing, }: {
3
4
  item: SearchResultDTO;
4
- bottomMenu?: string | undefined;
5
- priceColor?: string | undefined;
6
- textColor: string;
7
- labelsColor: string;
5
+ bottomMenu?: StringField | undefined;
6
+ priceColor?: StringField | undefined;
7
+ textColor: StringField;
8
+ labelsColor: StringField;
8
9
  onClose?: (() => void) | undefined;
9
- isLast: boolean;
10
- offers?: boolean | undefined;
11
- productSpacing?: number | undefined;
10
+ isLast: BooleanField;
11
+ offers?: BooleanField | undefined;
12
+ productSpacing?: NumberField | undefined;
12
13
  }) => JSX.Element;
@@ -1,12 +1,13 @@
1
+ import { BooleanField, NumberField, StringField } from '@sentecacommerce-theme/cms';
1
2
  export declare const Products: ({ data, bottomMenu, priceColor, textColor, labelsColor, onClose, backgroundColor, title, offers, productSpacing, }: {
2
3
  data?: any[] | undefined;
3
- bottomMenu?: string | undefined;
4
- priceColor?: string | undefined;
5
- textColor: string;
6
- labelsColor: string;
4
+ bottomMenu?: StringField | undefined;
5
+ priceColor?: StringField | undefined;
6
+ textColor: StringField;
7
+ labelsColor: StringField;
7
8
  onClose?: (() => void) | undefined;
8
- backgroundColor?: string | undefined;
9
- title?: string | undefined;
10
- offers?: boolean | undefined;
11
- productSpacing?: number | undefined;
9
+ backgroundColor?: StringField | undefined;
10
+ title?: StringField | undefined;
11
+ offers?: BooleanField | undefined;
12
+ productSpacing?: NumberField | undefined;
12
13
  }) => JSX.Element;
@@ -1,45 +1,46 @@
1
+ import { StringField, GroupField, BooleanField, NumberField } from '@sentecacommerce-theme/cms';
1
2
  interface SearchLabels {
2
- recentSearchesLabel: string;
3
- popularSearchesLabel: string;
4
- suggestedBrandsLabel: string;
5
- suggestedCategoriesLabel: string;
6
- promoOffersLabel: string;
7
- productsLabel: string;
8
- blogLabel: string;
9
- blog: {
10
- blogTitle: string;
11
- image: string;
12
- description: string;
13
- url: string;
14
- };
3
+ recentSearchesLabel: StringField;
4
+ popularSearchesLabel: StringField;
5
+ suggestedBrandsLabel: StringField;
6
+ suggestedCategoriesLabel: StringField;
7
+ promoOffersLabel: StringField;
8
+ productsLabel: StringField;
9
+ blogLabel: StringField;
10
+ blog: GroupField<{
11
+ blogTitle: StringField;
12
+ image: StringField;
13
+ description: StringField;
14
+ url: StringField;
15
+ }>;
15
16
  }
16
17
  export declare type TopStyleType = {
17
- desktop: string;
18
- mobile: string;
18
+ desktop: StringField;
19
+ mobile: StringField;
19
20
  };
20
21
  export interface SearchBoxProps {
21
- isLoading: boolean;
22
+ isLoading: BooleanField;
22
23
  children?: any;
23
24
  onClose?: () => void;
24
25
  suggestedBrands: any[];
25
26
  suggestedCategories: any[];
26
27
  suggestions: any[];
27
- searchValue: string;
28
+ searchValue: StringField;
28
29
  labels: SearchLabels;
29
- labelsColor: string;
30
- textColor: string;
31
- priceColor: string;
32
- delay?: string;
33
- top?: TopStyleType;
34
- withRecent?: boolean;
35
- bottomMenu?: string;
36
- backgroundColor?: string;
30
+ labelsColor: StringField;
31
+ textColor: StringField;
32
+ priceColor: StringField;
33
+ delay: StringField;
34
+ top: TopStyleType;
35
+ withRecent: BooleanField;
36
+ bottomMenu: StringField;
37
+ backgroundColor: StringField;
37
38
  onSearchSubmit?: (e: any) => void;
38
- isContainer?: boolean;
39
- noCloseButton?: boolean;
40
- productSpacing?: number;
41
- closeButtonOnTop?: boolean;
42
- hasPopularSearches?: boolean;
39
+ isContainer?: BooleanField;
40
+ noCloseButton?: BooleanField;
41
+ productSpacing?: NumberField;
42
+ closeButtonOnTop?: BooleanField;
43
+ hasPopularSearches?: BooleanField;
43
44
  }
44
45
  export declare const SearchBox: ({ isLoading, onClose, suggestedBrands, suggestedCategories, suggestions, searchValue, withRecent, labels, bottomMenu, labelsColor, textColor, priceColor, backgroundColor, onSearchSubmit, top, delay, isContainer, noCloseButton, productSpacing, closeButtonOnTop, hasPopularSearches, }: SearchBoxProps) => JSX.Element;
45
46
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentecacommerce-theme/lib",
3
3
  "sideEffects": false,
4
- "version": "0.13.5-alpha.9",
4
+ "version": "0.13.7-alpha.1",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/types/index.d.ts",
@@ -31,9 +31,10 @@
31
31
  "watch:cjs": "swc src --out-dir dist/cjs -w",
32
32
  "watch:esm": "swc src --out-dir dist/esm --no-swcrc -w"
33
33
  },
34
- "gitHead": "6ef4e8d1421b4ff3c1c0934ce41e1dcd8ea9ea05",
34
+ "gitHead": "cf94e18e4b1843926172d5722c667a88533157cd",
35
35
  "dependencies": {
36
36
  "@sentecacommerce-theme/base": "^0.13.5-alpha.0",
37
+ "@sentecacommerce-theme/cms": "^0.13.5-alpha.0",
37
38
  "@sentecacommerce/sdk": "2.0.142",
38
39
  "body-scroll-lock": "^3.1.5",
39
40
  "copy-to-clipboard": "^3.3.1",