@trafilea/afrodita-components 6.8.9 → 6.8.11

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
@@ -2903,6 +2903,7 @@ interface ReviewProps {
2903
2903
  reviewId: string;
2904
2904
  reviewerName: string;
2905
2905
  date: Date;
2906
+ dateFormat?: 'DDMMYY' | 'MMDDYY' | 'YYMMDD';
2906
2907
  rating: number;
2907
2908
  stars: {
2908
2909
  color: string;
@@ -2921,7 +2922,7 @@ interface ReviewProps {
2921
2922
  helpfulCount?: number;
2922
2923
  hasTextWhenHelpfulCount0?: boolean;
2923
2924
  }
2924
- declare const Review: ({ reviewId, reviewerName, date, rating, stars, title, description, images, reviewVariant, onClickImage, helpfulActionText, helpfulAction, helpfulCount, hasTextWhenHelpfulCount0, }: ReviewProps) => JSX.Element;
2925
+ declare const Review: ({ reviewId, reviewerName, date, dateFormat, rating, stars, title, description, images, reviewVariant, onClickImage, helpfulActionText, helpfulAction, helpfulCount, hasTextWhenHelpfulCount0, }: ReviewProps) => JSX.Element;
2925
2926
 
2926
2927
  interface ReviewsHeaderProps {
2927
2928
  title?: string;
@@ -13207,7 +13207,7 @@ var ImageProductWithTags$1 = function (_a) {
13207
13207
  };
13208
13208
  var templateObject_1$V, templateObject_2$B, templateObject_3$u, templateObject_4$k;
13209
13209
 
13210
- var Container$G = newStyled.div(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n display: grid;\n grid-template-columns: max-content 1fr;\n grid-column-gap: 20px;\n max-height: 50rem;\n width: fit-content;\n"], ["\n display: grid;\n grid-template-columns: max-content 1fr;\n grid-column-gap: 20px;\n max-height: 50rem;\n width: fit-content;\n"])));
13210
+ var Container$G = newStyled.div(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n display: grid;\n grid-template-columns: minmax(6rem, max-content) 1fr;\n grid-column-gap: 20px;\n max-height: 50rem;\n width: fit-content;\n"], ["\n display: grid;\n grid-template-columns: minmax(6rem, max-content) 1fr;\n grid-column-gap: 20px;\n max-height: 50rem;\n width: fit-content;\n"])));
13211
13211
  var ProductGallery = function (_a) {
13212
13212
  var images = _a.images, selectedValue = _a.selectedValue, topTag = _a.topTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, previewListDataTestId = _a.previewListDataTestId, thumbnailPosition = _a.thumbnailPosition, _b = _a.borderRadiusVariant, borderRadiusVariant = _b === void 0 ? false : _b, previewImgBorderColor = _a.previewImgBorderColor, ctaText = _a.ctaText, ctaAction = _a.ctaAction, _c = _a.hideCTA, hideCTA = _c === void 0 ? false : _c, _d = _a.hasOverflowArrows, hasOverflowArrows = _d === void 0 ? false : _d;
13213
13213
  var initialValue = selectedValue && images.includes(selectedValue) ? selectedValue : images[0];
@@ -18666,11 +18666,18 @@ var ClubRadioGroupInput = function (_a) {
18666
18666
  }) }), void 0));
18667
18667
  };
18668
18668
 
