@bonlineza/luxity-lib 2.38.1 → 2.39.0

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, _initialSearchData$tr, _initialSearchData$la, _limitBrands, _limitBrands2, _initialSearchData$la2, _searchResults$produc2;
15807
+ var _searchResults$brands, _searchResults$produc, _initialSearchData$tr, _initialSearchData$la;
15808
15808
 
15809
15809
  var searchValue = _ref.searchValue,
15810
15810
  searchResults = _ref.searchResults,
@@ -15821,7 +15821,9 @@
15821
15821
  onBrandSearchResultClick = _ref.onBrandSearchResultClick,
15822
15822
  onCreateInterests = _ref.onCreateInterests,
15823
15823
  noResultsImage = _ref.noResultsImage,
15824
- showNoResults = _ref.showNoResults;
15824
+ showNoResults = _ref.showNoResults,
15825
+ _ref$isLoading = _ref.isLoading,
15826
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
15825
15827
 
15826
15828
  var _useState = React.useState(false),
15827
15829
  _useState2 = _slicedToArray(_useState, 2),
@@ -15860,6 +15862,39 @@
15860
15862
  return "".concat(currencySymbol).concat(formatter.format(price));
15861
15863
  };
15862
15864
 
15865
+ var renderBrandSkeleton = function renderBrandSkeleton() {
15866
+ return /*#__PURE__*/React__default.createElement("div", {
15867
+ className: "brand-skeleton"
15868
+ }, /*#__PURE__*/React__default.createElement("div", {
15869
+ className: "brand-skeleton__item shimmer"
15870
+ }), /*#__PURE__*/React__default.createElement("div", {
15871
+ className: "brand-skeleton__item shimmer"
15872
+ }), /*#__PURE__*/React__default.createElement("div", {
15873
+ className: "brand-skeleton__item shimmer"
15874
+ }), /*#__PURE__*/React__default.createElement("div", {
15875
+ className: "brand-skeleton__item shimmer"
15876
+ }));
15877
+ };
15878
+
15879
+ var renderProductSkeleton = function renderProductSkeleton() {
15880
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _toConsumableArray(Array(3)).map(function (_, index) {
15881
+ return /*#__PURE__*/React__default.createElement("div", {
15882
+ key: index,
15883
+ className: "product-skeleton"
15884
+ }, /*#__PURE__*/React__default.createElement("div", {
15885
+ className: "product-skeleton__image shimmer"
15886
+ }), /*#__PURE__*/React__default.createElement("div", {
15887
+ className: "product-skeleton__content"
15888
+ }, /*#__PURE__*/React__default.createElement("div", {
15889
+ className: "product-skeleton__title shimmer"
15890
+ }), /*#__PURE__*/React__default.createElement("div", {
15891
+ className: "product-skeleton__subtitle shimmer"
15892
+ }), /*#__PURE__*/React__default.createElement("div", {
15893
+ className: "product-skeleton__price shimmer"
15894
+ })));
15895
+ }));
15896
+ };
15897
+
15863
15898
  var renderProductCard = function renderProductCard(product) {
15864
15899
  var selectedPrice = product.prices ? product.prices.find(function (p) {
15865
15900
  return p.currency === currency;
@@ -15929,6 +15964,70 @@
15929
15964
  }
15930
15965
 
15931
15966
  return brands;
15967
+ };
15968
+
15969
+ var renderBrandsList = function renderBrandsList() {
15970
+ var _limitBrands2;
15971
+
15972
+ if (isLoading) {
15973
+ return renderBrandSkeleton();
15974
+ }
15975
+
15976
+ if (shouldShowInitialData) {
15977
+ var _limitBrands;
15978
+
15979
+ return (_limitBrands = limitBrands(initialSearchData === null || initialSearchData === void 0 ? void 0 : initialSearchData.trending_brands)) === null || _limitBrands === void 0 ? void 0 : _limitBrands.map(function (brand) {
15980
+ return /*#__PURE__*/React__default.createElement("a", {
15981
+ key: brand.id,
15982
+ href: getBrandLink(brand),
15983
+ className: "search-results__item",
15984
+ onClick: function onClick() {
15985
+ if (typeof onBrandSearchResultClick === 'function') {
15986
+ onBrandSearchResultClick({
15987
+ brand_name: brand.name,
15988
+ brand_link: getBrandLink(brand),
15989
+ search_string: searchValue,
15990
+ is_trending: true
15991
+ });
15992
+ }
15993
+ }
15994
+ }, brand.name);
15995
+ });
15996
+ }
15997
+
15998
+ return (_limitBrands2 = limitBrands(searchResults === null || searchResults === void 0 ? void 0 : searchResults.brands)) === null || _limitBrands2 === void 0 ? void 0 : _limitBrands2.map(function (brand) {
15999
+ return /*#__PURE__*/React__default.createElement("a", {
16000
+ key: brand.link,
16001
+ href: brand.link,
16002
+ className: "search-results__item",
16003
+ onClick: function onClick() {
16004
+ if (typeof onBrandSearchResultClick === 'function') {
16005
+ onBrandSearchResultClick({
16006
+ brand_name: brand.name,
16007
+ brand_link: brand.link,
16008
+ search_string: searchValue,
16009
+ is_trending: false
16010
+ });
16011
+ }
16012
+ }
16013
+ }, brand.name);
16014
+ });
16015
+ };
16016
+
16017
+ var renderProductsList = function renderProductsList() {
16018
+ var _searchResults$produc2;
16019
+
16020
+ if (isLoading) {
16021
+ return renderProductSkeleton();
16022
+ }
16023
+
16024
+ if (shouldShowInitialData) {
16025
+ var _initialSearchData$la2;
16026
+
16027
+ return initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$la2 = initialSearchData.latest_products) === null || _initialSearchData$la2 === void 0 ? void 0 : _initialSearchData$la2.map(renderProductCard);
16028
+ }
16029
+
16030
+ return searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$produc2 = searchResults.products) === null || _searchResults$produc2 === void 0 ? void 0 : _searchResults$produc2.map(renderProductCard);
15932
16031
  }; // Show no results state
