@trafilea/afrodita-components 6.7.0 → 6.8.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.js CHANGED
@@ -3120,17 +3120,13 @@ var AssetsProvider = function (_a) {
3120
3120
  };
3121
3121
  var useThemeAssets = function () { return React$2.useContext(AssetsContext); };
3122
3122
 
3123
- var localeOverrideByCurrency = {
3124
- AUD: 'am-AM',
3125
- };
3126
3123
  var formatPrice = function (value, _a) {
3127
- var _b, _c;
3128
- var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f;
3129
- var _g = value.toFixed(3).split('.'), integer = _g[0], fraction = _g[1];
3124
+ var _b;
3125
+ var _c = _a === void 0 ? {} : _a, _d = _c.locale, locale = _d === void 0 ? 'en-US' : _d, _e = _c.currency, currency = _e === void 0 ? 'USD' : _e;
3126
+ var _f = value.toFixed(3).split('.'), integer = _f[0], fraction = _f[1];
3130
3127
  // this prevents `Intl.NumberFormat` from rounding the number
3131
3128
  var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
3132
- var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
3133
- return new Intl.NumberFormat(overridedLocale, {
3129
+ return new Intl.NumberFormat(locale, {
3134
3130
  style: 'currency',
3135
3131
  currency: currency,
3136
3132
  maximumFractionDigits: 3,
@@ -5515,7 +5511,7 @@ var PriceLabelV2 = function (_a) {
5515
5511
  var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
5516
5512
  var isDiscount = discount && isDiffFinalAndOriginalPrice;
5517
5513
  var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
5518
- var supportedCurrencies = ['AU$', 'CA$', '£'];
5514
+ var supportedCurrencies = ['A$', 'CA$', '£'];
5519
5515
  var currencySymbol = '$';
5520
5516
  if (typeof productFinalPrice === 'string') {
5521
5517
  supportedCurrencies.forEach(function (availableCurrency) {
@@ -18593,10 +18589,10 @@ var HelpfulText = newStyled.div(templateObject_17 || (templateObject_17 = __make
18593
18589
  var HelpfulTexti = newStyled.i(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n content: '\f164';\n"], ["\n content: '\\f164';\n"])));
18594
18590
  var ButtonSecondaryWrapper = newStyled(ButtonSecondary)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n margin-right: 15px;\n"], ["\n margin-right: 15px;\n"])));
18595
18591
  var Review = function (_a) {
18596
- var reviewId = _a.reviewId, reviewerName = _a.reviewerName, date = _a.date, rating = _a.rating, stars = _a.stars, title = _a.title, description = _a.description, images = _a.images, reviewVariant = _a.reviewVariant, onClickImage = _a.onClickImage, helpfulActionText = _a.helpfulActionText, helpfulAction = _a.helpfulAction, helpfulCount = _a.helpfulCount;
18592
+ var reviewId = _a.reviewId, reviewerName = _a.reviewerName, date = _a.date, rating = _a.rating, stars = _a.stars, title = _a.title, description = _a.description, images = _a.images, reviewVariant = _a.reviewVariant, onClickImage = _a.onClickImage, helpfulActionText = _a.helpfulActionText, helpfulAction = _a.helpfulAction, helpfulCount = _a.helpfulCount, _b = _a.hasTextWhenHelpfulCount0, hasTextWhenHelpfulCount0 = _b === void 0 ? false : _b;
18597
18593
  var randomId = Math.random().toString(36).substring(7);
18598
- var _b = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _b[0], setShowMoreMobile = _b[1];
18599
- var _c = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _c[0], setShowMoreDesktop = _c[1];
18594
+ var _c = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _c[0], setShowMoreMobile = _c[1];
18595
+ var _d = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _d[0], setShowMoreDesktop = _d[1];
18600
18596
  React$2.useEffect(function () {
18601
18597
  var seeMoreElements = document.querySelectorAll("#see-more-".concat(randomId));
18602
18598
  var showAllDescription = function () {
@@ -18620,7 +18616,7 @@ var Review = function (_a) {
18620
18616
  __html: showMoreDesktop
18621
18617
  ? "".concat(description.slice(0, REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), "... <a id=\"see-more-").concat(randomId, "\" class=\"see-more\">See more</a>")
18622
18618
  : description,
18623
- } }, void 0), jsxRuntime.jsxs(HelpfulContainerDesktop, __assign$1({ showMoreDesktop: description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP }, { children: [helpfulActionText && helpfulAction && (jsxRuntime.jsx(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: exports.ComponentSize.Small }, void 0)), helpfulCount && jsxRuntime.jsxs(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0)] }), void 0)] }, void 0), jsxRuntime.jsxs(ImagesContainer, { children: [jsxRuntime.jsxs(Images, { children: [images === null || images === void 0 ? void 0 : images.map(function (image) { return (jsxRuntime.jsx(ImageWrapper$1, __assign$1({ onClick: function () { return onClickImage && onClickImage(image.src); } }, { children: jsxRuntime.jsx(Image$3, { src: image.src, alt: image.alt, height: "10rem", width: "7.5rem" }, void 0) }), image.src)); }), !images || (images.length === 0 && jsxRuntime.jsx(ImageSpace, {}, void 0))] }, void 0), jsxRuntime.jsx(VariantText, { children: reviewVariant }, void 0)] }, void 0)] }), void 0), jsxRuntime.jsx(HelpfulTexti, {}, void 0), jsxRuntime.jsxs(HelpfulContainerMobile, { children: [helpfulActionText && helpfulAction && (jsxRuntime.jsx(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: exports.ComponentSize.Small }, void 0)), helpfulCount && jsxRuntime.jsxs(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0)] }, void 0)] }, void 0));
18619
+ } }, void 0), jsxRuntime.jsxs(HelpfulContainerDesktop, __assign$1({ showMoreDesktop: description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP }, { children: [helpfulActionText && helpfulAction && (jsxRuntime.jsx(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: exports.ComponentSize.Small }, void 0)), (helpfulCount || (hasTextWhenHelpfulCount0 && helpfulCount === 0)) && (jsxRuntime.jsxs(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0))] }), void 0)] }, void 0), jsxRuntime.jsxs(ImagesContainer, { children: [jsxRuntime.jsxs(Images, { children: [images === null || images === void 0 ? void 0 : images.map(function (image) { return (jsxRuntime.jsx(ImageWrapper$1, __assign$1({ onClick: function () { return onClickImage && onClickImage(image.src); } }, { children: jsxRuntime.jsx(Image$3, { src: image.src, alt: image.alt, height: "10rem", width: "7.5rem" }, void 0) }), image.src)); }), !images || (images.length === 0 && jsxRuntime.jsx(ImageSpace, {}, void 0))] }, void 0), jsxRuntime.jsx(VariantText, { children: reviewVariant }, void 0)] }, void 0)] }), void 0), jsxRuntime.jsx(HelpfulTexti, {}, void 0), jsxRuntime.jsxs(HelpfulContainerMobile, { children: [helpfulActionText && helpfulAction && (jsxRuntime.jsx(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: exports.ComponentSize.Small }, void 0)), (helpfulCount || (hasTextWhenHelpfulCount0 && helpfulCount === 0)) && (jsxRuntime.jsxs(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0))] }, void 0)] }, void 0));
18624
18620
  };
18625
18621
  var templateObject_1$p, templateObject_2$h, templateObject_3$e, templateObject_4$a, templateObject_5$5, templateObject_6$4, templateObject_7$4, templateObject_8$3, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19;
18626
18622