18669
- function formatDate(date) {
18669
+ function formatDate(date, format) {
18670
18670
  var day = date.getDate();
18671
18671
  var month = date.getMonth() + 1;
18672
18672
  var year = date.getFullYear();
18673
- return month < 10 ? "".concat(day, "/0").concat(month, "/").concat(year) : "".concat(day, "/").concat(month, "/").concat(year);
18673
+ switch (format !== null && format !== void 0 ? format : 'DDMMYY') {
18674
+ case 'DDMMYY':
18675
+ return "".concat(day < 10 ? "0".concat(day) : day, "/").concat(month < 10 ? "0".concat(month) : month, "/").concat(year);
18676
+ case 'MMDDYY':
18677
+ return "".concat(month < 10 ? "0".concat(month) : month, "/").concat(day < 10 ? "0".concat(day) : day, "/").concat(year);
18678
+ case 'YYMMDD':
18679
+ return "".concat(year, "/").concat(month < 10 ? "0".concat(month) : month, "/").concat(day < 10 ? "0".concat(day) : day);
18680
+ }
18674
18681
  }
18675
18682
 
18676
18683
  var Container$h = newStyled.div(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"], ["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"])));
@@ -18741,10 +18748,10 @@ var HelpfulText = newStyled.div(templateObject_17 || (templateObject_17 = __make
18741
18748
  var HelpfulTexti = newStyled.i(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n content: '\f164';\n"], ["\n content: '\\f164';\n"])));
18742
18749
  var ButtonSecondaryWrapper = newStyled(ButtonSecondary)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n margin-right: 15px;\n"], ["\n margin-right: 15px;\n"])));
18743
18750
  var Review = function (_a) {
18744
- 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;
18751
+ var reviewId = _a.reviewId, reviewerName = _a.reviewerName, date = _a.date, _b = _a.dateFormat, dateFormat = _b === void 0 ? 'DDMMYY' : _b, 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, _c = _a.hasTextWhenHelpfulCount0, hasTextWhenHelpfulCount0 = _c === void 0 ? false : _c;
18745
18752
  var randomId = Math.random().toString(36).substring(7);
18746
- var _c = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _c[0], setShowMoreMobile = _c[1];
18747
- var _d = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _d[0], setShowMoreDesktop = _d[1];
18753
+ var _d = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), showMoreMobile = _d[0], setShowMoreMobile = _d[1];
18754
+ var _e = useState(description.length > REVIEWS_DESCRIPTION_MAX_LENGTH_DESKTOP), showMoreDesktop = _e[0], setShowMoreDesktop = _e[1];
18748
18755
  useEffect(function () {
18749
18756
  var seeMoreElements = document.querySelectorAll("#see-more-".concat(randomId));
18750
18757
  var showAllDescription = function () {
@@ -18760,7 +18767,7 @@ var Review = function (_a) {
18760
18767
  });
18761
18768
  };
18762
18769
  }, [randomId]);
18763
- return (jsxs$1(Container$g, { children: [jsxs$1(Heading, { children: [jsx$1(ReviewerName, { children: reviewerName }, void 0), jsx$1(DateText, { children: formatDate(date) }, void 0)] }, void 0), jsx$1(StarList, { starsNumber: 5, rating: rating, fill: stars.color, size: stars.size }, void 0), jsxs$1(Content, __assign$1({ "data-testid": "review-content" }, { children: [jsxs$1(ReviewContainer, { children: [jsx$1(ReviewTitle, { children: title }, void 0), jsx$1(ReviewDescriptionMobile, { dangerouslySetInnerHTML: {
18770
+ return (jsxs$1(Container$g, { children: [jsxs$1(Heading, { children: [jsx$1(ReviewerName, { children: reviewerName }, void 0), jsx$1(DateText, { children: formatDate(date, dateFormat) }, void 0)] }, void 0), jsx$1(StarList, { starsNumber: 5, rating: rating, fill: stars.color, size: stars.size }, void 0), jsxs$1(Content, __assign$1({ "data-testid": "review-content" }, { children: [jsxs$1(ReviewContainer, { children: [jsx$1(ReviewTitle, { children: title }, void 0), jsx$1(ReviewDescriptionMobile, { dangerouslySetInnerHTML: {
18764
18771
  __html: showMoreMobile
18765
18772
  ? "".concat(description.slice(0, REVIEWS_DESCRIPTION_MAX_LENGTH_MOBILE), "... <a id=\"see-more-").concat(randomId, "\" class=\"see-more\">See more</a>")
18766
18773
  : description,