@trafilea/afrodita-components 7.8.0 → 7.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__assign as i}from"tslib";import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"@emotion/styled";import{useState as r,useEffect as l}from"react";import{ComponentSize as a}from"../../types/enums.js";import{formatDate as d}from"../../utils/dateFormatter/dateFormatter.js";import{Image as p}from"../atoms/Image/Image.js";import"@emotion/react/jsx-runtime";import"../../core/theme/Theme.js";import"../cta/styled.js";import h from"../cta/secondary/ButtonSecondary.js";import{StarList as s}from"../rating/starList/StarList.js";var m,c,x,f,g,w,u,v,y,z,b,j,k,S,M,C,I,L,T,D=o.div(m||(m=n(["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"],["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"]))),E=o.div(c||(c=n(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n font-size: 14px;\n line-height: 22px;\n text-align: right;\n margin-bottom: 10px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n font-size: 14px;\n line-height: 22px;\n text-align: right;\n margin-bottom: 10px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),_=o.div(x||(x=n(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),A=o.div(f||(f=n(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"]))),F=o.span(g||(g=n(["\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),H=o.div(w||(w=n(["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),N=o.h2(u||(u=n(["\n font-weight: 600;\n margin: 0;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n line-height: 28px;\n }\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n line-height: 28px;\n }\n"]))),Y=o.h3(v||(v=n(["\n font-size: 14px;\n line-height: 22px;\n margin: 10px 0 8px;\n font-weight: 600;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-size: 14px;\n line-height: 22px;\n margin: 10px 0 8px;\n font-weight: 600;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),q=o.div(y||(y=n(["\n display: none;\n\n @media (min-width: 768px) {\n display: block;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n white-space: pre-wrap;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n }\n"],["\n display: none;\n\n @media (min-width: 768px) {\n display: block;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n white-space: pre-wrap;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n }\n"]))),B=o.div(z||(z=n(["\n font-weight: normal;\n font-size: 14px;\n line-height: 22px;\n margin: 0;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n\n @media (min-width: 768px) {\n display: none;\n }\n"],["\n font-weight: normal;\n font-size: 14px;\n line-height: 22px;\n margin: 0;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n\n @media (min-width: 768px) {\n display: none;\n }\n"]))),V=o.div(b||(b=n(["\n margin-left: 10px;\n text-align: right;\n"],["\n margin-left: 10px;\n text-align: right;\n"]))),W=o.div(j||(j=n(["\n display: flex;\n justify-content: end;\n"],["\n display: flex;\n justify-content: end;\n"]))),G=o.div(k||(k=n(["\n width: 7.5rem;\n height: 4.125rem;\n"],["\n width: 7.5rem;\n height: 4.125rem;\n"]))),J=o.div(S||(S=n(["\n cursor: zoom-in;\n display: none;\n margin-right: 4px;\n\n &:first-child {\n display: inline-block;\n }\n\n & img {\n object-fit: cover;\n }\n\n @media (min-width: 1024px) {\n display: inline-block;\n }\n"],["\n cursor: zoom-in;\n display: none;\n margin-right: 4px;\n\n &:first-child {\n display: inline-block;\n }\n\n & img {\n object-fit: cover;\n }\n\n @media (min-width: 1024px) {\n display: inline-block;\n }\n"]))),K=o.div(M||(M=n(["\n display: flex;\n margin-top: ",";\n\n @media (max-width: 768px) {\n display: none;\n }\n"],["\n display: flex;\n margin-top: ",";\n\n @media (max-width: 768px) {\n display: none;\n }\n"])),(function(n){return n.showMoreDesktop?"12px":"50px"})),O=o.div(C||(C=n(["\n display: none;\n\n @media (max-width: 768px) {\n margin-top: 10px;\n display: flex;\n }\n"],["\n display: none;\n\n @media (max-width: 768px) {\n margin-top: 10px;\n display: flex;\n }\n"]))),P=o.div(I||(I=n(["\n font-size: 14px;\n line-height: 34px;\n font-weight: 600;\n color: #d4605b;\n"],["\n font-size: 14px;\n line-height: 34px;\n font-weight: 600;\n color: #d4605b;\n"]))),Q=o.i(L||(L=n(["\n content: '\f164';\n"],["\n content: '\\f164';\n"]))),R=o(h)(T||(T=n(["\n margin-right: 15px;\n"],["\n margin-right: 15px;\n"]))),U=function(n){var o=n.reviewId,h=n.reviewerName,m=n.date,c=n.dateFormat,x=void 0===c?"DDMMYY":c,f=n.rating,g=n.stars,w=n.title,u=n.description,v=n.images,y=n.reviewVariant,z=n.onClickImage,b=n.helpfulActionText,j=n.helpfulAction,k=n.helpfulCount,S=n.hasTextWhenHelpfulCount0,M=void 0!==S&&S,C=Math.random().toString(36).substring(7),I=r(u.length>168),L=I[0],T=I[1],U=r(u.length>500),X=U[0],Z=U[1];return l((function(){var n=document.querySelectorAll("#see-more-".concat(C)),i=function(){T(!1),Z(!1)};return n.forEach((function(n){n.addEventListener("click",i)})),function(){n.forEach((function(n){n.removeEventListener("click",i)}))}}),[C]),e(D,{children:[e(E,{children:[t(N,{children:h},void 0),t(F,{children:d(m,x)},void 0)]},void 0),t(s,{starsNumber:5,rating:f,fill:g.color,size:g.size},void 0),e(_,i({"data-testid":"review-content"},{children:[e(A,{children:[t(Y,{children:w},void 0),t(B,{dangerouslySetInnerHTML:{__html:L?"".concat(u.slice(0,168),'... <a id="see-more-').concat(C,'" class="see-more">See more</a>'):u}},void 0),t(q,{dangerouslySetInnerHTML:{__html:X?"".concat(u.slice(0,500),'... <a id="see-more-').concat(C,'" class="see-more">See more</a>'):u}},void 0),e(K,i({showMoreDesktop:u.length>500},{children:[b&&j&&t(R,{onClick:function(){return j(o)},text:b,size:a.Small},void 0),(k||M&&0===k)&&e(P,{children:[k," people found this helpful"]},void 0)]}),void 0)]},void 0),e(V,{children:[e(W,{children:[null==v?void 0:v.map((function(n){return t(J,i({onClick:function(){return z
|
|
1
|
+
import{__makeTemplateObject as n,__assign as i}from"tslib";import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"@emotion/styled";import{useState as r,useEffect as l}from"react";import{ComponentSize as a}from"../../types/enums.js";import{formatDate as d}from"../../utils/dateFormatter/dateFormatter.js";import{Image as p}from"../atoms/Image/Image.js";import"@emotion/react/jsx-runtime";import"../../core/theme/Theme.js";import"../cta/styled.js";import h from"../cta/secondary/ButtonSecondary.js";import{StarList as s}from"../rating/starList/StarList.js";var m,c,x,f,g,w,u,v,y,z,b,j,k,S,M,C,I,L,T,D=o.div(m||(m=n(["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"],["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"]))),E=o.div(c||(c=n(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n font-size: 14px;\n line-height: 22px;\n text-align: right;\n margin-bottom: 10px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n font-size: 14px;\n line-height: 22px;\n text-align: right;\n margin-bottom: 10px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),_=o.div(x||(x=n(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),A=o.div(f||(f=n(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"]))),F=o.span(g||(g=n(["\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),H=o.div(w||(w=n(["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),N=o.h2(u||(u=n(["\n font-weight: 600;\n margin: 0;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n line-height: 28px;\n }\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n line-height: 28px;\n }\n"]))),Y=o.h3(v||(v=n(["\n font-size: 14px;\n line-height: 22px;\n margin: 10px 0 8px;\n font-weight: 600;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-size: 14px;\n line-height: 22px;\n margin: 10px 0 8px;\n font-weight: 600;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),q=o.div(y||(y=n(["\n display: none;\n\n @media (min-width: 768px) {\n display: block;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n white-space: pre-wrap;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n }\n"],["\n display: none;\n\n @media (min-width: 768px) {\n display: block;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n white-space: pre-wrap;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n }\n"]))),B=o.div(z||(z=n(["\n font-weight: normal;\n font-size: 14px;\n line-height: 22px;\n margin: 0;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n\n @media (min-width: 768px) {\n display: none;\n }\n"],["\n font-weight: normal;\n font-size: 14px;\n line-height: 22px;\n margin: 0;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n\n @media (min-width: 768px) {\n display: none;\n }\n"]))),V=o.div(b||(b=n(["\n margin-left: 10px;\n text-align: right;\n"],["\n margin-left: 10px;\n text-align: right;\n"]))),W=o.div(j||(j=n(["\n display: flex;\n justify-content: end;\n"],["\n display: flex;\n justify-content: end;\n"]))),G=o.div(k||(k=n(["\n width: 7.5rem;\n height: 4.125rem;\n"],["\n width: 7.5rem;\n height: 4.125rem;\n"]))),J=o.div(S||(S=n(["\n cursor: zoom-in;\n display: none;\n margin-right: 4px;\n\n &:first-child {\n display: inline-block;\n }\n\n & img {\n object-fit: cover;\n }\n\n @media (min-width: 1024px) {\n display: inline-block;\n }\n"],["\n cursor: zoom-in;\n display: none;\n margin-right: 4px;\n\n &:first-child {\n display: inline-block;\n }\n\n & img {\n object-fit: cover;\n }\n\n @media (min-width: 1024px) {\n display: inline-block;\n }\n"]))),K=o.div(M||(M=n(["\n display: flex;\n margin-top: ",";\n\n @media (max-width: 768px) {\n display: none;\n }\n"],["\n display: flex;\n margin-top: ",";\n\n @media (max-width: 768px) {\n display: none;\n }\n"])),(function(n){return n.showMoreDesktop?"12px":"50px"})),O=o.div(C||(C=n(["\n display: none;\n\n @media (max-width: 768px) {\n margin-top: 10px;\n display: flex;\n }\n"],["\n display: none;\n\n @media (max-width: 768px) {\n margin-top: 10px;\n display: flex;\n }\n"]))),P=o.div(I||(I=n(["\n font-size: 14px;\n line-height: 34px;\n font-weight: 600;\n color: #d4605b;\n"],["\n font-size: 14px;\n line-height: 34px;\n font-weight: 600;\n color: #d4605b;\n"]))),Q=o.i(L||(L=n(["\n content: '\f164';\n"],["\n content: '\\f164';\n"]))),R=o(h)(T||(T=n(["\n margin-right: 15px;\n"],["\n margin-right: 15px;\n"]))),U=function(n){var o=n.reviewId,h=n.reviewerName,m=n.date,c=n.dateFormat,x=void 0===c?"DDMMYY":c,f=n.rating,g=n.stars,w=n.title,u=n.description,v=n.images,y=n.reviewVariant,z=n.onClickImage,b=n.helpfulActionText,j=n.helpfulAction,k=n.helpfulCount,S=n.hasTextWhenHelpfulCount0,M=void 0!==S&&S,C=Math.random().toString(36).substring(7),I=r(u.length>168),L=I[0],T=I[1],U=r(u.length>500),X=U[0],Z=U[1];return l((function(){var n=document.querySelectorAll("#see-more-".concat(C)),i=function(){T(!1),Z(!1)};return n.forEach((function(n){n.addEventListener("click",i)})),function(){n.forEach((function(n){n.removeEventListener("click",i)}))}}),[C]),e(D,{children:[e(E,{children:[t(N,{children:h},void 0),t(F,{children:d(m,x)},void 0)]},void 0),t(s,{starsNumber:5,rating:f,fill:g.color,size:g.size},void 0),e(_,i({"data-testid":"review-content"},{children:[e(A,{children:[t(Y,{children:w},void 0),t(B,{dangerouslySetInnerHTML:{__html:L?"".concat(u.slice(0,168),'... <a id="see-more-').concat(C,'" class="see-more">See more</a>'):u}},void 0),t(q,{dangerouslySetInnerHTML:{__html:X?"".concat(u.slice(0,500),'... <a id="see-more-').concat(C,'" class="see-more">See more</a>'):u}},void 0),e(K,i({showMoreDesktop:u.length>500},{children:[b&&j&&t(R,{onClick:function(){return j(o)},text:b,size:a.Small},void 0),(k||M&&0===k)&&e(P,{children:[k," people found this helpful"]},void 0)]}),void 0)]},void 0),e(V,{children:[e(W,{children:[null==v?void 0:v.map((function(n){return t(J,i({onClick:function(){return null==z?void 0:z(n.src)}},{children:t(p,{src:n.src,alt:n.alt,height:"10rem",width:"7.5rem"},void 0)}),n.src)})),!v||0===v.length&&t(G,{},void 0)]},void 0),t(H,{children:y},void 0)]},void 0)]}),void 0),t(Q,{},void 0),e(O,{children:[b&&j&&t(R,{onClick:function(){return j(o)},text:b,size:a.Small},void 0),(k||M&&0===k)&&e(P,{children:[k," people found this helpful"]},void 0)]},void 0)]},void 0)};export{U as default};
|
|
2
2
|
//# sourceMappingURL=Review.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
var c=["January","February","March","April","May","June","July","August","September","October","November","December"];function t(t,a){var n=t.getDate(),e=t.getMonth()+1,o=t.getFullYear();switch(null!=a?a:"DDMMYY"){case"MMMMDDYY":return"".concat(c[e-1]," ").concat(n,", ").concat(o);case"DDMMYY":return"".concat(n<10?"0".concat(n):n,"/").concat(e<10?"0".concat(e):e,"/").concat(o);case"MMDDYY":return"".concat(e<10?"0".concat(e):e,"/").concat(n<10?"0".concat(n):n,"/").concat(o);case"YYMMDD":return"".concat(o,"/").concat(e<10?"0".concat(e):e,"/").concat(n<10?"0".concat(n):n)}}export{t as formatDate};
|
|
2
2
|
//# sourceMappingURL=dateFormatter.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -3761,7 +3761,7 @@ interface ReviewProps {
|
|
|
3761
3761
|
reviewId: string;
|
|
3762
3762
|
reviewerName: string;
|
|
3763
3763
|
date: Date;
|
|
3764
|
-
dateFormat?: 'DDMMYY' | 'MMDDYY' | 'YYMMDD';
|
|
3764
|
+
dateFormat?: 'DDMMYY' | 'MMDDYY' | 'YYMMDD' | 'MMMMDDYY';
|
|
3765
3765
|
rating: number;
|
|
3766
3766
|
stars: {
|
|
3767
3767
|
color: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=require("tslib"),e=require("react/jsx-runtime"),i=require("@emotion/styled"),t=require("react"),o=require("../../types/enums.js"),a=require("../../utils/dateFormatter/dateFormatter.js"),
|
|
1
|
+
"use strict";var n=require("tslib"),e=require("react/jsx-runtime"),i=require("@emotion/styled"),t=require("react"),o=require("../../types/enums.js"),a=require("../../utils/dateFormatter/dateFormatter.js"),l=require("../atoms/Image/Image.js");require("@emotion/react/jsx-runtime"),require("../../core/theme/Theme.js"),require("../cta/styled.js");var r=require("../cta/secondary/ButtonSecondary.js"),s=require("../rating/starList/StarList.js");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var p,m,c,h,x,f,u,g,w,v,j,_,y,b,z,k,T,O,S,q=d(i),C=q.default.div(p||(p=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"],["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"]))),I=q.default.div(m||(m=n.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n font-size: 14px;\n line-height: 22px;\n text-align: right;\n margin-bottom: 10px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n font-size: 14px;\n line-height: 22px;\n text-align: right;\n margin-bottom: 10px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),L=q.default.div(c||(c=n.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),M=q.default.div(h||(h=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"]))),D=q.default.span(x||(x=n.__makeTemplateObject(["\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),E=q.default.div(f||(f=n.__makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),A=q.default.h2(u||(u=n.__makeTemplateObject(["\n font-weight: 600;\n margin: 0;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n line-height: 28px;\n }\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 14px;\n line-height: 22px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n line-height: 28px;\n }\n"]))),F=q.default.h3(g||(g=n.__makeTemplateObject(["\n font-size: 14px;\n line-height: 22px;\n margin: 10px 0 8px;\n font-weight: 600;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"],["\n font-size: 14px;\n line-height: 22px;\n margin: 10px 0 8px;\n font-weight: 600;\n\n @media (min-width: 768px) {\n font-size: 16px;\n line-height: 24px;\n }\n"]))),H=q.default.div(w||(w=n.__makeTemplateObject(["\n display: none;\n\n @media (min-width: 768px) {\n display: block;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n white-space: pre-wrap;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n }\n"],["\n display: none;\n\n @media (min-width: 768px) {\n display: block;\n font-weight: normal;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n white-space: pre-wrap;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n }\n"]))),N=q.default.div(v||(v=n.__makeTemplateObject(["\n font-weight: normal;\n font-size: 14px;\n line-height: 22px;\n margin: 0;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n\n @media (min-width: 768px) {\n display: none;\n }\n"],["\n font-weight: normal;\n font-size: 14px;\n line-height: 22px;\n margin: 0;\n\n a.see-more {\n color: var(--colors-semantic-informative-color);\n text-decoration: underline;\n cursor: pointer;\n font-weight: 600;\n white-space: nowrap;\n }\n\n @media (min-width: 768px) {\n display: none;\n }\n"]))),Y=q.default.div(j||(j=n.__makeTemplateObject(["\n margin-left: 10px;\n text-align: right;\n"],["\n margin-left: 10px;\n text-align: right;\n"]))),B=q.default.div(_||(_=n.__makeTemplateObject(["\n display: flex;\n justify-content: end;\n"],["\n display: flex;\n justify-content: end;\n"]))),V=q.default.div(y||(y=n.__makeTemplateObject(["\n width: 7.5rem;\n height: 4.125rem;\n"],["\n width: 7.5rem;\n height: 4.125rem;\n"]))),W=q.default.div(b||(b=n.__makeTemplateObject(["\n cursor: zoom-in;\n display: none;\n margin-right: 4px;\n\n &:first-child {\n display: inline-block;\n }\n\n & img {\n object-fit: cover;\n }\n\n @media (min-width: 1024px) {\n display: inline-block;\n }\n"],["\n cursor: zoom-in;\n display: none;\n margin-right: 4px;\n\n &:first-child {\n display: inline-block;\n }\n\n & img {\n object-fit: cover;\n }\n\n @media (min-width: 1024px) {\n display: inline-block;\n }\n"]))),G=q.default.div(z||(z=n.__makeTemplateObject(["\n display: flex;\n margin-top: ",";\n\n @media (max-width: 768px) {\n display: none;\n }\n"],["\n display: flex;\n margin-top: ",";\n\n @media (max-width: 768px) {\n display: none;\n }\n"])),(function(n){return n.showMoreDesktop?"12px":"50px"})),J=q.default.div(k||(k=n.__makeTemplateObject(["\n display: none;\n\n @media (max-width: 768px) {\n margin-top: 10px;\n display: flex;\n }\n"],["\n display: none;\n\n @media (max-width: 768px) {\n margin-top: 10px;\n display: flex;\n }\n"]))),K=q.default.div(T||(T=n.__makeTemplateObject(["\n font-size: 14px;\n line-height: 34px;\n font-weight: 600;\n color: #d4605b;\n"],["\n font-size: 14px;\n line-height: 34px;\n font-weight: 600;\n color: #d4605b;\n"]))),P=q.default.i(O||(O=n.__makeTemplateObject(["\n content: '\f164';\n"],["\n content: '\\f164';\n"]))),Q=q.default(r)(S||(S=n.__makeTemplateObject(["\n margin-right: 15px;\n"],["\n margin-right: 15px;\n"])));module.exports=function(i){var r=i.reviewId,d=i.reviewerName,p=i.date,m=i.dateFormat,c=void 0===m?"DDMMYY":m,h=i.rating,x=i.stars,f=i.title,u=i.description,g=i.images,w=i.reviewVariant,v=i.onClickImage,j=i.helpfulActionText,_=i.helpfulAction,y=i.helpfulCount,b=i.hasTextWhenHelpfulCount0,z=void 0!==b&&b,k=Math.random().toString(36).substring(7),T=t.useState(u.length>168),O=T[0],S=T[1],q=t.useState(u.length>500),R=q[0],U=q[1];return t.useEffect((function(){var n=document.querySelectorAll("#see-more-".concat(k)),e=function(){S(!1),U(!1)};return n.forEach((function(n){n.addEventListener("click",e)})),function(){n.forEach((function(n){n.removeEventListener("click",e)}))}}),[k]),e.jsxs(C,{children:[e.jsxs(I,{children:[e.jsx(A,{children:d},void 0),e.jsx(D,{children:a.formatDate(p,c)},void 0)]},void 0),e.jsx(s.StarList,{starsNumber:5,rating:h,fill:x.color,size:x.size},void 0),e.jsxs(L,n.__assign({"data-testid":"review-content"},{children:[e.jsxs(M,{children:[e.jsx(F,{children:f},void 0),e.jsx(N,{dangerouslySetInnerHTML:{__html:O?"".concat(u.slice(0,168),'... <a id="see-more-').concat(k,'" class="see-more">See more</a>'):u}},void 0),e.jsx(H,{dangerouslySetInnerHTML:{__html:R?"".concat(u.slice(0,500),'... <a id="see-more-').concat(k,'" class="see-more">See more</a>'):u}},void 0),e.jsxs(G,n.__assign({showMoreDesktop:u.length>500},{children:[j&&_&&e.jsx(Q,{onClick:function(){return _(r)},text:j,size:o.ComponentSize.Small},void 0),(y||z&&0===y)&&e.jsxs(K,{children:[y," people found this helpful"]},void 0)]}),void 0)]},void 0),e.jsxs(Y,{children:[e.jsxs(B,{children:[null==g?void 0:g.map((function(i){return e.jsx(W,n.__assign({onClick:function(){return null==v?void 0:v(i.src)}},{children:e.jsx(l.Image,{src:i.src,alt:i.alt,height:"10rem",width:"7.5rem"},void 0)}),i.src)})),!g||0===g.length&&e.jsx(V,{},void 0)]},void 0),e.jsx(E,{children:w},void 0)]},void 0)]}),void 0),e.jsx(P,{},void 0),e.jsxs(J,{children:[j&&_&&e.jsx(Q,{onClick:function(){return _(r)},text:j,size:o.ComponentSize.Small},void 0),(y||z&&0===y)&&e.jsxs(K,{children:[y," people found this helpful"]},void 0)]},void 0)]},void 0)};
|
|
2
2
|
//# sourceMappingURL=Review.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatDate=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=["January","February","March","April","May","June","July","August","September","October","November","December"];exports.formatDate=function(t,e){var a=t.getDate(),n=t.getMonth()+1,o=t.getFullYear();switch(null!=e?e:"DDMMYY"){case"MMMMDDYY":return"".concat(c[n-1]," ").concat(a,", ").concat(o);case"DDMMYY":return"".concat(a<10?"0".concat(a):a,"/").concat(n<10?"0".concat(n):n,"/").concat(o);case"MMDDYY":return"".concat(n<10?"0".concat(n):n,"/").concat(a<10?"0".concat(a):a,"/").concat(o);case"YYMMDD":return"".concat(o,"/").concat(n<10?"0".concat(n):n,"/").concat(a<10?"0".concat(a):a)}};
|
|
2
2
|
//# sourceMappingURL=dateFormatter.js.map
|
package/package.json
CHANGED