@trafilea/afrodita-components 6.8.0 → 6.8.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.js CHANGED
@@ -3120,13 +3120,17 @@ 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
+ };
3123
3126
  var formatPrice = function (value, _a) {
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];
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];
3127
3130
  // this prevents `Intl.NumberFormat` from rounding the number
3128
3131
  var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
3129
- return new Intl.NumberFormat(locale, {
3132
+ var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
3133
+ return new Intl.NumberFormat(overridedLocale, {
3130
3134
  style: 'currency',
3131
3135
  currency: currency,
3132
3136
  maximumFractionDigits: 3,
@@ -5511,7 +5515,7 @@ var PriceLabelV2 = function (_a) {
5511
5515
  var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
5512
5516
  var isDiscount = discount && isDiffFinalAndOriginalPrice;
5513
5517
  var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
5514
- var supportedCurrencies = ['A$', 'CA$', '£'];
5518
+ var supportedCurrencies = ['AU$', 'CA$', '£'];
5515
5519
  var currencySymbol = '$';
5516
5520
  if (typeof productFinalPrice === 'string') {
5517
5521
  supportedCurrencies.forEach(function (availableCurrency) {
@@ -18589,10 +18593,10 @@ var HelpfulText = newStyled.div(templateObject_17 || (templateObject_17 = __make
18589
18593
  var HelpfulTexti = newStyled.i(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n content: '\f164';\n"], ["\n content: '\\f164';\n"])));
18590
18594
  var ButtonSecondaryWrapper = newStyled(ButtonSecondary)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n margin-right: 15px;\n"], ["\n margin-right: 15px;\n"])));
18591
18595
  var Review = function (_a) {
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;
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, _b = _a.hasTextWhenHelpfulCount0, hasTextWhenHelpfulCount0 = _b === void 0 ? false : _b;
18593
18597
  var randomId = Math.random().toString(36).substring(7);
18594
- var _b = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _b[0], setShowMoreMobile = _b[1];
18595
- var _c = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _c[0], setShowMoreDesktop = _c[1];
18598
+ var _c = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _c[0], setShowMoreMobile = _c[1];
18599
+ var _d = React$2.useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _d[0], setShowMoreDesktop = _d[1];
18596
18600
  React$2.useEffect(function () {
18597
18601
  var seeMoreElements = document.querySelectorAll("#see-more-".concat(randomId));
18598
18602
  var showAllDescription = function () {
@@ -18616,7 +18620,7 @@ var Review = function (_a) {
18616
18620
  __html: showMoreDesktop
18617
18621
  ? "".concat(description.slice(0, REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), "... <a id=\"see-more-").concat(randomId, "\" class=\"see-more\">See more</a>")
18618
18622
  : description,
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 && 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));
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 || (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));
18620
18624
  };
18621
18625
  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;
18622
18626