@trafilea/afrodita-components 6.28.3 → 6.28.5
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 +2 -1
- package/build/index.esm.js +20 -20
- package/build/index.js +20 -20
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ declare type MyAccount$1 = 'myaccount/birthday_gifts' | 'myaccount/community' |
|
|
|
137
137
|
declare type Navigation$1 = 'navigation/address_information' | 'navigation/benefits' | 'navigation/club_membership' | 'navigation/ellipsis' | 'navigation/ellipsis_horizontal' | 'navigation/filters' | 'navigation/hamburger' | 'navigation/home' | 'navigation/home_solid' | 'navigation/loading' | 'navigation/lock' | 'navigation/lock_solid' | 'navigation/map_marker' | 'navigation/map_marker_light' | 'navigation/map_solid' | 'navigation/menu_lines' | 'navigation/search' | 'navigation/shaperbox' | 'navigation/shopping_bag' | 'navigation/shopping_bag_v2' | 'navigation/shopping_bag_v3' | 'navigation/shopping_bag_v4' | 'navigation/shopping_cart' | 'navigation/shopping_cart_v2' | 'navigation/slide_dot' | 'navigation/slide_dot_solid' | 'navigation/user' | 'navigation/address_information_light' | 'navigation/user_solid' | 'navigation/user_v2' | 'navigation/filters_v2' | 'navigation/gift';
|
|
138
138
|
declare type Other$1 = 'other/bod_con_label' | 'other/bod_con_mobile_label' | 'other/call_us' | 'other/chat' | 'other/email' | 'other/express_shipping' | 'other/fit_guarantee' | 'other/fit_predictor' | 'other/free_exchange' | 'other/get_discount' | 'other/hassel_free_returns' | 'other/loading' | 'other/mc_afee' | 'other/play' | 'other/qr_code' | 'other/question_with_circle' | 'other/revel_beauty' | 'other/shapermint' | 'other/shapermint_club_icon' | 'other/shapermint_club_icon2' | 'other/shapermint_club_label' | 'other/shapermint_club_mobile_label' | 'other/shapermint_logo' | 'other/shm_club' | 'other/shop_now' | 'other/sign_form' | 'other/sixty_days_tsd' | 'other/the_bod_con' | 'other/the_spa_dr' | 'other/lock' | 'other/help_center' | 'other/coupons';
|
|
139
139
|
declare type Payment$1 = 'payment/amazon' | 'payment/amex' | 'payment/jcb' | 'payment/klarna' | 'payment/master_card' | 'payment/paypal' | 'payment/visa' | 'payment/payment_methods';
|
|
140
|
-
declare type PDP$1 = 'pdp/circle_number' | 'pdp/clock' | 'pdp/drop' | 'pdp/drop_empty' | 'pdp/error_cross' | 'pdp/flag_usa' | 'pdp/hours' | 'pdp/klarna_logo' | 'pdp/light_bulb' | 'pdp/free_returns_v2' | 'pdp/free_shipping_v2' | 'pdp/minus' | 'pdp/moon' | 'pdp/new_clock' | 'pdp/play_mini' | 'pdp/play_video' | 'pdp/plus' | 'pdp/rule' | 'pdp/shipping' | 'pdp/shipping_empty' | 'pdp/size_empty' | 'pdp/size_empty_v2' | 'pdp/star' | 'pdp/stars' | 'pdp/star_empty' | 'pdp/star_half' | 'pdp/stopwatch' | 'pdp/drop_v2' | 'pdp/few_drops' | 'pdp/trust_badge' | 'pdp/verified';
|
|
140
|
+
declare type PDP$1 = 'pdp/circle_number' | 'pdp/clock' | 'pdp/drop' | 'pdp/drop_empty' | 'pdp/error_cross' | 'pdp/flag_usa' | 'pdp/hours' | 'pdp/klarna_logo' | 'pdp/light_bulb' | 'pdp/free_returns_v2' | 'pdp/free_shipping_v2' | 'pdp/minus' | 'pdp/moon' | 'pdp/new_clock' | 'pdp/play_mini' | 'pdp/play_video' | 'pdp/plus' | 'pdp/rule' | 'pdp/shipping' | 'pdp/shipping_empty' | 'pdp/size_empty' | 'pdp/size_empty_v2' | 'pdp/star' | 'pdp/stars' | 'pdp/star_empty' | 'pdp/star_half' | 'pdp/stopwatch' | 'pdp/drop_v2' | 'pdp/few_drops' | 'pdp/trust_badge' | 'pdp/verified' | 'pdp/wrinkle_free_face' | 'pdp/skin_appearance' | 'pdp/shine_heart' | 'pdp/cruelty_free' | 'pdp/ph_formula';
|
|
141
141
|
declare type SlideDots$1 = 'slidedots/slide_dot';
|
|
142
142
|
declare type SocialMedia$1 = 'socialmedia/facebook' | 'socialmedia/facebook_solid' | 'socialmedia/instagram' | 'socialmedia/instagram_solid' | 'socialmedia/interaction' | 'socialmedia/pinterest' | 'socialmedia/twitter' | 'socialmedia/youtube';
|
|
143
143
|
declare type IconName = Actions$1 | Arrows$1 | Custom$1 | Download$1 | Emoji$1 | Messaging$1 | MyAccount$1 | Navigation$1 | Other$1 | Payment$1 | PDP$1 | SlideDots$1 | SocialMedia$1;
|
|
@@ -3773,6 +3773,7 @@ interface DiscountTagProps {
|
|
|
3773
3773
|
}
|
|
3774
3774
|
interface ProductCardProps extends ProductItemProps {
|
|
3775
3775
|
size: ComponentSize.Medium | ComponentSize.Small | ComponentSize.Large;
|
|
3776
|
+
ratingPos?: 'top' | 'bottom';
|
|
3776
3777
|
imageHover?: ImageProps;
|
|
3777
3778
|
topTag?: JSX.Element;
|
|
3778
3779
|
bottomTag?: JSX.Element;
|
package/build/index.esm.js
CHANGED
|
@@ -3692,10 +3692,10 @@ function ClubPriceMemberLabel(_a) {
|
|
|
3692
3692
|
|
|
3693
3693
|
var Container$1g = newStyled.div(templateObject_1$23 || (templateObject_1$23 = __makeTemplateObject(["\n @keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n }\n\n display: inline-block;\n height: ", ";\n width: ", ";\n position: relative;\n overflow: hidden;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n\n ::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(\n 90deg,\n ", ",\n ", ",\n ", "\n );\n animation: shimmer 2s infinite;\n content: '';\n box-sizing: border-box;\n }\n"], ["\n @keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n }\n\n display: inline-block;\n height: ", ";\n width: ", ";\n position: relative;\n overflow: hidden;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n\n ::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(\n 90deg,\n ", ",\n ", ",\n ", "\n );\n animation: shimmer 2s infinite;\n content: '';\n box-sizing: border-box;\n }\n"])), function (_a) {
|
|
3694
3694
|
var height = _a.height;
|
|
3695
|
-
return
|
|
3695
|
+
return height !== null && height !== void 0 ? height : '1.5em';
|
|
3696
3696
|
}, function (_a) {
|
|
3697
3697
|
var width = _a.width;
|
|
3698
|
-
return
|
|
3698
|
+
return width !== null && width !== void 0 ? width : '100%';
|
|
3699
3699
|
}, function (_a) {
|
|
3700
3700
|
var theme = _a.theme;
|
|
3701
3701
|
return theme.colors.background.disabled;
|
|
@@ -20495,13 +20495,23 @@ newStyled.div(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject([
|
|
|
20495
20495
|
var DiscountLabel$2 = newStyled.div(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n background-color: #c64844;\n color: white;\n font-size: 10px;\n line-height: 14px;\n padding: 4px 6px 4px 6px;\n font-weight: bold;\n border-radius: 4px;\n margin-top: 2px;\n height: fit-content;\n &:empty {\n display: none;\n }\n"], ["\n background-color: #c64844;\n color: white;\n font-size: 10px;\n line-height: 14px;\n padding: 4px 6px 4px 6px;\n font-weight: bold;\n border-radius: 4px;\n margin-top: 2px;\n height: fit-content;\n &:empty {\n display: none;\n }\n"])));
|
|
20496
20496
|
var templateObject_1$5, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$4, templateObject_6$4, templateObject_7$4, templateObject_8$2;
|
|
20497
20497
|
|
|
20498
|
+
var PriceLabelDisplay = function (_a) {
|
|
20499
|
+
var price = _a.price, discountTag = _a.discountTag;
|
|
20500
|
+
return (jsxs$1(Fragment$2, { children: [jsxs$1("div", __assign$1({ style: { display: 'flex' } }, { children: [jsx$1(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Large, testId: "volume-discount" }, void 0), (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'next to price' && (jsx$1(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0))] }), void 0), jsx$1("div", __assign$1({ style: { display: 'flex' } }, { children: (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'below price' && (jsx$1(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0)) }), void 0)] }, void 0));
|
|
20501
|
+
};
|
|
20502
|
+
|
|
20503
|
+
var RatingDisplay = function (_a) {
|
|
20504
|
+
var rating = _a.rating, size = _a.size, isRatingLoading = _a.isRatingLoading;
|
|
20505
|
+
if (isRatingLoading) {
|
|
20506
|
+
return jsx$1(SkeletonBox, { "data-testid": "rating-skeleton", height: "20px", width: "80px" }, void 0);
|
|
20507
|
+
}
|
|
20508
|
+
if (!rating.reviews)
|
|
20509
|
+
return jsx$1(Fragment$2, {}, void 0);
|
|
20510
|
+
return (jsx$1(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
|
|
20511
|
+
};
|
|
20512
|
+
|
|
20498
20513
|
var getStylesBySize$2 = function (size) {
|
|
20499
20514
|
switch (size) {
|
|
20500
|
-
case ComponentSize.Medium:
|
|
20501
|
-
return {
|
|
20502
|
-
width: '205px',
|
|
20503
|
-
height: '274px',
|
|
20504
|
-
};
|
|
20505
20515
|
case ComponentSize.Small:
|
|
20506
20516
|
return {
|
|
20507
20517
|
width: '167px',
|
|
@@ -20512,7 +20522,7 @@ var getStylesBySize$2 = function (size) {
|
|
|
20512
20522
|
width: '262px',
|
|
20513
20523
|
height: '350px',
|
|
20514
20524
|
};
|
|
20515
|
-
|
|
20525
|
+
case ComponentSize.Medium:
|
|
20516
20526
|
default:
|
|
20517
20527
|
return {
|
|
20518
20528
|
width: '205px',
|
|
@@ -20525,7 +20535,7 @@ var TopTagContainer$2 = newStyled.div(templateObject_1$4 || (templateObject_1$4
|
|
|
20525
20535
|
return style.width;
|
|
20526
20536
|
});
|
|
20527
20537
|
var ProductCard = function (_a) {
|
|
20528
|
-
var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, size = _a.size, _b = _a.alignName, alignName = _b === void 0 ? 'center' : _b, url = _a.url, className = _a.className, topTag = _a.topTag, bottomTag = _a.bottomTag, onClick = _a.onClick, priceLoading = _a.priceLoading, _c = _a.noFollow, noFollow = _c === void 0 ? false : _c, isRatingLoading = _a.isRatingLoading, discountTag = _a.discountTag;
|
|
20538
|
+
var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, ratingPos = _a.ratingPos, size = _a.size, _b = _a.alignName, alignName = _b === void 0 ? 'center' : _b, url = _a.url, className = _a.className, topTag = _a.topTag, bottomTag = _a.bottomTag, onClick = _a.onClick, priceLoading = _a.priceLoading, _c = _a.noFollow, noFollow = _c === void 0 ? false : _c, isRatingLoading = _a.isRatingLoading, discountTag = _a.discountTag;
|
|
20529
20539
|
var theme = useTheme();
|
|
20530
20540
|
var styles = getStylesBySize$2(size);
|
|
20531
20541
|
var space = useMemo(function () {
|
|
@@ -20536,17 +20546,7 @@ var ProductCard = function (_a) {
|
|
|
20536
20546
|
_a[ComponentSize.Small] = 2,
|
|
20537
20547
|
_a)[size];
|
|
20538
20548
|
}, [size]);
|
|
20539
|
-
|
|
20540
|
-
return (jsxs$1(Fragment$2, { children: [jsxs$1("div", __assign$1({ style: { display: 'flex' } }, { children: [jsx$1(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: ComponentSize.Large, testId: "volume-discount" }, void 0), (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'next to price' && (jsx$1(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0))] }), void 0), jsx$1("div", __assign$1({ style: { display: 'flex' } }, { children: (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'below price' && (jsx$1(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0)) }), void 0)] }, void 0));
|
|
20541
|
-
};
|
|
20542
|
-
var RatingDisplay = function () {
|
|
20543
|
-
if (isRatingLoading)
|
|
20544
|
-
return jsx$1(SkeletonBox, { "data-testid": "rating-skeleton", height: "20px", width: "80px" }, void 0);
|
|
20545
|
-
if (!rating.reviews)
|
|
20546
|
-
return jsx$1(Fragment$2, {}, void 0);
|
|
20547
|
-
return (jsx$1(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
|
|
20548
|
-
};
|
|
20549
|
-
return (jsxs$1(ProdCardContainer$2, __assign$1({ className: className, "data-testid": "product-card-container-div" }, { children: [jsxs$1(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', className: "picContainer", onClick: onClick }, { children: [!!topTag || !!bottomTag ? (jsxs$1(ImageContainer$1, __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$1(Image$3, { src: image.src, srcSet: getSrcSet(image.src, 180, 360, 720, 960), alt: image.alt, width: "100%", height: "100%" }, void 0), jsx$1(TopTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: topTag }), void 0), jsx$1(BottomTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: bottomTag }), void 0)] }), void 0)) : (jsx$1(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 }, void 0)), imageHover ? (jsx$1(ImageHoverContainer$1, { className: "hover__image", src: imageHover.src, srcSet: getSrcSet(imageHover.src, 180, 360, 720, 960), loading: "lazy", 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), jsxs$1(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', onClick: onClick, className: "textContainer", style: { alignItems: "".concat(size === ComponentSize.Small ? 'start' : 'center') } }, { children: [jsx$1(Spacing, { size: space }, void 0), jsx$1(RatingDisplay, {}, void 0), jsx$1(Spacing, { size: space }, void 0), jsx$1(Title$2, __assign$1({ theme: theme, align: alignName }, { children: title }), void 0), jsx$1(Spacing, { size: space }, void 0), priceLoading ? jsx$1(SkeletonBox, { height: "20px", width: "140px" }, void 0) : PriceLabelDisplay(), jsx$1(Spacing, { size: space }, void 0)] }), void 0)] }), void 0));
|
|
20549
|
+
return (jsxs$1(ProdCardContainer$2, __assign$1({ className: className, "data-testid": "product-card-container-div" }, { children: [jsxs$1(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', className: "picContainer", onClick: onClick }, { children: [!!topTag || !!bottomTag ? (jsxs$1(ImageContainer$1, __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$1(Image$3, { src: image.src, srcSet: getSrcSet(image.src, 180, 360, 720, 960), alt: image.alt, width: "100%", height: "100%" }, void 0), jsx$1(TopTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: topTag }), void 0), jsx$1(BottomTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: bottomTag }), void 0)] }), void 0)) : (jsx$1(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 }, void 0)), imageHover ? (jsx$1(ImageHoverContainer$1, { className: "hover__image", src: imageHover.src, srcSet: getSrcSet(imageHover.src, 180, 360, 720, 960), loading: "lazy", 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), jsxs$1(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', onClick: onClick, className: "textContainer", style: { alignItems: "".concat(size === ComponentSize.Small ? 'start' : 'center') } }, { children: [jsx$1(Spacing, { size: space }, void 0), ratingPos !== 'bottom' && (jsx$1(RatingDisplay, { rating: rating, size: size, isRatingLoading: isRatingLoading }, void 0)), jsx$1(Spacing, { size: space }, void 0), jsx$1(Title$2, __assign$1({ theme: theme, align: alignName }, { children: title }), void 0), jsx$1(Spacing, { size: space }, void 0), priceLoading ? (jsx$1(SkeletonBox, { height: "20px", width: "140px" }, void 0)) : (jsx$1(PriceLabelDisplay, { price: price, discountTag: discountTag }, void 0)), jsx$1(Spacing, { size: space }, void 0), ratingPos === 'bottom' && (jsx$1(RatingDisplay, { rating: rating, size: size, isRatingLoading: isRatingLoading }, void 0))] }), void 0)] }), void 0));
|
|
20550
20550
|
};
|
|
20551
20551
|
var templateObject_1$4;
|
|
20552
20552
|
|
package/build/index.js
CHANGED
|
@@ -3718,10 +3718,10 @@ function ClubPriceMemberLabel(_a) {
|
|
|
3718
3718
|
|
|
3719
3719
|
var Container$1g = newStyled.div(templateObject_1$23 || (templateObject_1$23 = __makeTemplateObject(["\n @keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n }\n\n display: inline-block;\n height: ", ";\n width: ", ";\n position: relative;\n overflow: hidden;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n\n ::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(\n 90deg,\n ", ",\n ", ",\n ", "\n );\n animation: shimmer 2s infinite;\n content: '';\n box-sizing: border-box;\n }\n"], ["\n @keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n }\n\n display: inline-block;\n height: ", ";\n width: ", ";\n position: relative;\n overflow: hidden;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n\n ::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(\n 90deg,\n ", ",\n ", ",\n ", "\n );\n animation: shimmer 2s infinite;\n content: '';\n box-sizing: border-box;\n }\n"])), function (_a) {
|
|
3720
3720
|
var height = _a.height;
|
|
3721
|
-
return
|
|
3721
|
+
return height !== null && height !== void 0 ? height : '1.5em';
|
|
3722
3722
|
}, function (_a) {
|
|
3723
3723
|
var width = _a.width;
|
|
3724
|
-
return
|
|
3724
|
+
return width !== null && width !== void 0 ? width : '100%';
|
|
3725
3725
|
}, function (_a) {
|
|
3726
3726
|
var theme = _a.theme;
|
|
3727
3727
|
return theme.colors.background.disabled;
|
|
@@ -20521,13 +20521,23 @@ newStyled.div(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject([
|
|
|
20521
20521
|
var DiscountLabel$2 = newStyled.div(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n background-color: #c64844;\n color: white;\n font-size: 10px;\n line-height: 14px;\n padding: 4px 6px 4px 6px;\n font-weight: bold;\n border-radius: 4px;\n margin-top: 2px;\n height: fit-content;\n &:empty {\n display: none;\n }\n"], ["\n background-color: #c64844;\n color: white;\n font-size: 10px;\n line-height: 14px;\n padding: 4px 6px 4px 6px;\n font-weight: bold;\n border-radius: 4px;\n margin-top: 2px;\n height: fit-content;\n &:empty {\n display: none;\n }\n"])));
|
|
20522
20522
|
var templateObject_1$5, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$4, templateObject_6$4, templateObject_7$4, templateObject_8$2;
|
|
20523
20523
|
|
|
20524
|
+
var PriceLabelDisplay = function (_a) {
|
|
20525
|
+
var price = _a.price, discountTag = _a.discountTag;
|
|
20526
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign$1({ style: { display: 'flex' } }, { children: [jsxRuntime.jsx(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: exports.ComponentSize.Large, testId: "volume-discount" }, void 0), (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'next to price' && (jsxRuntime.jsx(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0))] }), void 0), jsxRuntime.jsx("div", __assign$1({ style: { display: 'flex' } }, { children: (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'below price' && (jsxRuntime.jsx(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0)) }), void 0)] }, void 0));
|
|
20527
|
+
};
|
|
20528
|
+
|
|
20529
|
+
var RatingDisplay = function (_a) {
|
|
20530
|
+
var rating = _a.rating, size = _a.size, isRatingLoading = _a.isRatingLoading;
|
|
20531
|
+
if (isRatingLoading) {
|
|
20532
|
+
return jsxRuntime.jsx(SkeletonBox, { "data-testid": "rating-skeleton", height: "20px", width: "80px" }, void 0);
|
|
20533
|
+
}
|
|
20534
|
+
if (!rating.reviews)
|
|
20535
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {}, void 0);
|
|
20536
|
+
return (jsxRuntime.jsx(Rating, { size: size === exports.ComponentSize.Large ? exports.ComponentSize.Small : exports.ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
|
|
20537
|
+
};
|
|
20538
|
+
|
|
20524
20539
|
var getStylesBySize$2 = function (size) {
|
|
20525
20540
|
switch (size) {
|
|
20526
|
-
case exports.ComponentSize.Medium:
|
|
20527
|
-
return {
|
|
20528
|
-
width: '205px',
|
|
20529
|
-
height: '274px',
|
|
20530
|
-
};
|
|
20531
20541
|
case exports.ComponentSize.Small:
|
|
20532
20542
|
return {
|
|
20533
20543
|
width: '167px',
|
|
@@ -20538,7 +20548,7 @@ var getStylesBySize$2 = function (size) {
|
|
|
20538
20548
|
width: '262px',
|
|
20539
20549
|
height: '350px',
|
|
20540
20550
|
};
|
|
20541
|
-
|
|
20551
|
+
case exports.ComponentSize.Medium:
|
|
20542
20552
|
default:
|
|
20543
20553
|
return {
|
|
20544
20554
|
width: '205px',
|
|
@@ -20551,7 +20561,7 @@ var TopTagContainer$2 = newStyled.div(templateObject_1$4 || (templateObject_1$4
|
|
|
20551
20561
|
return style.width;
|
|
20552
20562
|
});
|
|
20553
20563
|
var ProductCard = function (_a) {
|
|
20554
|
-
var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, size = _a.size, _b = _a.alignName, alignName = _b === void 0 ? 'center' : _b, url = _a.url, className = _a.className, topTag = _a.topTag, bottomTag = _a.bottomTag, onClick = _a.onClick, priceLoading = _a.priceLoading, _c = _a.noFollow, noFollow = _c === void 0 ? false : _c, isRatingLoading = _a.isRatingLoading, discountTag = _a.discountTag;
|
|
20564
|
+
var title = _a.title, image = _a.image, imageHover = _a.imageHover, price = _a.price, rating = _a.rating, ratingPos = _a.ratingPos, size = _a.size, _b = _a.alignName, alignName = _b === void 0 ? 'center' : _b, url = _a.url, className = _a.className, topTag = _a.topTag, bottomTag = _a.bottomTag, onClick = _a.onClick, priceLoading = _a.priceLoading, _c = _a.noFollow, noFollow = _c === void 0 ? false : _c, isRatingLoading = _a.isRatingLoading, discountTag = _a.discountTag;
|
|
20555
20565
|
var theme = useTheme();
|
|
20556
20566
|
var styles = getStylesBySize$2(size);
|
|
20557
20567
|
var space = React$2.useMemo(function () {
|
|
@@ -20562,17 +20572,7 @@ var ProductCard = function (_a) {
|
|
|
20562
20572
|
_a[exports.ComponentSize.Small] = 2,
|
|
20563
20573
|
_a)[size];
|
|
20564
20574
|
}, [size]);
|
|
20565
|
-
|
|
20566
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign$1({ style: { display: 'flex' } }, { children: [jsxRuntime.jsx(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, finalPriceStyled: false, color: price.color, size: exports.ComponentSize.Large, testId: "volume-discount" }, void 0), (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'next to price' && (jsxRuntime.jsx(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0))] }), void 0), jsxRuntime.jsx("div", __assign$1({ style: { display: 'flex' } }, { children: (discountTag === null || discountTag === void 0 ? void 0 : discountTag.pos) === 'below price' && (jsxRuntime.jsx(DiscountLabel$2, __assign$1({ style: { marginLeft: '5px' } }, { children: discountTag === null || discountTag === void 0 ? void 0 : discountTag.value }), void 0)) }), void 0)] }, void 0));
|
|
20567
|
-
};
|
|
20568
|
-
var RatingDisplay = function () {
|
|
20569
|
-
if (isRatingLoading)
|
|
20570
|
-
return jsxRuntime.jsx(SkeletonBox, { "data-testid": "rating-skeleton", height: "20px", width: "80px" }, void 0);
|
|
20571
|
-
if (!rating.reviews)
|
|
20572
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, {}, void 0);
|
|
20573
|
-
return (jsxRuntime.jsx(Rating, { size: size === exports.ComponentSize.Large ? exports.ComponentSize.Small : exports.ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "", wrapWithParenthesis: true }, void 0));
|
|
20574
|
-
};
|
|
20575
|
-
return (jsxRuntime.jsxs(ProdCardContainer$2, __assign$1({ className: className, "data-testid": "product-card-container-div" }, { children: [jsxRuntime.jsxs(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', className: "picContainer", onClick: onClick }, { children: [!!topTag || !!bottomTag ? (jsxRuntime.jsxs(ImageContainer$1, __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: [jsxRuntime.jsx(Image$3, { src: image.src, srcSet: getSrcSet(image.src, 180, 360, 720, 960), alt: image.alt, width: "100%", height: "100%" }, void 0), jsxRuntime.jsx(TopTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: topTag }), void 0), jsxRuntime.jsx(BottomTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: bottomTag }), void 0)] }), void 0)) : (jsxRuntime.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 }, void 0)), imageHover ? (jsxRuntime.jsx(ImageHoverContainer$1, { className: "hover__image", src: imageHover.src, srcSet: getSrcSet(imageHover.src, 180, 360, 720, 960), loading: "lazy", 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), jsxRuntime.jsxs(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', onClick: onClick, className: "textContainer", style: { alignItems: "".concat(size === exports.ComponentSize.Small ? 'start' : 'center') } }, { children: [jsxRuntime.jsx(Spacing, { size: space }, void 0), jsxRuntime.jsx(RatingDisplay, {}, void 0), jsxRuntime.jsx(Spacing, { size: space }, void 0), jsxRuntime.jsx(Title$2, __assign$1({ theme: theme, align: alignName }, { children: title }), void 0), jsxRuntime.jsx(Spacing, { size: space }, void 0), priceLoading ? jsxRuntime.jsx(SkeletonBox, { height: "20px", width: "140px" }, void 0) : PriceLabelDisplay(), jsxRuntime.jsx(Spacing, { size: space }, void 0)] }), void 0)] }), void 0));
|
|
20575
|
+
return (jsxRuntime.jsxs(ProdCardContainer$2, __assign$1({ className: className, "data-testid": "product-card-container-div" }, { children: [jsxRuntime.jsxs(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', className: "picContainer", onClick: onClick }, { children: [!!topTag || !!bottomTag ? (jsxRuntime.jsxs(ImageContainer$1, __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: [jsxRuntime.jsx(Image$3, { src: image.src, srcSet: getSrcSet(image.src, 180, 360, 720, 960), alt: image.alt, width: "100%", height: "100%" }, void 0), jsxRuntime.jsx(TopTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: topTag }), void 0), jsxRuntime.jsx(BottomTagContainer$2, __assign$1({ style: { width: 'inherit' } }, { children: bottomTag }), void 0)] }), void 0)) : (jsxRuntime.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 }, void 0)), imageHover ? (jsxRuntime.jsx(ImageHoverContainer$1, { className: "hover__image", src: imageHover.src, srcSet: getSrcSet(imageHover.src, 180, 360, 720, 960), loading: "lazy", 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), jsxRuntime.jsxs(Container$4, __assign$1({ as: url ? 'a' : 'div', href: url, rel: noFollow ? 'nofollow' : '', onClick: onClick, className: "textContainer", style: { alignItems: "".concat(size === exports.ComponentSize.Small ? 'start' : 'center') } }, { children: [jsxRuntime.jsx(Spacing, { size: space }, void 0), ratingPos !== 'bottom' && (jsxRuntime.jsx(RatingDisplay, { rating: rating, size: size, isRatingLoading: isRatingLoading }, void 0)), jsxRuntime.jsx(Spacing, { size: space }, void 0), jsxRuntime.jsx(Title$2, __assign$1({ theme: theme, align: alignName }, { children: title }), void 0), jsxRuntime.jsx(Spacing, { size: space }, void 0), priceLoading ? (jsxRuntime.jsx(SkeletonBox, { height: "20px", width: "140px" }, void 0)) : (jsxRuntime.jsx(PriceLabelDisplay, { price: price, discountTag: discountTag }, void 0)), jsxRuntime.jsx(Spacing, { size: space }, void 0), ratingPos === 'bottom' && (jsxRuntime.jsx(RatingDisplay, { rating: rating, size: size, isRatingLoading: isRatingLoading }, void 0))] }), void 0)] }), void 0));
|
|
20576
20576
|
};
|
|
20577
20577
|
var templateObject_1$4;
|
|
20578
20578
|
|
package/package.json
CHANGED