@trafilea/afrodita-components 6.42.0 → 6.42.2

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.
@@ -7031,7 +7031,7 @@ var LikeCount = newStyled.span(templateObject_1$1v || (templateObject_1$1v = __m
7031
7031
  var theme = _a.theme;
7032
7032
  return theme.colors.shades.black.color;
7033
7033
  });
7034
- var LikeBtnContainer = newStyled.button(templateObject_2$19 || (templateObject_2$19 = __makeTemplateObject(["\n position: ", ";\n top: ", ";\n right: ", ";\n z-index: ", ";\n padding: ", ";\n box-sizing: ", ";\n background-color: transparent;\n border: none;\n\n &:hover {\n .like-count {\n color: ", ";\n }\n }\n"], ["\n position: ", ";\n top: ", ";\n right: ", ";\n z-index: ", ";\n padding: ", ";\n box-sizing: ", ";\n background-color: transparent;\n border: none;\n\n &:hover {\n .like-count {\n color: ", ";\n }\n }\n"])), function (_a) {
7034
+ var LikeBtnContainer = newStyled.button(templateObject_2$19 || (templateObject_2$19 = __makeTemplateObject(["\n position: ", ";\n top: ", ";\n right: ", ";\n z-index: ", ";\n padding: ", ";\n box-sizing: ", ";\n background-color: transparent;\n border: none;\n"], ["\n position: ", ";\n top: ", ";\n right: ", ";\n z-index: ", ";\n padding: ", ";\n box-sizing: ", ";\n background-color: transparent;\n border: none;\n"])), function (_a) {
7035
7035
  var _b = _a.position, position = _b === void 0 ? 'absolute' : _b;
7036
7036
  return position;
7037
7037
  }, function (_a) {
@@ -7049,9 +7049,6 @@ var LikeBtnContainer = newStyled.button(templateObject_2$19 || (templateObject_2
7049
7049
  }, function (_a) {
7050
7050
  var _b = _a.boxSizing, boxSizing = _b === void 0 ? 'border-box' : _b;
7051
7051
  return boxSizing;
7052
- }, function (_a) {
7053
- var theme = _a.theme;
7054
- return theme.colors.shades.white.color;
7055
7052
  });
7056
7053
  var templateObject_1$1v, templateObject_2$19;
7057
7054
 
@@ -7127,7 +7124,7 @@ var LikeButton = function (_a) {
7127
7124
  regular: theme.colors.shades.black.color,
7128
7125
  solid: theme.colors.semantic.urgent.color,
7129
7126
  } : _e, background = _d.background;
7130
- return (jsx$1(LikeBtnContainer, __assign$1({ className: className }, containerProps, { children: jsxs$1(IconButton, __assign$1({ onClick: onClick, backgroundColor: background, hasText: !!likes, boxShadow: "0 6px 16px rgba(0, 0, 0, 0.12)" }, { children: [jsx$1(Icon$1, { name: isLiked ? 'actions/like_solid' : 'actions/like', fill: isLiked ? iconFill.solid : (_b = iconFill.regular) !== null && _b !== void 0 ? _b : iconFill.solid, width: "24px", height: "24px" }, isLiked.toString()), !!likes && jsx$1(LikeCount, __assign$1({ className: "like-count" }, { children: likes }), void 0)] }), void 0) }), void 0));
7127
+ return (jsx$1(LikeBtnContainer, __assign$1({ className: className }, containerProps, { children: jsxs$1(IconButton, __assign$1({ onClick: onClick, backgroundColor: background, hasText: !!likes, boxShadow: "0 6px 16px rgba(0, 0, 0, 0.12)" }, { children: [jsx$1(Icon$1, { name: isLiked ? 'actions/like_solid' : 'actions/like', fill: isLiked ? iconFill.solid : (_b = iconFill.regular) !== null && _b !== void 0 ? _b : iconFill.solid, width: "24px", height: "24px" }, void 0), !!likes && jsx$1(LikeCount, __assign$1({ className: "like-count" }, { children: likes }), void 0)] }), isLiked.toString()) }), void 0));
7131
7128
  };
7132
7129
 
7133
7130
  var STYLES_BY_THEME = {
@@ -7268,12 +7265,12 @@ var ClubOfferPriceLabelWrapper = newStyled.div(templateObject_8$l || (templateOb
7268
7265
  var templateObject_1$1t, templateObject_2$18, templateObject_3$X, templateObject_4$L, templateObject_5$C, templateObject_6$y, templateObject_7$s, templateObject_8$l;
7269
7266
 
7270
7267
  var ProductItemMobile = function (_a) {
7271
- var _b, _c;
7272
- var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, size = _a.size, _d = _a.alignName, alignName = _d === void 0 ? 'center' : _d, url = _a.url, className = _a.className, topTag = _a.topTag, bottomTag = _a.bottomTag, onClick = _a.onClick, _e = _a.priceDisplayType, priceDisplayType = _e === void 0 ? 'default' : _e, priceAtBottom = _a.priceAtBottom, ratingOnTop = _a.ratingOnTop, priceLoading = _a.priceLoading, _f = _a.noFollow, noFollow = _f === void 0 ? false : _f, _g = _a.colorPicker, colorPicker = _g === void 0 ? {
7268
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
7269
+ 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 ? {
7273
7270
  display: false,
7274
7271
  position: 'top',
7275
7272
  component: undefined,
7276
- } : _g, _h = _a.isBNPL, isBNPL = _h === void 0 ? {
7273
+ } : _r, _s = _a.isBNPL, isBNPL = _s === void 0 ? {
7277
7274
  displayBNPL: false,
7278
7275
  installments: 4,
7279
7276
  installmentPrice: '',
@@ -7282,10 +7279,10 @@ var ProductItemMobile = function (_a) {
7282
7279
  showLogo: true,
7283
7280
  iconColor: '#292929',
7284
7281
  fontSize: '12px',
7285
- } : _h, _j = _a.hasStrength, hasStrength = _j === void 0 ? {
7282
+ } : _s, _t = _a.hasStrength, hasStrength = _t === void 0 ? {
7286
7283
  strength: -1,
7287
7284
  description: '',
7288
- } : _j, _k = _a.clubPrice, clubPrice = _k === void 0 ? '' : _k, _l = _a.showClubPriceLabel, showClubPriceLabel = _l === void 0 ? false : _l, isRatingLoading = _a.isRatingLoading, _m = _a.version, version = _m === void 0 ? 1 : _m, _o = _a.showDiscountPercentageTag, showDiscountPercentageTag = _o === void 0 ? false : _o, discountTagLoading = _a.discountTagLoading, discountTag = _a.discountTag, _p = _a.isOnViewport, isOnViewport = _p === void 0 ? false : _p, _q = _a.hasDefaultSize, hasDefaultSize = _q === void 0 ? false : _q, clubOffer = _a.clubOffer, likeBtn = _a.likeBtn, onClickBottomButton = _a.onClickBottomButton;
7285
+ } : _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;
7289
7286
  var theme = useTheme();
7290
7287
  var styles = getStylesBySize$b(size);
7291
7288
  var isMobile = useWindowDimensions().isMobile;
@@ -7328,8 +7325,8 @@ var ProductItemMobile = function (_a) {
7328
7325
  return jsx(Fragment, {}, void 0);
7329
7326
  return (jsx(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
7330
7327
  };
7331
- var _r = useState((_b = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.isLiked) !== null && _b !== void 0 ? _b : false), isLiked = _r[0], setIsLiked = _r[1];
7332
- var _s = useState((_c = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.likes) !== null && _c !== void 0 ? _c : 0), likesCount = _s[0], setLikesCount = _s[1];
7328
+ var _0 = useState((_b = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.isLiked) !== null && _b !== void 0 ? _b : false), isLiked = _0[0], setIsLiked = _0[1];
7329
+ var _1 = useState((_c = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.likes) !== null && _c !== void 0 ? _c : 0), likesCount = _1[0], setLikesCount = _1[1];
7333
7330
  var handleLikeClick = function (e) {
7334
7331
  e.stopPropagation();
7335
7332
  if (isLiked) {
@@ -7343,7 +7340,8 @@ var ProductItemMobile = function (_a) {
7343
7340
  };
7344
7341
  return (jsxs(ProdCardContainer$4, __assign$1({ className: className, "data-testid": "product-card-container-div" }, { children: [jsxs(Container$10, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', className: "picContainer", onClick: onClick }, { children: [!!likeBtn && (jsx(LikeButton, { isLiked: isLiked, likes: likesCount, onClick: handleLikeClick, colors: {
7345
7342
  background: {
7346
- active: theme.colors.shades.white.color,
7343
+ active: (_f = (_e = (_d = likeBtn.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e.active) !== null && _f !== void 0 ? _f : theme.colors.shades.white.color,
7344
+ hover: (_m = (_j = (_h = (_g = likeBtn.colors) === null || _g === void 0 ? void 0 : _g.background) === null || _h === void 0 ? void 0 : _h.hover) !== null && _j !== void 0 ? _j : (_l = (_k = likeBtn.colors) === null || _k === void 0 ? void 0 : _k.background) === null || _l === void 0 ? void 0 : _l.active) !== null && _m !== void 0 ? _m : theme.colors.shades.white.color,
7347
7345
  },
7348
7346
  } }, void 0)), !!topTag || !!bottomTag ? (jsxs(ImageContainer$6, __assign$1({ width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height, "data-testid": "tags-image-container" }, { children: [jsx(Image$3, { src: image.src, srcSet: getSrcSet(image.src, 180, 360, 720, 960), alt: image.alt, width: hasDefaultSize ? styles === null || styles === void 0 ? void 0 : styles.width : '100%', height: hasDefaultSize ? styles === null || styles === void 0 ? void 0 : styles.height : '100%', loading: isOnViewport ? 'eager' : 'lazy', decoding: isOnViewport ? 'sync' : 'async', borderRadius: STYLES_BY_THEME[theme.name].image.borderRadius }, void 0), jsx(TopTagContainer$9, __assign$1({ style: { width: colorPicker.display ? '100%' : 'inherit' } }, { children: topTag }), void 0), jsx(BottomTagContainer$9, __assign$1({ style: { width: colorPicker.display ? '100%' : 'inherit' } }, { children: bottomTag }), void 0)] }), void 0)) : (jsx(Image$3, { src: image.src, srcSet: getSrcSet(image.src, 180, 360, 720, 960), alt: image.alt, width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height, loading: isOnViewport ? 'eager' : 'lazy', decoding: isOnViewport ? 'sync' : 'async', borderRadius: STYLES_BY_THEME[theme.name].image.borderRadius }, void 0)), imageHover ? (jsx(ImageHoverContainer$3, { className: "hover__image", src: imageHover.src, srcSet: getSrcSet(imageHover.src, 180, 360, 720, 960), loading: "lazy", decoding: "async", alt: imageHover.alt, width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height }, void 0)) : null] }), void 0), colorPicker.display && colorPicker.position === 'top' && (jsxs(Fragment, { children: [jsx(Spacing, { size: space }, void 0), colorPicker.component] }, void 0)), ratingOnTop && (jsxs(Fragment, { children: [jsx(Spacing, { size: space }, void 0), jsx(Spacing, { size: space }, void 0), jsx(RatingDisplay, {}, void 0)] }, void 0)), jsxs(Container$10, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', onClick: onClick, className: "textContainer", style: { alignItems: showClubPriceLabel ? 'flex-start' : 'center' } }, { children: [jsx(Spacing, { size: space }, void 0), jsx(Title$8, __assign$1({ theme: theme, align: showClubPriceLabel ? 'left' : alignName, "data-testid": "product-card-title" }, { children: title }), void 0), jsx(Spacing, { size: space }, void 0), hasStrength && hasStrength.strength !== -1 && (jsxs(Fragment, { children: [jsx(StrengthBars, { barsFilled: hasStrength.strength, supportText: hasStrength.description }, void 0), jsx(Spacing, { size: 10 }, void 0)] }, void 0)), priceAtBottom && !ratingOnTop ? (jsxs(Fragment, { children: [jsx(RatingDisplay, {}, void 0), jsx(Spacing, { size: space }, void 0), jsxs(MarginTopContainer$1, __assign$1({ style: { marginTop: (clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.isClubOffer) ? 0 : 8 } }, { children: [priceLoading ? jsx(SkeletonBox, { height: "20px", width: "140px" }, void 0) : PriceLabelDisplay(), (clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.isClubOffer) && PriceLabelDisplay(5)] }), void 0)] }, void 0)) : (jsxs(Fragment, { children: [priceLoading ? (jsx(SkeletonBox, { height: "20px", width: "140px" }, void 0)) : (jsxs(Fragment, { children: [!(clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.isClubMember) && PriceLabelDisplay(), (clubOffer === null || clubOffer === void 0 ? void 0 : clubOffer.isClubOffer) && PriceLabelDisplay(5), jsx(BuyNowPayLater, { displayBNPL: isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.displayBNPL, installments: (isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.installments) || 0, installmentPrice: (isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.installmentPrice) || '', iconFolder: isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.iconFolder, iconName: (isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.iconName) || '', showLogo: isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.showLogo, iconColor: isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.iconColor, fontSize: isBNPL === null || isBNPL === void 0 ? void 0 : isBNPL.fontSize }, void 0)] }, void 0)), showClubPriceLabel && jsx(ClubPriceLabel, { clubPrice: clubPrice }, void 0), discountTagLoading ? (jsx(SkeletonBox, { height: "22px", width: "75px" }, void 0)) : (showDiscountPercentageTag && (jsx(TagContainer, __assign$1({ size: ComponentSize.Small }, { children: discountTag && (jsx(DiscountTag$3, __assign$1({}, discountTag, { size: ComponentSize.Medium, style: {
7349
7347
  letterSpacing: '-0.05rem',
@@ -7729,9 +7727,11 @@ var ButtonPrimary = function (_a) {
7729
7727
  letterSpacing: theme.component.button.letterSpacing,
7730
7728
  minWidth: theme.component.button.minWidth,
7731
7729
  minHeight: theme.component.button.minHeight,
7732
- '&:hover': {
7733
- backgroundColor: theme.component.button.primary.hover.backgroundColor,
7734
- color: theme.component.button.primary.hover.color,
7730
+ '@media (hover: hover) and (pointer: fine)': {
7731
+ '&:hover': {
7732
+ backgroundColor: theme.component.button.primary.hover.backgroundColor,
7733
+ color: theme.component.button.primary.hover.color,
7734
+ },
7735
7735
  },
7736
7736
  '&:disabled': {
7737
7737
  backgroundColor: theme.colors.background.disabled,
@@ -7747,8 +7747,10 @@ var ButtonSecondary = function (props) {
7747
7747
  color: theme.component.button.secondary.active.color,
7748
7748
  border: theme.component.button.border,
7749
7749
  fontFamily: 'inherit',
7750
- '&:hover': {
7751
- backgroundColor: theme.component.button.secondary.hover.backgroundColor,
7750
+ '@media (hover: hover) and (pointer: fine)': {
7751
+ '&:hover': {
7752
+ backgroundColor: theme.component.button.secondary.hover.backgroundColor,
7753
+ },
7752
7754
  },
7753
7755
  '&:disabled': {
7754
7756
  backgroundColor: theme.colors.shades['50'].color,