@trafilea/afrodita-components 6.59.0 → 6.59.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/index.d.ts CHANGED
@@ -2498,6 +2498,7 @@ interface ProductItemProps {
2498
2498
  image: ImageProps;
2499
2499
  price: Pick<PriceLabelProps, 'finalPrice' | 'originalPrice' | 'color'>;
2500
2500
  rating: Pick<RatingProps, 'rating' | 'reviews'>;
2501
+ hideRating?: boolean;
2501
2502
  tags?: {
2502
2503
  categoryTagText?: string;
2503
2504
  seasonOfferTagText?: string;
@@ -2826,7 +2827,7 @@ interface ProductItemSmallMobileProps extends ProductItemProps {
2826
2827
  bottomTag?: JSX.Element;
2827
2828
  onClick?: () => void;
2828
2829
  onClickBottomButton?: (e: MouseEvent$1<HTMLDivElement, MouseEvent>) => void;
2829
- priceDisplayType?: 'default' | 'styled' | 'styled-2';
2830
+ priceDisplayType?: 'default' | 'styled' | 'styled-2' | 'hidden';
2830
2831
  priceAtBottom?: boolean;
2831
2832
  ratingOnTop?: boolean;
2832
2833
  priceLoading?: boolean;
@@ -7624,11 +7624,11 @@ var templateObject_1$1G, templateObject_2$1k, templateObject_3$16, templateObjec
7624
7624
 
7625
7625
  var ProductItemMobile = function (_a) {
7626
7626
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
7627
- var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, size = _a.size, _o = _a.alignName, alignName = _o === void 0 ? 'center' : _o, url = _a.url, className = _a.className, topTag = _a.topTag, bottomTag = _a.bottomTag, onClick = _a.onClick, _p = _a.priceDisplayType, priceDisplayType = _p === void 0 ? 'default' : _p, priceAtBottom = _a.priceAtBottom, ratingOnTop = _a.ratingOnTop, priceLoading = _a.priceLoading, _q = _a.noFollow, noFollow = _q === void 0 ? false : _q, _r = _a.colorPicker, colorPicker = _r === void 0 ? {
7627
+ var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, _o = _a.hideRating, hideRating = _o === void 0 ? false : _o, size = _a.size, _p = _a.alignName, alignName = _p === void 0 ? 'center' : _p, url = _a.url, className = _a.className, topTag = _a.topTag, bottomTag = _a.bottomTag, onClick = _a.onClick, _q = _a.priceDisplayType, priceDisplayType = _q === void 0 ? 'default' : _q, priceAtBottom = _a.priceAtBottom, ratingOnTop = _a.ratingOnTop, priceLoading = _a.priceLoading, _r = _a.noFollow, noFollow = _r === void 0 ? false : _r, _s = _a.colorPicker, colorPicker = _s === void 0 ? {
7628
7628
  display: false,
7629
7629
  position: 'top',
7630
7630
  component: undefined,
7631
- } : _r, _s = _a.isBNPL, isBNPL = _s === void 0 ? {
7631
+ } : _s, _t = _a.isBNPL, isBNPL = _t === void 0 ? {
7632
7632
  displayBNPL: false,
7633
7633
  installments: 4,
7634
7634
  installmentPrice: '',
@@ -7637,10 +7637,10 @@ var ProductItemMobile = function (_a) {
7637
7637
  showLogo: true,
7638
7638
  iconColor: '#292929',
7639
7639
  fontSize: '12px',
7640
- } : _s, _t = _a.hasStrength, hasStrength = _t === void 0 ? {
7640
+ } : _t, _u = _a.hasStrength, hasStrength = _u === void 0 ? {
7641
7641
  strength: -1,
7642
7642
  description: '',
7643
- } : _t, _u = _a.clubPrice, clubPrice = _u === void 0 ? '' : _u, _v = _a.showClubPriceLabel, showClubPriceLabel = _v === void 0 ? false : _v, isRatingLoading = _a.isRatingLoading, _w = _a.version, version = _w === void 0 ? 1 : _w, _x = _a.showDiscountPercentageTag, showDiscountPercentageTag = _x === void 0 ? false : _x, discountTagLoading = _a.discountTagLoading, discountTag = _a.discountTag, _y = _a.isOnViewport, isOnViewport = _y === void 0 ? false : _y, _z = _a.hasDefaultSize, hasDefaultSize = _z === void 0 ? false : _z, clubOffer = _a.clubOffer, likeBtn = _a.likeBtn, onClickBottomButton = _a.onClickBottomButton, _0 = _a.showDecimals, showDecimals = _0 === void 0 ? true : _0, _1 = _a.showDivider, showDivider = _1 === void 0 ? false : _1, _2 = _a.invertPriceDirection, invertPriceDirection = _2 === void 0 ? false : _2, _3 = _a.priceAndReviewInOneLine, priceAndReviewInOneLine = _3 === void 0 ? false : _3;
7643
+ } : _u, _v = _a.clubPrice, clubPrice = _v === void 0 ? '' : _v, _w = _a.showClubPriceLabel, showClubPriceLabel = _w === void 0 ? false : _w, isRatingLoading = _a.isRatingLoading, _x = _a.version, version = _x === void 0 ? 1 : _x, _y = _a.showDiscountPercentageTag, showDiscountPercentageTag = _y === void 0 ? false : _y, discountTagLoading = _a.discountTagLoading, discountTag = _a.discountTag, _z = _a.isOnViewport, isOnViewport = _z === void 0 ? false : _z, _0 = _a.hasDefaultSize, hasDefaultSize = _0 === void 0 ? false : _0, clubOffer = _a.clubOffer, likeBtn = _a.likeBtn, onClickBottomButton = _a.onClickBottomButton, _1 = _a.showDecimals, showDecimals = _1 === void 0 ? true : _1, _2 = _a.showDivider, showDivider = _2 === void 0 ? false : _2, _3 = _a.invertPriceDirection, invertPriceDirection = _3 === void 0 ? false : _3, _4 = _a.priceAndReviewInOneLine, priceAndReviewInOneLine = _4 === void 0 ? false : _4;
7644
7644
  var theme = useTheme();
7645
7645
  var styles = getStylesBySize$b(size);
7646
7646
  var isMobile = useWindowDimensions().isMobile;
@@ -7655,6 +7655,8 @@ var ProductItemMobile = function (_a) {
7655
7655
  var PriceLabelDisplay = function (labelVersion) {
7656
7656
  var _a, _b, _c, _d, _e, _f;
7657
7657
  if (labelVersion === void 0) { labelVersion = version; }
7658
+ if (priceDisplayType === 'hidden')
7659
+ return null;
7658
7660
  switch (labelVersion) {
7659
7661
  case 4:
7660
7662
  return priceDisplayType === 'styled' ? (jsx(PriceLabelV4, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Medium, testId: "volume-discount-v4", clubStyle: showClubPriceLabel, clubPrice: clubPrice, styledPrice: true, finalPriceStyle: showClubPriceLabel
@@ -7693,16 +7695,16 @@ var ProductItemMobile = function (_a) {
7693
7695
  }
7694
7696
  };
7695
7697
  var RatingDisplay = function () {
7698
+ if (hideRating || (!rating.reviews && !rating.rating)) {
7699
+ return jsx(Fragment, {}, void 0);
7700
+ }
7696
7701
  if (isRatingLoading) {
7697
7702
  return jsx(SkeletonBox, { height: "20px", width: "80px" }, void 0);
7698
7703
  }
7699
- if (!rating.reviews && !rating.rating) {
7700
- return jsx(Fragment, {}, void 0);
7701
- }
7702
7704
  return (jsx(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating === null || rating === void 0 ? void 0 : rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
7703
7705
  };
7704
- var _4 = useState((_b = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.isLiked) !== null && _b !== void 0 ? _b : false), isLiked = _4[0], setIsLiked = _4[1];
7705
- var _5 = useState((_c = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.likes) !== null && _c !== void 0 ? _c : 0), likesCount = _5[0], setLikesCount = _5[1];
7706
+ var _5 = useState((_b = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.isLiked) !== null && _b !== void 0 ? _b : false), isLiked = _5[0], setIsLiked = _5[1];
7707
+ var _6 = useState((_c = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.likes) !== null && _c !== void 0 ? _c : 0), likesCount = _6[0], setLikesCount = _6[1];
7706
7708
  var handleLikeClick = function (e) {
7707
7709
  e.stopPropagation();
7708
7710
  if (isLiked) {