15933
16032
 
15934
16033
 
@@ -15969,39 +16068,7 @@
15969
16068
  className: "search-results__header"
15970
16069
  }, shouldShowInitialData ? 'TRENDING SEARCHES' : 'BRANDS'), /*#__PURE__*/React__default.createElement("div", {
15971
16070
  className: "search-results__list"
15972
- }, shouldShowInitialData ? (_limitBrands = limitBrands(initialSearchData === null || initialSearchData === void 0 ? void 0 : initialSearchData.trending_brands)) === null || _limitBrands === void 0 ? void 0 : _limitBrands.map(function (brand) {
15973
- return /*#__PURE__*/React__default.createElement("a", {
15974
- key: brand.id,
15975
- href: getBrandLink(brand),
15976
- className: "search-results__item",
15977
- onClick: function onClick() {
15978
- if (typeof onBrandSearchResultClick === 'function') {
15979
- onBrandSearchResultClick({
15980
- brand_name: brand.name,
15981
- brand_link: getBrandLink(brand),
15982
- search_string: searchValue,
15983
- is_trending: true
15984
- });
15985
- }
15986
- }
15987
- }, brand.name);
15988
- }) : (_limitBrands2 = limitBrands(searchResults === null || searchResults === void 0 ? void 0 : searchResults.brands)) === null || _limitBrands2 === void 0 ? void 0 : _limitBrands2.map(function (brand) {
15989
- return /*#__PURE__*/React__default.createElement("a", {
15990
- key: brand.link,
15991
- href: brand.link,
15992
- className: "search-results__item",
15993
- onClick: function onClick() {
15994
- if (typeof onBrandSearchResultClick === 'function') {
15995
- onBrandSearchResultClick({
15996
- brand_name: brand.name,
15997
- brand_link: brand.link,
15998
- search_string: searchValue,
15999
- is_trending: false
16000
- });
16001
- }
16002
- }
16003
- }, brand.name);
16004
- }))), /*#__PURE__*/React__default.createElement("div", {
16071
+ }, renderBrandsList())), /*#__PURE__*/React__default.createElement("div", {
16005
16072
  className: "search-results__section"
16006
16073
  }, /*#__PURE__*/React__default.createElement("div", {
16007
16074
  className: "search-results__section-header"
@@ -16015,7 +16082,7 @@
16015
16082
  }
16016
16083
  }, "View all items")), /*#__PURE__*/React__default.createElement("div", {
16017
16084
  className: "search-results__product-list"
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", {
16085
+ }, renderProductsList()), /*#__PURE__*/React__default.createElement("button", {
16019
16086
  type: "button",
16020
16087
  className: "search-results__view-all-button",
16021
16088
  onClick: function onClick() {
@@ -16042,7 +16109,7 @@
16042
16109
 
16043
16110
  var searchProductsFilter = function searchProductsFilter(search, limit, currencyCode) {
16044
16111
  return {
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 ",
16112
+ 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 product_slug\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 ",
16046
16113
  variables: {
16047
16114
  search: search,
16048
16115
  limit: limit,
@@ -16138,7 +16205,12 @@
16138
16205
  if (currentSearchRequestToken.current === newSearchToken) {
16139
16206
  var _brandsResponse$data$, _productsResponse$dat, _productsResponse$dat2;
16140
16207
 
16141
- // Extract brands from aggregations
16208
+ // Set loading to false when search completes
16209
+ if (typeof onSearchLoading === 'function') {
16210
+ onSearchLoading(false);
16211
+ } // Extract brands from aggregations
16212
+
16213
+
16142
16214
  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
16215
 
16144
16216
  var productsData = ((_productsResponse$dat = productsResponse.data.data.luxity_products_filter) === null || _productsResponse$dat === void 0 ? void 0 : _productsResponse$dat.data) || [];
@@ -16153,11 +16225,15 @@
16153
16225
  }); // Map products to old structure with prices
16154
16226
 
16155
16227
  var products = productsData.map(function (product) {
16228
+ // Generate product link: /products/{category_type}/{brand_slug}/{product_slug}
16229
+ var categorySlug = product.category_type.toLowerCase().replace(/\s+/g, '-');
16230
+ var brandSlug = product.luxity_brand.slug;
16231
+ var productSlug = product.product_slug;
16232
+ var link = "/products/".concat(categorySlug, "/").concat(brandSlug, "/").concat(productSlug);
16156
16233
  return {
16157
16234
  name: product.product.name,
16158
16235
  brand: product.luxity_brand.name,
16159
- link: "/products/".concat(product.id),
16160
- // Using product ID for link
16236
+ link: link,
16161
16237
  price: product.product.price || 0,
16162
16238
  promotion_price: product.product.promotion_price || null,
16163
16239
  est_retail_price: product.product.est_retail_price || 0,
@@ -16166,9 +16242,9 @@
16166
16242
  featured_image: product.featured_image,
16167
16243
  on_promotion: product.on_promotion || false,
16168
16244
  promotion_discount: product.promotion_discount || 0,
16169
- // Keep new fields for potential future use
16170
16245
  id: product.id,
16171
16246
  category_type: product.category_type,
16247
+ product_slug: product.product_slug,
16172
16248
  luxity_brand: product.luxity_brand
16173
16249
  };
16174
16250
  });
@@ -16197,6 +16273,11 @@
16197
16273
  }
16198
16274
  }).catch(function (error) {
16199
16275
  if (!axios.isCancel(error)) {
16276
+ // Set loading to false when search fails
16277
+ if (typeof onSearchLoading === 'function') {
16278
+ onSearchLoading(false);
16279
+ }
16280
+
16200
16281
  setSearchResults({
16201
16282
  brands: [],
16202
16283
  products: []
@@ -16344,7 +16425,7 @@
16344
16425
  onSearchPreview = _ref.onSearchPreview,
16345
16426
  onProductSearchResultClick = _ref.onProductSearchResultClick,
16346
16427
  onBrandSearchResultClick = _ref.onBrandSearchResultClick,
16347
- onSearchLoading = _ref.onSearchLoading,
16428
+ _onSearchLoading = _ref.onSearchLoading,
16348
16429
  currency = _ref.currency,
16349
16430
  currencySymbol = _ref.currencySymbol,
16350
16431
  currencyOptions = _ref.currencyOptions,
@@ -16374,53 +16455,64 @@
16374
16455
 
16375
16456
  var _useState5 = React.useState(false),
16376
16457
  _useState6 = _slicedToArray(_useState5, 2),
16377
- isSearchFocused = _useState6[0],
16378
- setIsSearchFocused = _useState6[1];
16458
+ searchLoading = _useState6[0],
16459
+ setSearchLoading = _useState6[1];
16460
+
16461
+ var _useState7 = React.useState(false),
16462
+ _useState8 = _slicedToArray(_useState7, 2),
16463
+ isSearchFocused = _useState8[0],
16464
+ setIsSearchFocused = _useState8[1];
16379
16465
 
16380
- var _useState7 = React.useState({
16466
+ var _useState9 = React.useState({
16381
16467
  trending_brands: [],
16382
16468
  latest_products: []
16383
16469
  }),
16384
- _useState8 = _slicedToArray(_useState7, 2),
16385
- initialSearchView = _useState8[0],
16386
- setInitialSearchView = _useState8[1];
16387
-
16388
- var _useState9 = React.useState({}),
16389
16470
  _useState10 = _slicedToArray(_useState9, 2),
16390
- dropdownData = _useState10[0],
16391
- setDropdownData = _useState10[1];
16471
+ initialSearchView = _useState10[0],
16472
+ setInitialSearchView = _useState10[1];
16392
16473
 
16393
- var _useState11 = React.useState(false),
16474
+ var _useState11 = React.useState({}),
16394
16475
  _useState12 = _slicedToArray(_useState11, 2),
16395
- hasError = _useState12[0],
16396
- setHasError = _useState12[1];
16476
+ dropdownData = _useState12[0],
16477
+ setDropdownData = _useState12[1];
16397
16478
 
16398
- var _useState13 = React.useState({
16399
- brands: [],
16400
- products: []
16401
- }),
16479
+ var _useState13 = React.useState(false),
16402
16480
  _useState14 = _slicedToArray(_useState13, 2),
16403
- searchResults = _useState14[0],
16404
- setSearchResults = _useState14[1];
16481
+ hasError = _useState14[0],
16482
+ setHasError = _useState14[1];
16405
16483
 
16406
16484
  var _useState15 = React.useState({
16407
16485
  brands: [],
16408
16486
  products: []
16409
16487
  }),
16410
16488
  _useState16 = _slicedToArray(_useState15, 2),
16411
- cachedResults = _useState16[0],
16412
- setCachedResults = _useState16[1];
16489
+ searchResults = _useState16[0],
16490
+ setSearchResults = _useState16[1];
16413
16491
 
16414
- var _useState17 = React.useState(false),
16492
+ var _useState17 = React.useState({
16493
+ brands: [],
16494
+ products: []
16495
+ }),
16415
16496
  _useState18 = _slicedToArray(_useState17, 2),
16416
- showNoResults = _useState18[0],
16417
- setShowNoResults = _useState18[1];
16497
+ cachedResults = _useState18[0],
16498
+ setCachedResults = _useState18[1];
16499
+
16500
+ var _useState19 = React.useState(false),
16501
+ _useState20 = _slicedToArray(_useState19, 2),
16502
+ showNoResults = _useState20[0],
16503
+ setShowNoResults = _useState20[1];
16418
16504
 
16419
16505
  var searchResultsRef = React.useRef(null);
16420
16506
 
16421
16507
  var _useSearch = useSearch({
16422
16508
  endpoint: endpoint,
16423
- onSearchLoading: onSearchLoading,
16509
+ onSearchLoading: function onSearchLoading(isLoading) {
16510
+ setSearchLoading(isLoading);
16511
+
16512
+ if (typeof _onSearchLoading === 'function') {
16513
+ _onSearchLoading(isLoading);
16514
+ }
16515
+ },
16424
16516
  currency: currency,
16425
16517
  onSearchPreview: onSearchPreview,
16426
16518
  onNoResults: setShowNoResults
@@ -16575,7 +16667,8 @@
16575
16667
  onBrandSearchResultClick: onBrandSearchResultClick,
16576
16668
  onCreateInterests: onCreateInterests,
16577
16669
  noResultsImage: noResultsImage,
16578
- showNoResults: showNoResults
16670
+ showNoResults: showNoResults,
16671
+ isLoading: searchLoading
16579
16672
  }), /*#__PURE__*/React__default.createElement("nav", {
16580
16673
  className: "navbar__nav-links navbar__nav-links--wrap"
16581
16674
  }, renderDropdownLinks(), !!stores.length && /*#__PURE__*/React__default.createElement("li", {
@@ -17272,7 +17365,7 @@
17272
17365
  onSearchPreview = _ref.onSearchPreview,
17273
17366
  onProductSearchResultClick = _ref.onProductSearchResultClick,
17274
17367
  onBrandSearchResultClick = _ref.onBrandSearchResultClick,
17275
- onSearchLoading = _ref.onSearchLoading,
17368
+ _onSearchLoading = _ref.onSearchLoading,
17276
17369
  onLogoutClick = _ref.onLogoutClick,
17277
17370
  onInterestClick = _ref.onInterestClick,
17278
17371
  onAddressClick = _ref.onAddressClick,
@@ -17302,9 +17395,20 @@
17302
17395
  showNoResults = _useState2[0],
17303
17396
  setShowNoResults = _useState2[1];
17304
17397
 
17398
+ var _useState3 = React.useState(false),
17399
+ _useState4 = _slicedToArray(_useState3, 2),
17400
+ searchLoading = _useState4[0],
17401
+ setSearchLoading = _useState4[1];
17402
+
17305
17403
  var _useSearch = useSearch({
17306
17404
  endpoint: endpoint,
17307
- onSearchLoading: onSearchLoading,
17405
+ onSearchLoading: function onSearchLoading(isLoading) {
17406
+ setSearchLoading(isLoading);
17407
+
17408
+ if (typeof _onSearchLoading === 'function') {
17409
+ _onSearchLoading(isLoading);
17410
+ }
17411
+ },
17308
17412
  currency: currency,
17309
17413
  onSearchPreview: onSearchPreview,
17310
17414
  onNoResults: setShowNoResults
@@ -17313,49 +17417,49 @@
17313
17417
  createDebouncedSearch = _useSearch.createDebouncedSearch,
17314
17418
  createImmediateSearch = _useSearch.createImmediateSearch;
17315
17419
 
17316
- var _useState3 = React.useState(''),
17317
- _useState4 = _slicedToArray(_useState3, 2),
17318
- searchValue = _useState4[0],
17319
- setSearchValue = _useState4[1];
17320
-
17321
- var _useState5 = React.useState(false),
17420
+ var _useState5 = React.useState(''),
17322
17421
  _useState6 = _slicedToArray(_useState5, 2),
17323
- showSearchBar = _useState6[0],
17324
- setShowSearchbar = _useState6[1];
17422
+ searchValue = _useState6[0],
17423
+ setSearchValue = _useState6[1];
17325
17424
 
17326
17425
  var _useState7 = React.useState(false),
17327
17426
  _useState8 = _slicedToArray(_useState7, 2),
17328
- showSideNav = _useState8[0],
17329
- setShowSideNav = _useState8[1];
17427
+ showSearchBar = _useState8[0],
17428
+ setShowSearchbar = _useState8[1];
17330
17429
 
17331
- var _useState9 = React.useState({
17332
- brands: [],
17333
- products: []
17334
- }),
17430
+ var _useState9 = React.useState(false),
17335
17431
  _useState10 = _slicedToArray(_useState9, 2),
17336
- searchResults = _useState10[0],
17337
- setSearchResults = _useState10[1];
17432
+ showSideNav = _useState10[0],
17433
+ setShowSideNav = _useState10[1];
17338
17434
 
17339
17435
  var _useState11 = React.useState({
17340
17436
  brands: [],
17341
17437
  products: []
17342
17438
  }),
17343
17439
  _useState12 = _slicedToArray(_useState11, 2),
17344
- cachedResults = _useState12[0],
17345
- setCachedResults = _useState12[1];
17440
+ searchResults = _useState12[0],
17441
+ setSearchResults = _useState12[1];
17346
17442
 
17347
- var _useState13 = React.useState(false),
17443
+ var _useState13 = React.useState({
17444
+ brands: [],
17445
+ products: []
17446
+ }),
17348
17447
  _useState14 = _slicedToArray(_useState13, 2),
17349
- isSearchFocused = _useState14[0],
17350
- setIsSearchFocused = _useState14[1];
17448
+ cachedResults = _useState14[0],
17449
+ setCachedResults = _useState14[1];
17351
17450
 
17352
- var _useState15 = React.useState({
17451
+ var _useState15 = React.useState(false),
17452
+ _useState16 = _slicedToArray(_useState15, 2),
17453
+ isSearchFocused = _useState16[0],
17454
+ setIsSearchFocused = _useState16[1];
17455
+
17456
+ var _useState17 = React.useState({
17353
17457
  trending_brands: [],
17354
17458
  latest_products: []
17355
17459
  }),
17356
- _useState16 = _slicedToArray(_useState15, 2),
17357
- initialSearchView = _useState16[0],
17358
- setInitialSearchView = _useState16[1];
17460
+ _useState18 = _slicedToArray(_useState17, 2),
17461
+ initialSearchView = _useState18[0],
17462
+ setInitialSearchView = _useState18[1];
17359
17463
 
17360
17464
  var searchResultsRef = React.useRef(null);
17361
17465
  var searchInputRef = React.useRef(null);
@@ -17596,7 +17700,8 @@
17596
17700
  onBrandSearchResultClick: onBrandSearchResultClick,
17597
17701
  onCreateInterests: onCreateInterests,
17598
17702
  noResultsImage: noResultsImage,
17599
- showNoResults: showNoResults
17703
+ showNoResults: showNoResults,
17704
+ isLoading: searchLoading
17600
17705
  }))), shop && /*#__PURE__*/React__default.createElement(LuxitySideNav, {
17601
17706
  accordionIcon: accordionIcon,
17602
17707
  logoSrc: logoSrc,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonlineza/luxity-lib",
3
- "version": "2.38.1",
3
+ "version": "2.39.0",
4
4
  "scripts": {
5
5
  "start": "start-storybook -p 9001 -c .storybook -s ./public",
6
6
  "clean": "rimraf ./build/*.*",
package/TestComponent.js DELETED
@@ -1,15 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
3
- typeof define === 'function' && define.amd ? define(['react'], factory) :
4
- (global = global || self, global.TestComponent = factory(global.React));
5
- }(this, (function (React) { 'use strict';
6
-
7
- React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;
8
-
9
- var TestComponent = function TestComponent() {
10
- return /*#__PURE__*/React.createElement("div", null, "TestComponent");
11
- };
12
-
13
- return TestComponent;
14
-
15
- })));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var ReactSelectWrapper_1 = __importDefault(require("../ReactSelectWrapper"));
8
- var responseTransform = function (countryData) {
9
- return countryData.map(function (item) { return ({
10
- label: "".concat(item.code, " (+").concat(item.dial_code, ")"),
11
- value: item.code,
12
- }); });
13
- };
14
- var CountryCodeSelect = function (_a) {
15
- var _b = _a.countryData, countryData = _b === void 0 ? [] : _b, className = _a.className, classNamePrefix = _a.classNamePrefix, _c = _a.defaultCountryCode, defaultCountryCode = _c === void 0 ? 'ZA' : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { return null; } : _d, _e = _a.isSearchable, isSearchable = _e === void 0 ? true : _e, _f = _a.name, name = _f === void 0 ? 'country_code' : _f, _g = _a.renderNoData, renderNoData = _g === void 0 ? function () { return 'Loading...'; } : _g;
16
- return (react_1.default.createElement(react_1.default.Fragment, null, countryData && countryData.length ? (react_1.default.createElement(ReactSelectWrapper_1.default, { name: name, className: className, classNamePrefix: classNamePrefix, options: responseTransform(countryData), defaultValue: responseTransform(countryData.filter(function (item) { return item.code === defaultCountryCode; })), onChange: onChange, isSearchable: isSearchable })) : (renderNoData())));
17
- };
18
- exports.default = CountryCodeSelect;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var react_select_1 = __importDefault(require("react-select"));
30
- var ReactSelectWrapper = function (_a) {
31
- var _b = _a.isMulti, isMulti = _b === void 0 ? false : _b, _c = _a.isSearchable, isSearchable = _c === void 0 ? false : _c, _d = _a.components, components = _d === void 0 ? { IndicatorSeparator: function () { return null; } } : _d, _e = _a.options, options = _e === void 0 ? [] : _e, _f = _a.className, className = _f === void 0 ? 'dropdown-select-container' : _f, _g = _a.classNamePrefix, classNamePrefix = _g === void 0 ? 'dropdown-select' : _g, _h = _a.onChange, onChange = _h === void 0 ? function () { return null; } : _h, name = _a.name, _j = _a.noOptionsMessage, noOptionsMessage = _j === void 0 ? function () { return 'No Options'; } : _j, rest = __rest(_a, ["isMulti", "isSearchable", "components", "options", "className", "classNamePrefix", "onChange", "name", "noOptionsMessage"]);
32
- return (react_1.default.createElement(react_select_1.default, __assign({ isMulti: isMulti, isSearchable: isSearchable, components: components, options: options, className: className, classNamePrefix: classNamePrefix, onChange: onChange, name: name, noOptionsMessage: noOptionsMessage }, rest)));
33
- };
34
- exports.default = ReactSelectWrapper;
package/postcss.config.js DELETED
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- };