@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.d.ts CHANGED
@@ -2902,8 +2902,9 @@ interface ReviewProps {
2902
2902
  helpfulActionText?: string;
2903
2903
  helpfulAction?: (id: string) => void;
2904
2904
  helpfulCount?: number;
2905
+ hasTextWhenHelpfulCount0?: boolean;
2905
2906
  }
2906
- declare const Review: ({ reviewId, reviewerName, date, rating, stars, title, description, images, reviewVariant, onClickImage, helpfulActionText, helpfulAction, helpfulCount, }: ReviewProps) => JSX.Element;
2907
+ declare const Review: ({ reviewId, reviewerName, date, rating, stars, title, description, images, reviewVariant, onClickImage, helpfulActionText, helpfulAction, helpfulCount, hasTextWhenHelpfulCount0, }: ReviewProps) => JSX.Element;
2907
2908
 
2908
2909
  interface ReviewsHeaderProps {
2909
2910
  title?: string;
@@ -3094,13 +3094,17 @@ var AssetsProvider = function (_a) {
3094
3094
  };
3095
3095
  var useThemeAssets = function () { return useContext(AssetsContext); };
3096
3096
 
3097
+ var localeOverrideByCurrency = {
3098
+ AUD: 'am-AM',
3099
+ };
3097
3100
  var formatPrice = function (value, _a) {
3098
- var _b;
3099
- 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;
3100
- var _f = value.toFixed(3).split('.'), integer = _f[0], fraction = _f[1];
3101
+ var _b, _c;
3102
+ 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;
3103
+ var _g = value.toFixed(3).split('.'), integer = _g[0], fraction = _g[1];
3101
3104
  // this prevents `Intl.NumberFormat` from rounding the number
3102
3105
  var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
3103
- return new Intl.NumberFormat(locale, {
3106
+ var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
3107
+ return new Intl.NumberFormat(overridedLocale, {
3104
3108
  style: 'currency',
3105
3109
  currency: currency,
3106
3110
  maximumFractionDigits: 3,
@@ -5485,7 +5489,7 @@ var PriceLabelV2 = function (_a) {
5485
5489
  var isOriginalPrice = originalPrice && isDiffFinalAndOriginalPrice;
5486
5490
  var isDiscount = discount && isDiffFinalAndOriginalPrice;
5487
5491
  var isClubOffer = clubOffer && isDiffFinalAndOriginalPrice;
5488
- var supportedCurrencies = ['A$', 'CA$', '£'];
5492
+ var supportedCurrencies = ['AU$', 'CA$', '£'];
5489
5493
  var currencySymbol = '$';
5490
5494
  if (typeof productFinalPrice === 'string') {
5491
5495
  supportedCurrencies.forEach(function (availableCurrency) {
@@ -18563,10 +18567,10 @@ var HelpfulText = newStyled.div(templateObject_17 || (templateObject_17 = __make
18563
18567
  var HelpfulTexti = newStyled.i(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n content: '\f164';\n"], ["\n content: '\\f164';\n"])));
18564
18568
  var ButtonSecondaryWrapper = newStyled(ButtonSecondary)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n margin-right: 15px;\n"], ["\n margin-right: 15px;\n"])));
18565
18569
  var Review = function (_a) {
18566
- 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;
18570
+ 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;
18567
18571
  var randomId = Math.random().toString(36).substring(7);
18568
- var _b = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _b[0], setShowMoreMobile = _b[1];
18569
- var _c = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _c[0], setShowMoreDesktop = _c[1];
18572
+ var _c = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _c[0], setShowMoreMobile = _c[1];
18573
+ var _d = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _d[0], setShowMoreDesktop = _d[1];
18570
18574
  useEffect(function () {
18571
18575
  var seeMoreElements = document.querySelectorAll("#see-more-".concat(randomId));
18572
18576
  var showAllDescription = function () {
@@ -18590,7 +18594,7 @@ var Review = function (_a) {
18590
18594
  __html: showMoreDesktop
18591
18595
  ? "".concat(description.slice(0, REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), "... <a id=\"see-more-").concat(randomId, "\" class=\"see-more\">See more</a>")
18592
18596
  : description,
18593
- } }, void 0), jsxs$1(HelpfulContainerDesktop, __assign$1({ showMoreDesktop: description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP }, { children: [helpfulActionText && helpfulAction && (jsx$1(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: ComponentSize.Small }, void 0)), helpfulCount && jsxs$1(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0)] }), void 0)] }, void 0), jsxs$1(ImagesContainer, { children: [jsxs$1(Images, { children: [images === null || images === void 0 ? void 0 : images.map(function (image) { return (jsx$1(ImageWrapper$1, __assign$1({ onClick: function () { return onClickImage && onClickImage(image.src); } }, { children: jsx$1(Image$3, { src: image.src, alt: image.alt, height: "10rem", width: "7.5rem" }, void 0) }), image.src)); }), !images || (images.length === 0 && jsx$1(ImageSpace, {}, void 0))] }, void 0), jsx$1(VariantText, { children: reviewVariant }, void 0)] }, void 0)] }), void 0), jsx$1(HelpfulTexti, {}, void 0), jsxs$1(HelpfulContainerMobile, { children: [helpfulActionText && helpfulAction && (jsx$1(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: ComponentSize.Small }, void 0)), helpfulCount && jsxs$1(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0)] }, void 0)] }, void 0));
18597
+ } }, void 0), jsxs$1(HelpfulContainerDesktop, __assign$1({ showMoreDesktop: description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP }, { children: [helpfulActionText && helpfulAction && (jsx$1(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: ComponentSize.Small }, void 0)), (helpfulCount || (hasTextWhenHelpfulCount0 && helpfulCount === 0)) && (jsxs$1(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0))] }), void 0)] }, void 0), jsxs$1(ImagesContainer, { children: [jsxs$1(Images, { children: [images === null || images === void 0 ? void 0 : images.map(function (image) { return (jsx$1(ImageWrapper$1, __assign$1({ onClick: function () { return onClickImage && onClickImage(image.src); } }, { children: jsx$1(Image$3, { src: image.src, alt: image.alt, height: "10rem", width: "7.5rem" }, void 0) }), image.src)); }), !images || (images.length === 0 && jsx$1(ImageSpace, {}, void 0))] }, void 0), jsx$1(VariantText, { children: reviewVariant }, void 0)] }, void 0)] }), void 0), jsx$1(HelpfulTexti, {}, void 0), jsxs$1(HelpfulContainerMobile, { children: [helpfulActionText && helpfulAction && (jsx$1(ButtonSecondaryWrapper, { onClick: function () { return helpfulAction(reviewId); }, text: helpfulActionText, size: ComponentSize.Small }, void 0)), (helpfulCount || (hasTextWhenHelpfulCount0 && helpfulCount === 0)) && (jsxs$1(HelpfulText, { children: [helpfulCount, " people found this helpful"] }, void 0))] }, void 0)] }, void 0));
18594
18598
  };
18595
18599
  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;
18596
18600