@trafilea/afrodita-components 6.41.2 → 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.
- package/build/index.d.ts +1 -1
- package/build/index.esm.js +20 -18
- package/build/index.esm.js.map +1 -1
- package/build/index.js +20 -18
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -7057,7 +7057,7 @@ var LikeCount = newStyled.span(templateObject_1$1v || (templateObject_1$1v = __m
|
|
|
7057
7057
|
var theme = _a.theme;
|
|
7058
7058
|
return theme.colors.shades.black.color;
|
|
7059
7059
|
});
|
|
7060
|
-
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
|
|
7060
|
+
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) {
|
|
7061
7061
|
var _b = _a.position, position = _b === void 0 ? 'absolute' : _b;
|
|
7062
7062
|
return position;
|
|
7063
7063
|
}, function (_a) {
|
|
@@ -7075,9 +7075,6 @@ var LikeBtnContainer = newStyled.button(templateObject_2$19 || (templateObject_2
|
|
|
7075
7075
|
}, function (_a) {
|
|
7076
7076
|
var _b = _a.boxSizing, boxSizing = _b === void 0 ? 'border-box' : _b;
|
|
7077
7077
|
return boxSizing;
|
|
7078
|
-
}, function (_a) {
|
|
7079
|
-
var theme = _a.theme;
|
|
7080
|
-
return theme.colors.shades.white.color;
|
|
7081
7078
|
});
|
|
7082
7079
|
var templateObject_1$1v, templateObject_2$19;
|
|
7083
7080
|
|
|
@@ -7153,7 +7150,7 @@ var LikeButton = function (_a) {
|
|
|
7153
7150
|
regular: theme.colors.shades.black.color,
|
|
7154
7151
|
solid: theme.colors.semantic.urgent.color,
|
|
7155
7152
|
} : _e, background = _d.background;
|
|
7156
|
-
return (jsxRuntime.jsx(LikeBtnContainer, __assign$1({ className: className }, containerProps, { children: jsxRuntime.jsxs(IconButton, __assign$1({ onClick: onClick, backgroundColor: background, hasText: !!likes, boxShadow: "0 6px 16px rgba(0, 0, 0, 0.12)" }, { children: [jsxRuntime.jsx(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" },
|
|
7153
|
+
return (jsxRuntime.jsx(LikeBtnContainer, __assign$1({ className: className }, containerProps, { children: jsxRuntime.jsxs(IconButton, __assign$1({ onClick: onClick, backgroundColor: background, hasText: !!likes, boxShadow: "0 6px 16px rgba(0, 0, 0, 0.12)" }, { children: [jsxRuntime.jsx(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 && jsxRuntime.jsx(LikeCount, __assign$1({ className: "like-count" }, { children: likes }), void 0)] }), isLiked.toString()) }), void 0));
|
|
7157
7154
|
};
|
|
7158
7155
|
|
|
7159
7156
|
var STYLES_BY_THEME = {
|
|
@@ -7294,12 +7291,12 @@ var ClubOfferPriceLabelWrapper = newStyled.div(templateObject_8$l || (templateOb
|
|
|
7294
7291
|
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;
|
|
7295
7292
|
|
|
7296
7293
|
var ProductItemMobile = function (_a) {
|
|
7297
|
-
var _b, _c;
|
|
7298
|
-
var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, size = _a.size,
|
|
7294
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
7295
|
+
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 ? {
|
|
7299
7296
|
display: false,
|
|
7300
7297
|
position: 'top',
|
|
7301
7298
|
component: undefined,
|
|
7302
|
-
} :
|
|
7299
|
+
} : _r, _s = _a.isBNPL, isBNPL = _s === void 0 ? {
|
|
7303
7300
|
displayBNPL: false,
|
|
7304
7301
|
installments: 4,
|
|
7305
7302
|
installmentPrice: '',
|
|
@@ -7308,10 +7305,10 @@ var ProductItemMobile = function (_a) {
|
|
|
7308
7305
|
showLogo: true,
|
|
7309
7306
|
iconColor: '#292929',
|
|
7310
7307
|
fontSize: '12px',
|
|
7311
|
-
} :
|
|
7308
|
+
} : _s, _t = _a.hasStrength, hasStrength = _t === void 0 ? {
|
|
7312
7309
|
strength: -1,
|
|
7313
7310
|
description: '',
|
|
7314
|
-
} :
|
|
7311
|
+
} : _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;
|
|
7315
7312
|
var theme = useTheme();
|
|
7316
7313
|
var styles = getStylesBySize$b(size);
|
|
7317
7314
|
var isMobile = useWindowDimensions().isMobile;
|
|
@@ -7354,8 +7351,8 @@ var ProductItemMobile = function (_a) {
|
|
|
7354
7351
|
return jsx(Fragment, {}, void 0);
|
|
7355
7352
|
return (jsx(Rating, { size: size === exports.ComponentSize.Large ? exports.ComponentSize.Small : exports.ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
|
|
7356
7353
|
};
|
|
7357
|
-
var
|
|
7358
|
-
var
|
|
7354
|
+
var _0 = React$2.useState((_b = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.isLiked) !== null && _b !== void 0 ? _b : false), isLiked = _0[0], setIsLiked = _0[1];
|
|
7355
|
+
var _1 = React$2.useState((_c = likeBtn === null || likeBtn === void 0 ? void 0 : likeBtn.likes) !== null && _c !== void 0 ? _c : 0), likesCount = _1[0], setLikesCount = _1[1];
|
|
7359
7356
|
var handleLikeClick = function (e) {
|
|
7360
7357
|
e.stopPropagation();
|
|
7361
7358
|
if (isLiked) {
|
|
@@ -7369,7 +7366,8 @@ var ProductItemMobile = function (_a) {
|
|
|
7369
7366
|
};
|
|
7370
7367
|
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: {
|
|
7371
7368
|
background: {
|
|
7372
|
-
active: theme.colors.shades.white.color,
|
|
7369
|
+
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,
|
|
7370
|
+
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,
|
|
7373
7371
|
},
|
|
7374
7372
|
} }, 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: exports.ComponentSize.Small }, { children: discountTag && (jsx(DiscountTag$3, __assign$1({}, discountTag, { size: exports.ComponentSize.Medium, style: {
|
|
7375
7373
|
letterSpacing: '-0.05rem',
|
|
@@ -7755,9 +7753,11 @@ var ButtonPrimary = function (_a) {
|
|
|
7755
7753
|
letterSpacing: theme.component.button.letterSpacing,
|
|
7756
7754
|
minWidth: theme.component.button.minWidth,
|
|
7757
7755
|
minHeight: theme.component.button.minHeight,
|
|
7758
|
-
'
|
|
7759
|
-
|
|
7760
|
-
|
|
7756
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
7757
|
+
'&:hover': {
|
|
7758
|
+
backgroundColor: theme.component.button.primary.hover.backgroundColor,
|
|
7759
|
+
color: theme.component.button.primary.hover.color,
|
|
7760
|
+
},
|
|
7761
7761
|
},
|
|
7762
7762
|
'&:disabled': {
|
|
7763
7763
|
backgroundColor: theme.colors.background.disabled,
|
|
@@ -7773,8 +7773,10 @@ var ButtonSecondary = function (props) {
|
|
|
7773
7773
|
color: theme.component.button.secondary.active.color,
|
|
7774
7774
|
border: theme.component.button.border,
|
|
7775
7775
|
fontFamily: 'inherit',
|
|
7776
|
-
'
|
|
7777
|
-
|
|
7776
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
7777
|
+
'&:hover': {
|
|
7778
|
+
backgroundColor: theme.component.button.secondary.hover.backgroundColor,
|
|
7779
|
+
},
|
|
7778
7780
|
},
|
|
7779
7781
|
'&:disabled': {
|
|
7780
7782
|
backgroundColor: theme.colors.shades['50'].color,
|