New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@keyvaluesystems/react-star-rating-summary

Package Overview
Dependencies
Maintainers
7
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keyvaluesystems/react-star-rating-summary - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

build/index.js
/*!
*
* @keyvaluesystems/react-star-rating-summary v1.0.0
* @keyvaluesystems/react-star-rating-summary v1.0.1
* git+https://github.com/KeyValueSoftwareSystems/react-star-rating-summary

@@ -8,7 +8,7 @@ *

*
* This source code is licensed under the ISC license found in the
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports.MyLibrary=n(require("react")):e.MyLibrary=n(e.react)}(self,(e=>(()=>{"use strict";var n={410:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,".oNpxS5P9tectifMTMw0S{display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:4px}.zO_sav5ObG8srDRDKZ94{font-size:60px;font-weight:200;margin:0}.whsS67xMLmkYLLrkeaI7{display:flex;flex-direction:row;column-gap:4px}.JH7Di2rVJITJQRjN2Qxg{display:flex;flex-direction:row;justify-content:center;color:#a9a9a9;font-size:14px;min-width:104px;padding-top:4px;column-gap:4px}.Q3SVIzX3noP9rBdEy4l4{width:18px;height:18px}","",{version:3,sources:["webpack://./src/rating-average/styles.module.scss"],names:[],mappings:"AAAA,sBACE,YAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA,CACA,WAAA,CAEF,sBACE,cAAA,CACA,eAAA,CACA,QAAA,CAEF,sBACE,YAAA,CACA,kBAAA,CACA,cAAA,CAEF,sBACE,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,aAAA,CACA,cAAA,CACA,eAAA,CACA,eAAA,CACA,cAAA,CAEF,sBACE,UAAA,CACA,WAAA",sourcesContent:[".container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n row-gap: 4px;\n}\n.averageRatingValue {\n font-size: 60px;\n font-weight: 200;\n margin: 0;\n}\n.iconsWrapper {\n display: flex;\n flex-direction: row;\n column-gap: 4px;\n}\n.subTextContainer {\n display: flex;\n flex-direction: row;\n justify-content: center;\n color: #a9a9a9;\n font-size: 14px;\n min-width: 104px;\n padding-top: 4px;\n column-gap: 4px;\n}\n.starImage {\n width: 18px;\n height: 18px;\n}\n"],sourceRoot:""}]),i.locals={container:"oNpxS5P9tectifMTMw0S",averageRatingValue:"zO_sav5ObG8srDRDKZ94",iconsWrapper:"whsS67xMLmkYLLrkeaI7",subTextContainer:"JH7Di2rVJITJQRjN2Qxg",starImage:"Q3SVIzX3noP9rBdEy4l4"};const s=i},45:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,"@keyframes eZfqOwy8I0_eMYPg5825{from{width:0px}to{width:100%}}.Hkx1BjuF2wMP4lMXEGNP{width:100%;display:table-cell}.RTXc6023VVPyVQIL1qBQ{max-width:100%}.LGd9TE3TOzO4BQ8ChBjl{height:24px;overflow-x:visible;display:flex;align-items:center;width:100%}.Wpxhk6Xe6SQ0loDvb3KX{font-size:11px;line-height:17px;background-color:rgba(0,0,0,0);color:#282b0b;padding-left:8px}.ujpYuxRvsbOsX5IjQa3L{transition:width .3s ease-in-out}.UZJ21sFNb51HqFL5Pw7q{animation-name:eZfqOwy8I0_eMYPg5825;animation-duration:300ms;animation-timing-function:ease-in-out;animation-iteration-count:1}.HFOH8Fkvefg3m6uP8WT_{cursor:pointer}","",{version:3,sources:["webpack://./src/rating-distribution-item/styles.module.scss"],names:[],mappings:"AAAA,gCACE,KACE,SAAA,CAEF,GACE,UAAA,CAAA,CAGJ,sBACE,UAAA,CACA,kBAAA,CAEF,sBACE,cAAA,CAEF,sBACE,WAAA,CACA,kBAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CAEF,sBACE,cAAA,CACA,gBAAA,CACA,8BAAA,CACA,aAAA,CACA,gBAAA,CAEF,sBACE,gCAAA,CAEF,sBACE,mCAAA,CACA,wBAAA,CACA,qCAAA,CACA,2BAAA,CAEF,sBACE,cAAA",sourcesContent:["@keyframes widthAnimation {\n from {\n width: 0px;\n }\n to {\n width: 100%;\n }\n}\n.barContainer {\n width: 100%;\n display: table-cell;\n}\n.filledBarContainer {\n max-width: 100%;\n}\n.filledBar {\n height: 24px;\n overflow-x: visible;\n display: flex;\n align-items: center;\n width: 100%;\n}\n.countContainer {\n font-size: 11px;\n line-height: 17px;\n background-color: transparent;\n color: #282b0b;\n padding-left: 8px;\n}\n.transitions {\n transition: width 0.3s ease-in-out;\n}\n.animations {\n animation-name: widthAnimation;\n animation-duration: 300ms;\n animation-timing-function: ease-in-out;\n animation-iteration-count: 1;\n}\n.cursorPointer {\n cursor: pointer;\n}\n"],sourceRoot:""}]),i.locals={barContainer:"Hkx1BjuF2wMP4lMXEGNP",filledBarContainer:"RTXc6023VVPyVQIL1qBQ",filledBar:"LGd9TE3TOzO4BQ8ChBjl",countContainer:"Wpxhk6Xe6SQ0loDvb3KX",transitions:"ujpYuxRvsbOsX5IjQa3L",animations:"UZJ21sFNb51HqFL5Pw7q",widthAnimation:"eZfqOwy8I0_eMYPg5825",cursorPointer:"HFOH8Fkvefg3m6uP8WT_"};const s=i},802:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,".Kz24wLXscDomnbkEljUb{display:table-cell;padding-right:8px;white-space:nowrap;vertical-align:middle;font-size:15px;color:#919191}.KmV2vz5lSJwT26AOidds{vertical-align:middle;margin-right:4px;width:14px;height:14px}","",{version:3,sources:["webpack://./src/rating-label/styles.module.scss"],names:[],mappings:"AAAA,sBACE,kBAAA,CACA,iBAAA,CACA,kBAAA,CACA,qBAAA,CACA,cAAA,CACA,aAAA,CAGF,sBACE,qBAAA,CACA,gBAAA,CACA,UAAA,CACA,WAAA",sourcesContent:[".label {\n display: table-cell;\n padding-right: 8px;\n white-space: nowrap;\n vertical-align: middle;\n font-size: 15px;\n color: #919191;\n}\n\n.starImage {\n vertical-align: middle;\n margin-right: 4px;\n width: 14px;\n height: 14px;\n}\n"],sourceRoot:""}]),i.locals={label:"Kz24wLXscDomnbkEljUb",starImage:"KmV2vz5lSJwT26AOidds"};const s=i},292:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,".hnVseFrjhpYzH317CWPt{display:flex;align-items:center;column-gap:15px}.xBjHaCvXpytFroOTCAdX{display:table;border-spacing:0 4px;width:100%;row-gap:4px;font-family:inherit}.EBtUyiC76iZgLZO70T5T{display:table-row;width:100%;padding-bottom:4px}.EBtUyiC76iZgLZO70T5T:last-child{padding-bottom:0}","",{version:3,sources:["webpack://./src/rating-summary/styles.module.scss"],names:[],mappings:"AAAA,sBACE,YAAA,CACA,kBAAA,CACA,eAAA,CAEF,sBACE,aAAA,CACA,oBAAA,CACA,UAAA,CACA,WAAA,CACA,mBAAA,CAEF,sBACE,iBAAA,CACA,UAAA,CACA,kBAAA,CAEF,iCACE,gBAAA",sourcesContent:[".container {\n display: flex;\n align-items: center;\n column-gap: 15px;\n}\n.ratingsWrapper {\n display: table;\n border-spacing: 0 4px;\n width: 100%;\n row-gap: 4px;\n font-family: inherit;\n}\n.ratingWrapper {\n display: table-row;\n width: 100%;\n padding-bottom: 4px;\n}\n.ratingWrapper:last-child {\n padding-bottom: 0;\n}\n"],sourceRoot:""}]),i.locals={container:"hnVseFrjhpYzH317CWPt",ratingsWrapper:"xBjHaCvXpytFroOTCAdX",ratingWrapper:"EBtUyiC76iZgLZO70T5T"};const s=i},645:e=>{e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t="",a=void 0!==n[5];return n[4]&&(t+="@supports (".concat(n[4],") {")),n[2]&&(t+="@media ".concat(n[2]," {")),a&&(t+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),t+=e(n),a&&(t+="}"),n[2]&&(t+="}"),n[4]&&(t+="}"),t})).join("")},n.i=function(e,t,a,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(a)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var A=[].concat(e[c]);a&&i[A[0]]||(void 0!==o&&(void 0===A[5]||(A[1]="@layer".concat(A[5].length>0?" ".concat(A[5]):""," {").concat(A[1],"}")),A[5]=o),t&&(A[2]?(A[1]="@media ".concat(A[2]," {").concat(A[1],"}"),A[2]=t):A[2]=t),r&&(A[4]?(A[1]="@supports (".concat(A[4],") {").concat(A[1],"}"),A[4]=r):A[4]="".concat(r)),n.push(A))}},n}},537:e=>{e.exports=function(e){var n=e[1],t=e[3];if(!t)return n;if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),o="/*# ".concat(r," */");return[n].concat([o]).join("\n")}return[n].join("\n")}},379:e=>{var n=[];function t(e){for(var t=-1,a=0;a<n.length;a++)if(n[a].identifier===e){t=a;break}return t}function a(e,a){for(var o={},i=[],s=0;s<e.length;s++){var l=e[s],c=a.base?l[0]+a.base:l[0],A=o[c]||0,d="".concat(c," ").concat(A);o[c]=A+1;var u=t(d),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)n[u].references++,n[u].updater(p);else{var g=r(p,a);a.byIndex=s,n.splice(s,0,{identifier:d,updater:g,references:1})}i.push(d)}return i}function r(e,n){var t=n.domAPI(n);t.update(e);return function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap&&n.supports===e.supports&&n.layer===e.layer)return;t.update(e=n)}else t.remove()}}e.exports=function(e,r){var o=a(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var s=t(o[i]);n[s].references--}for(var l=a(e,r),c=0;c<o.length;c++){var A=t(o[c]);0===n[A].references&&(n[A].updater(),n.splice(A,1))}o=l}}},569:e=>{var n={};e.exports=function(e,t){var a=function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}},216:e=>{e.exports=function(e){var n=document.createElement("style");return e.setAttributes(n,e.attributes),e.insert(n,e.options),n}},565:(e,n,t)=>{e.exports=function(e){var n=t.nc;n&&e.setAttribute("nonce",n)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var n=e.insertStyleElement(e);return{update:function(t){!function(e,n,t){var a="";t.supports&&(a+="@supports (".concat(t.supports,") {")),t.media&&(a+="@media ".concat(t.media," {"));var r=void 0!==t.layer;r&&(a+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),a+=t.css,r&&(a+="}"),t.media&&(a+="}"),t.supports&&(a+="}");var o=t.sourceMap;o&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),n.styleTagTransform(a,e,n.options)}(n,e,t)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)}}}},589:e=>{e.exports=function(e,n){if(n.styleSheet)n.styleSheet.cssText=e;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(e))}}},156:n=>{n.exports=e}},t={};function a(e){var r=t[e];if(void 0!==r)return r.exports;var o=t[e]={id:e,exports:{}};return n[e](o,o.exports,a),o.exports}a.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return a.d(n,{a:n}),n},a.d=(e,n)=>{for(var t in n)a.o(n,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},a.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var r={};return(()=>{a.r(r),a.d(r,{default:()=>Q});var e=a(156),n=a.n(e);var t,o;!function(e){e.Root="Root",e.SummaryContainer="SummaryContainer",e.AverageContainer="AverageContainer",e.Average="Average",e.AverageIconsWrapper="AverageIconsWrapper",e.AverageStarIcon="AverageStarIcon",e.AverageSubTextContainer="AverageSubTextContainer",e.AverageTotalReviews="AverageTotalReviews",e.AverageSubText="AverageSubText"}(t||(t={})),function(e){e.SummaryItemContainer="SummaryItemContainer",e.BarContainer="BarContainer",e.FilledBarContainer="FilledBarContainer",e.Bar="Bar",e.Count="Count",e.Label="Label",e.LabelStarIcon="LabelStarIcon"}(o||(o={}));var i=/\B(?=(\d{3})+(?!\d))/g,s={1:"#ff8b5a",2:"#ffb337",3:"#ffd834",4:"#add633",5:"#9fc05a"},l=function(e,n){return void 0===n&&(n=","),e.toString().replace(i,n)},c=function(e,n,t){var a=e[n];return a?a(t):{}},A=function(e){return Object.values(e).reduce((function(e,n){return e+(n||0)}))},d=function(e,n){var t=Object.entries(e).reduce((function(e,t){var a=t[0],r=t[1];return e+(n[a]||0)*Number(r)}),0),a=A(e);return a?t/a:0},u=a(379),p=a.n(u),g=a(795),C=a.n(g),m=a(569),f=a.n(m),v=a(565),y=a.n(v),b=a(216),h=a.n(b),x=a(589),w=a.n(x),E=a(802),I={};I.styleTagTransform=w(),I.setAttributes=y(),I.insert=f().bind(null,"head"),I.domAPI=C(),I.insertStyleElement=h();p()(E.Z,I);const B=E.Z&&E.Z.locals?E.Z.locals:void 0;const T=function(e){var t=e.ratingId,a=e.styles;return n().createElement("div",{className:B.label,id:"".concat(t,"-label"),style:c(a,o.Label,t)},n().createElement("img",{className:B.starImage,style:c(a,o.LabelStarIcon,t),src:"data:image/svg+xml;base64,ICAgICAgPHN2ZwogICAgICB3aWR0aD0iMTAwJSIKICAgICAgaGVpZ2h0PSJhdXRvIgogICAgICB2aWV3Qm94PSIwIDAgMzIgMzIiCiAgICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgICAgaWQ9Im15Q2lyY2xlIgogICAgPgogICAgICA8cGF0aAogICAgICBmaWxsPSIjOTE5MTkxIgogICAgICAgIGQ9Ik0yMC4zODgsMTAuOTE4TDMyLDEyLjExOGwtOC43MzUsNy43NDlMMjUuOTE0LDMxLjRsLTkuODkzLTYuMDg4TDYuMTI3LDMxLjRsMi42OTUtMTEuNTMzTDAsMTIuMTE4CiAgbDExLjU0Ny0xLjJMMTYuMDI2LDAuNkwyMC4zODgsMTAuOTE4eiIKICAgICAgLz4KICAgIDwvc3ZnPgo=",alt:""}),t)};var S=a(45),M={};M.styleTagTransform=w(),M.setAttributes=y(),M.insert=f().bind(null,"head"),M.domAPI=C(),M.insertStyleElement=h();p()(S.Z,M);const L=S.Z&&S.Z.locals?S.Z.locals:void 0;var F=function(){return F=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},F.apply(this,arguments)};const O=function(e){var t=e.currentRatingId,a=e.currentRatingValue,r=e.totalRatingCount,i=e.showCount,A=e.showAnimation,d=e.styles,u=void 0===d?{}:d,p=e.barColors,g=e.onBarClick,C=e.thousandsSeparator,m=(a||0)/r*100;return n().createElement("div",{className:L.barContainer,style:c(u,o.BarContainer,t)},n().createElement("div",F({style:F({width:"".concat(m,"%")},c(u,o.FilledBarContainer,t)),className:"".concat(L.filledBarContainer,"\n ").concat(A&&L.transitions,"\n ").concat(g&&L.cursorPointer),id:"".concat(t,"-bar")},g&&{role:"presentation",onClick:function(){return g(t)}}),n().createElement("div",{id:"".concat(t,"-inner-bar"),style:F({backgroundColor:(null==p?void 0:p[t])?p[t]:!isNaN(parseFloat(t))&&s[Number(t)]?s[Number(t)]:s[1]},c(u,o.Bar,t)),className:"".concat(L.filledBar," ").concat(A&&L.animations)},i&&n().createElement("span",{className:L.countContainer,style:c(u,o.Count,t),id:"".concat(t,"-count")},l(a,C)))))};const k=function(e){var t=e.fillColor,a=e.bgColor,r=e.colorFilledFraction,o=e.id;return n().createElement("svg",{width:"100%",height:"auto",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},n().createElement("defs",null,n().createElement("linearGradient",{id:o,shapeRendering:"crispEdges"},n().createElement("stop",{offset:r,stopColor:t}),n().createElement("stop",{offset:"0%",stopColor:a}))),n().createElement("path",{fill:"url(#".concat(o,")"),d:"M20.388,10.918L32,12.118l-8.735,7.749L25.914,31.4l-9.893-6.088L6.127,31.4l2.695-11.533L0,12.118\n l11.547-1.2L16.026,0.6L20.388,10.918z"}))};var j=a(410),P={};P.styleTagTransform=w(),P.setAttributes=y(),P.insert=f().bind(null,"head"),P.domAPI=C(),P.insertStyleElement=h();p()(j.Z,P);const N=j.Z&&j.Z.locals?j.Z.locals:void 0;var R={fillColor:"#919191",bgColor:"#F2F2F2"};const Z=function(e){var a,r=e.ratings,o=e.ranks,i=void 0===o?{}:o,s=e.customAverageFn,c=void 0===s?d:s,u=e.averageRatingPrecision,p=e.iconProps,g=e.styles,C=void 0===g?{}:g,m=e.thousandsSeparator,f=e.ratingAverageSubText,v=p||{},y=v.fillColor,b=void 0===y?R.fillColor:y,h=v.bgColor,x=void 0===h?R.bgColor:h,w=c(r,i),E=A(r),I=function(e){var n=Math.max.apply(Math,Object.values(i)),t=Number(e.toString().split(".")[0]),a=e-t;return[n-Math.ceil(e),t,a]}(w),B=I[0],T=I[1],S=I[2];return n().createElement("div",{className:N.container,style:C[t.AverageContainer]},n().createElement("div",{className:N.averageRatingValue,style:C[t.Average]},(a=u,w.toFixed(a))),n().createElement("div",{className:N.iconsWrapper,style:C[t.AverageIconsWrapper]},Array(T).fill(0).map((function(e,a){return n().createElement("div",{key:"completely-filled-star-".concat(a),className:N.starImage,style:C[t.AverageStarIcon]},n().createElement(k,{fillColor:b,bgColor:x,colorFilledFraction:1,id:"completely-filled-star-".concat(a)}))})),Boolean(S)&&n().createElement("div",{key:"fraction-filled-star",className:N.starImage,style:C[t.AverageStarIcon]},n().createElement(k,{fillColor:b,bgColor:x,colorFilledFraction:S,id:"fraction-filled-star"})),Array(B).fill(0).map((function(e,a){return n().createElement("div",{key:"unfilled-star-".concat(a),className:N.starImage,style:C[t.AverageStarIcon]},n().createElement(k,{fillColor:b,bgColor:x,colorFilledFraction:0,id:"unfilled-star-".concat(a)}))}))),n().createElement("div",{className:N.subTextContainer,style:C[t.AverageSubTextContainer]},n().createElement("div",{style:C[t.AverageTotalReviews]},l(E,m)),n().createElement("div",{style:C[t.AverageSubText]},f)))};var z=a(292),D={};D.styleTagTransform=w(),D.setAttributes=y(),D.insert=f().bind(null,"head"),D.domAPI=C(),D.insertStyleElement=h();p()(z.Z,D);const W=z.Z&&z.Z.locals?z.Z.locals:void 0;var U=function(){return U=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},U.apply(this,arguments)};const Q=function(e){var a=e.ratings,r=e.ratingRanks,i=void 0===r?{}:r,s=e.renderLabel,l=e.showCount,d=void 0===l||l,u=e.showAnimation,p=void 0===u||u,g=e.styles,C=void 0===g?{}:g,m=e.barColors,f=e.onBarClick,v=e.showAverageRating,y=void 0===v||v,b=e.customAverageFn,h=e.averageRatingPrecision,x=void 0===h?1:h,w=e.ratingAverageIconProps,E=void 0===w?{}:w,I=e.thousandsSeparator,B=e.ratingAverageSubText,S=void 0===B?"reviews":B,M=Object.keys(i).length?i:Object.keys(a).reduce((function(e,n,t){var a;return U(U({},e),((a={})[n]=t+1,a))}),{});return n().createElement("div",{className:W.container,style:C[t.Root]},y&&n().createElement(Z,{ratings:a,ranks:M,customAverageFn:b,averageRatingPrecision:x,iconProps:E,styles:C,thousandsSeparator:I,ratingAverageSubText:S}),n().createElement("div",{className:W.ratingsWrapper,style:C[t.SummaryContainer],id:"ratings-container"},Object.keys(a).reverse().map((function(e){return n().createElement("div",{key:e,className:W.ratingWrapper,style:c(C,o.SummaryItemContainer,e)},s&&n().createElement(n().Fragment,null,s(e))||n().createElement(T,{ratingId:e,styles:C}),n().createElement(O,{currentRatingId:e,currentRatingValue:a[e],totalRatingCount:A(a),showCount:d,showAnimation:p,styles:C,barColors:m,onBarClick:f,thousandsSeparator:I}))}))))}})(),r})()));
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports["React Star Rating Summary"]=n(require("react")):e["React Star Rating Summary"]=n(e.react)}(this,(e=>(()=>{"use strict";var n={410:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,".oNpxS5P9tectifMTMw0S{display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:4px}.zO_sav5ObG8srDRDKZ94{font-size:60px;font-weight:200;margin:0}.whsS67xMLmkYLLrkeaI7{display:flex;flex-direction:row;column-gap:4px}.JH7Di2rVJITJQRjN2Qxg{display:flex;flex-direction:row;justify-content:center;color:#a9a9a9;font-size:14px;min-width:104px;padding-top:4px;column-gap:4px}.Q3SVIzX3noP9rBdEy4l4{width:18px;height:18px}","",{version:3,sources:["webpack://./src/rating-average/styles.module.scss"],names:[],mappings:"AAAA,sBACE,YAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA,CACA,WAAA,CAEF,sBACE,cAAA,CACA,eAAA,CACA,QAAA,CAEF,sBACE,YAAA,CACA,kBAAA,CACA,cAAA,CAEF,sBACE,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,aAAA,CACA,cAAA,CACA,eAAA,CACA,eAAA,CACA,cAAA,CAEF,sBACE,UAAA,CACA,WAAA",sourcesContent:[".container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n row-gap: 4px;\n}\n.averageRatingValue {\n font-size: 60px;\n font-weight: 200;\n margin: 0;\n}\n.iconsWrapper {\n display: flex;\n flex-direction: row;\n column-gap: 4px;\n}\n.subTextContainer {\n display: flex;\n flex-direction: row;\n justify-content: center;\n color: #a9a9a9;\n font-size: 14px;\n min-width: 104px;\n padding-top: 4px;\n column-gap: 4px;\n}\n.starImage {\n width: 18px;\n height: 18px;\n}\n"],sourceRoot:""}]),i.locals={container:"oNpxS5P9tectifMTMw0S",averageRatingValue:"zO_sav5ObG8srDRDKZ94",iconsWrapper:"whsS67xMLmkYLLrkeaI7",subTextContainer:"JH7Di2rVJITJQRjN2Qxg",starImage:"Q3SVIzX3noP9rBdEy4l4"};const s=i},45:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,"@keyframes eZfqOwy8I0_eMYPg5825{from{width:0px}to{width:100%}}.Hkx1BjuF2wMP4lMXEGNP{width:100%;display:table-cell}.RTXc6023VVPyVQIL1qBQ{max-width:100%}.LGd9TE3TOzO4BQ8ChBjl{height:24px;overflow-x:visible;display:flex;align-items:center;width:100%}.Wpxhk6Xe6SQ0loDvb3KX{font-size:11px;line-height:17px;background-color:rgba(0,0,0,0);color:#282b0b;padding-left:8px}.ujpYuxRvsbOsX5IjQa3L{transition:width .3s ease-in-out}.UZJ21sFNb51HqFL5Pw7q{animation-name:eZfqOwy8I0_eMYPg5825;animation-duration:300ms;animation-timing-function:ease-in-out;animation-iteration-count:1}.HFOH8Fkvefg3m6uP8WT_{cursor:pointer}","",{version:3,sources:["webpack://./src/rating-distribution-item/styles.module.scss"],names:[],mappings:"AAAA,gCACE,KACE,SAAA,CAEF,GACE,UAAA,CAAA,CAGJ,sBACE,UAAA,CACA,kBAAA,CAEF,sBACE,cAAA,CAEF,sBACE,WAAA,CACA,kBAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CAEF,sBACE,cAAA,CACA,gBAAA,CACA,8BAAA,CACA,aAAA,CACA,gBAAA,CAEF,sBACE,gCAAA,CAEF,sBACE,mCAAA,CACA,wBAAA,CACA,qCAAA,CACA,2BAAA,CAEF,sBACE,cAAA",sourcesContent:["@keyframes widthAnimation {\n from {\n width: 0px;\n }\n to {\n width: 100%;\n }\n}\n.barContainer {\n width: 100%;\n display: table-cell;\n}\n.filledBarContainer {\n max-width: 100%;\n}\n.filledBar {\n height: 24px;\n overflow-x: visible;\n display: flex;\n align-items: center;\n width: 100%;\n}\n.countContainer {\n font-size: 11px;\n line-height: 17px;\n background-color: transparent;\n color: #282b0b;\n padding-left: 8px;\n}\n.transitions {\n transition: width 0.3s ease-in-out;\n}\n.animations {\n animation-name: widthAnimation;\n animation-duration: 300ms;\n animation-timing-function: ease-in-out;\n animation-iteration-count: 1;\n}\n.cursorPointer {\n cursor: pointer;\n}\n"],sourceRoot:""}]),i.locals={barContainer:"Hkx1BjuF2wMP4lMXEGNP",filledBarContainer:"RTXc6023VVPyVQIL1qBQ",filledBar:"LGd9TE3TOzO4BQ8ChBjl",countContainer:"Wpxhk6Xe6SQ0loDvb3KX",transitions:"ujpYuxRvsbOsX5IjQa3L",animations:"UZJ21sFNb51HqFL5Pw7q",widthAnimation:"eZfqOwy8I0_eMYPg5825",cursorPointer:"HFOH8Fkvefg3m6uP8WT_"};const s=i},802:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,".Kz24wLXscDomnbkEljUb{display:table-cell;padding-right:8px;white-space:nowrap;vertical-align:middle;font-size:15px;color:#919191}.KmV2vz5lSJwT26AOidds{vertical-align:middle;margin-right:4px;width:14px;height:14px}","",{version:3,sources:["webpack://./src/rating-label/styles.module.scss"],names:[],mappings:"AAAA,sBACE,kBAAA,CACA,iBAAA,CACA,kBAAA,CACA,qBAAA,CACA,cAAA,CACA,aAAA,CAGF,sBACE,qBAAA,CACA,gBAAA,CACA,UAAA,CACA,WAAA",sourcesContent:[".label {\n display: table-cell;\n padding-right: 8px;\n white-space: nowrap;\n vertical-align: middle;\n font-size: 15px;\n color: #919191;\n}\n\n.starImage {\n vertical-align: middle;\n margin-right: 4px;\n width: 14px;\n height: 14px;\n}\n"],sourceRoot:""}]),i.locals={label:"Kz24wLXscDomnbkEljUb",starImage:"KmV2vz5lSJwT26AOidds"};const s=i},292:(e,n,t)=>{t.d(n,{Z:()=>s});var a=t(537),r=t.n(a),o=t(645),i=t.n(o)()(r());i.push([e.id,".hnVseFrjhpYzH317CWPt{display:flex;align-items:center;column-gap:15px}.xBjHaCvXpytFroOTCAdX{display:table;border-spacing:0 4px;width:100%;row-gap:4px;font-family:inherit}.EBtUyiC76iZgLZO70T5T{display:table-row;width:100%;padding-bottom:4px}.EBtUyiC76iZgLZO70T5T:last-child{padding-bottom:0}","",{version:3,sources:["webpack://./src/rating-summary/styles.module.scss"],names:[],mappings:"AAAA,sBACE,YAAA,CACA,kBAAA,CACA,eAAA,CAEF,sBACE,aAAA,CACA,oBAAA,CACA,UAAA,CACA,WAAA,CACA,mBAAA,CAEF,sBACE,iBAAA,CACA,UAAA,CACA,kBAAA,CAEF,iCACE,gBAAA",sourcesContent:[".container {\n display: flex;\n align-items: center;\n column-gap: 15px;\n}\n.ratingsWrapper {\n display: table;\n border-spacing: 0 4px;\n width: 100%;\n row-gap: 4px;\n font-family: inherit;\n}\n.ratingWrapper {\n display: table-row;\n width: 100%;\n padding-bottom: 4px;\n}\n.ratingWrapper:last-child {\n padding-bottom: 0;\n}\n"],sourceRoot:""}]),i.locals={container:"hnVseFrjhpYzH317CWPt",ratingsWrapper:"xBjHaCvXpytFroOTCAdX",ratingWrapper:"EBtUyiC76iZgLZO70T5T"};const s=i},645:e=>{e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t="",a=void 0!==n[5];return n[4]&&(t+="@supports (".concat(n[4],") {")),n[2]&&(t+="@media ".concat(n[2]," {")),a&&(t+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),t+=e(n),a&&(t+="}"),n[2]&&(t+="}"),n[4]&&(t+="}"),t})).join("")},n.i=function(e,t,a,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(a)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var A=[].concat(e[c]);a&&i[A[0]]||(void 0!==o&&(void 0===A[5]||(A[1]="@layer".concat(A[5].length>0?" ".concat(A[5]):""," {").concat(A[1],"}")),A[5]=o),t&&(A[2]?(A[1]="@media ".concat(A[2]," {").concat(A[1],"}"),A[2]=t):A[2]=t),r&&(A[4]?(A[1]="@supports (".concat(A[4],") {").concat(A[1],"}"),A[4]=r):A[4]="".concat(r)),n.push(A))}},n}},537:e=>{e.exports=function(e){var n=e[1],t=e[3];if(!t)return n;if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),o="/*# ".concat(r," */");return[n].concat([o]).join("\n")}return[n].join("\n")}},379:e=>{var n=[];function t(e){for(var t=-1,a=0;a<n.length;a++)if(n[a].identifier===e){t=a;break}return t}function a(e,a){for(var o={},i=[],s=0;s<e.length;s++){var l=e[s],c=a.base?l[0]+a.base:l[0],A=o[c]||0,d="".concat(c," ").concat(A);o[c]=A+1;var u=t(d),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)n[u].references++,n[u].updater(p);else{var g=r(p,a);a.byIndex=s,n.splice(s,0,{identifier:d,updater:g,references:1})}i.push(d)}return i}function r(e,n){var t=n.domAPI(n);t.update(e);return function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap&&n.supports===e.supports&&n.layer===e.layer)return;t.update(e=n)}else t.remove()}}e.exports=function(e,r){var o=a(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var s=t(o[i]);n[s].references--}for(var l=a(e,r),c=0;c<o.length;c++){var A=t(o[c]);0===n[A].references&&(n[A].updater(),n.splice(A,1))}o=l}}},569:e=>{var n={};e.exports=function(e,t){var a=function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}},216:e=>{e.exports=function(e){var n=document.createElement("style");return e.setAttributes(n,e.attributes),e.insert(n,e.options),n}},565:(e,n,t)=>{e.exports=function(e){var n=t.nc;n&&e.setAttribute("nonce",n)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var n=e.insertStyleElement(e);return{update:function(t){!function(e,n,t){var a="";t.supports&&(a+="@supports (".concat(t.supports,") {")),t.media&&(a+="@media ".concat(t.media," {"));var r=void 0!==t.layer;r&&(a+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),a+=t.css,r&&(a+="}"),t.media&&(a+="}"),t.supports&&(a+="}");var o=t.sourceMap;o&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),n.styleTagTransform(a,e,n.options)}(n,e,t)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)}}}},589:e=>{e.exports=function(e,n){if(n.styleSheet)n.styleSheet.cssText=e;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(e))}}},156:n=>{n.exports=e}},t={};function a(e){var r=t[e];if(void 0!==r)return r.exports;var o=t[e]={id:e,exports:{}};return n[e](o,o.exports,a),o.exports}a.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return a.d(n,{a:n}),n},a.d=(e,n)=>{for(var t in n)a.o(n,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},a.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var r={};return(()=>{a.r(r),a.d(r,{default:()=>Q});var e=a(156),n=a.n(e);var t,o;!function(e){e.Root="Root",e.SummaryContainer="SummaryContainer",e.AverageContainer="AverageContainer",e.Average="Average",e.AverageIconsWrapper="AverageIconsWrapper",e.AverageStarIcon="AverageStarIcon",e.AverageSubTextContainer="AverageSubTextContainer",e.AverageTotalReviews="AverageTotalReviews",e.AverageSubText="AverageSubText"}(t||(t={})),function(e){e.SummaryItemContainer="SummaryItemContainer",e.BarContainer="BarContainer",e.FilledBarContainer="FilledBarContainer",e.Bar="Bar",e.Count="Count",e.Label="Label",e.LabelStarIcon="LabelStarIcon"}(o||(o={}));var i=/\B(?=(\d{3})+(?!\d))/g,s={1:"#ff8b5a",2:"#ffb337",3:"#ffd834",4:"#add633",5:"#9fc05a"},l=function(e,n){return void 0===n&&(n=","),e.toString().replace(i,n)},c=function(e,n,t){var a=e[n];return a?a(t):{}},A=function(e){return Object.values(e).reduce((function(e,n){return e+(n||0)}))},d=function(e,n){var t=Object.entries(e).reduce((function(e,t){var a=t[0],r=t[1];return e+(n[a]||0)*Number(r)}),0),a=A(e);return a?t/a:0},u=a(379),p=a.n(u),g=a(795),C=a.n(g),m=a(569),f=a.n(m),v=a(565),y=a.n(v),h=a(216),b=a.n(h),x=a(589),w=a.n(x),E=a(802),I={};I.styleTagTransform=w(),I.setAttributes=y(),I.insert=f().bind(null,"head"),I.domAPI=C(),I.insertStyleElement=b();p()(E.Z,I);const B=E.Z&&E.Z.locals?E.Z.locals:void 0;const T=function(e){var t=e.ratingId,a=e.styles;return n().createElement("div",{className:B.label,id:"".concat(t,"-label"),style:c(a,o.Label,t)},n().createElement("img",{className:B.starImage,style:c(a,o.LabelStarIcon,t),src:"data:image/svg+xml;base64,ICAgICAgPHN2ZwogICAgICB3aWR0aD0iMTAwJSIKICAgICAgaGVpZ2h0PSJhdXRvIgogICAgICB2aWV3Qm94PSIwIDAgMzIgMzIiCiAgICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgICAgaWQ9Im15Q2lyY2xlIgogICAgPgogICAgICA8cGF0aAogICAgICBmaWxsPSIjOTE5MTkxIgogICAgICAgIGQ9Ik0yMC4zODgsMTAuOTE4TDMyLDEyLjExOGwtOC43MzUsNy43NDlMMjUuOTE0LDMxLjRsLTkuODkzLTYuMDg4TDYuMTI3LDMxLjRsMi42OTUtMTEuNTMzTDAsMTIuMTE4CiAgbDExLjU0Ny0xLjJMMTYuMDI2LDAuNkwyMC4zODgsMTAuOTE4eiIKICAgICAgLz4KICAgIDwvc3ZnPgo=",alt:""}),t)};var S=a(45),M={};M.styleTagTransform=w(),M.setAttributes=y(),M.insert=f().bind(null,"head"),M.domAPI=C(),M.insertStyleElement=b();p()(S.Z,M);const F=S.Z&&S.Z.locals?S.Z.locals:void 0;var O=function(){return O=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},O.apply(this,arguments)};const k=function(e){var t=e.currentRatingId,a=e.currentRatingValue,r=e.totalRatingCount,i=e.showCount,A=e.showAnimation,d=e.styles,u=void 0===d?{}:d,p=e.barColors,g=e.onBarClick,C=e.thousandsSeparator,m=(a||0)/r*100;return n().createElement("div",{className:F.barContainer,style:c(u,o.BarContainer,t)},n().createElement("div",O({style:O({width:"".concat(m,"%")},c(u,o.FilledBarContainer,t)),className:"".concat(F.filledBarContainer,"\n ").concat(A&&F.transitions,"\n ").concat(g&&F.cursorPointer),id:"".concat(t,"-bar")},g&&{role:"presentation",onClick:function(){return g(t)}}),n().createElement("div",{id:"".concat(t,"-inner-bar"),style:O({backgroundColor:(null==p?void 0:p[t])?p[t]:!isNaN(parseFloat(t))&&s[Number(t)]?s[Number(t)]:s[1]},c(u,o.Bar,t)),className:"".concat(F.filledBar," ").concat(A&&F.animations)},i&&n().createElement("span",{className:F.countContainer,style:c(u,o.Count,t),id:"".concat(t,"-count")},l(a,C)))))};const L=function(e){var t=e.fillColor,a=e.bgColor,r=e.colorFilledFraction,o=e.id;return n().createElement("svg",{width:"100%",height:"auto",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},n().createElement("defs",null,n().createElement("linearGradient",{id:o,shapeRendering:"crispEdges"},n().createElement("stop",{offset:r,stopColor:t}),n().createElement("stop",{offset:"0%",stopColor:a}))),n().createElement("path",{fill:"url(#".concat(o,")"),d:"M20.388,10.918L32,12.118l-8.735,7.749L25.914,31.4l-9.893-6.088L6.127,31.4l2.695-11.533L0,12.118\n l11.547-1.2L16.026,0.6L20.388,10.918z"}))};var j=a(410),P={};P.styleTagTransform=w(),P.setAttributes=y(),P.insert=f().bind(null,"head"),P.domAPI=C(),P.insertStyleElement=b();p()(j.Z,P);const R=j.Z&&j.Z.locals?j.Z.locals:void 0;var N={fillColor:"#919191",bgColor:"#F2F2F2"};const Z=function(e){var a,r=e.ratings,o=e.ranks,i=void 0===o?{}:o,s=e.customAverageFn,c=void 0===s?d:s,u=e.averageRatingPrecision,p=e.iconProps,g=e.styles,C=void 0===g?{}:g,m=e.thousandsSeparator,f=e.ratingAverageSubText,v=p||{},y=v.fillColor,h=void 0===y?N.fillColor:y,b=v.bgColor,x=void 0===b?N.bgColor:b,w=c(r,i),E=A(r),I=function(e){var n=Math.max.apply(Math,Object.values(i)),t=Number(e.toString().split(".")[0]),a=e-t;return[n-Math.ceil(e),t,a]}(w),B=I[0],T=I[1],S=I[2];return n().createElement("div",{className:R.container,style:C[t.AverageContainer]},n().createElement("div",{className:R.averageRatingValue,style:C[t.Average]},(a=u,w.toFixed(a))),n().createElement("div",{className:R.iconsWrapper,style:C[t.AverageIconsWrapper]},Array(T).fill(0).map((function(e,a){return n().createElement("div",{key:"completely-filled-star-".concat(a),className:R.starImage,style:C[t.AverageStarIcon]},n().createElement(L,{fillColor:h,bgColor:x,colorFilledFraction:1,id:"completely-filled-star-".concat(a)}))})),Boolean(S)&&n().createElement("div",{key:"fraction-filled-star",className:R.starImage,style:C[t.AverageStarIcon]},n().createElement(L,{fillColor:h,bgColor:x,colorFilledFraction:S,id:"fraction-filled-star"})),Array(B).fill(0).map((function(e,a){return n().createElement("div",{key:"unfilled-star-".concat(a),className:R.starImage,style:C[t.AverageStarIcon]},n().createElement(L,{fillColor:h,bgColor:x,colorFilledFraction:0,id:"unfilled-star-".concat(a)}))}))),n().createElement("div",{className:R.subTextContainer,style:C[t.AverageSubTextContainer]},n().createElement("div",{style:C[t.AverageTotalReviews]},l(E,m)),n().createElement("div",{style:C[t.AverageSubText]},f)))};var z=a(292),D={};D.styleTagTransform=w(),D.setAttributes=y(),D.insert=f().bind(null,"head"),D.domAPI=C(),D.insertStyleElement=b();p()(z.Z,D);const W=z.Z&&z.Z.locals?z.Z.locals:void 0;var U=function(){return U=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},U.apply(this,arguments)};const Q=function(e){var a=e.ratings,r=e.ratingRanks,i=void 0===r?{}:r,s=e.renderLabel,l=e.showCount,d=void 0===l||l,u=e.showAnimation,p=void 0===u||u,g=e.styles,C=void 0===g?{}:g,m=e.barColors,f=e.onBarClick,v=e.showAverageRating,y=void 0===v||v,h=e.customAverageFn,b=e.averageRatingPrecision,x=void 0===b?1:b,w=e.ratingAverageIconProps,E=void 0===w?{}:w,I=e.thousandsSeparator,B=e.ratingAverageSubText,S=void 0===B?"reviews":B,M=Object.keys(i).length?i:Object.keys(a).reduce((function(e,n,t){var a;return U(U({},e),((a={})[n]=t+1,a))}),{});return n().createElement("div",{className:W.container,style:C[t.Root]},y&&n().createElement(Z,{ratings:a,ranks:M,customAverageFn:h,averageRatingPrecision:x,iconProps:E,styles:C,thousandsSeparator:I,ratingAverageSubText:S}),n().createElement("div",{className:W.ratingsWrapper,style:C[t.SummaryContainer],id:"ratings-container"},Object.keys(a).reverse().map((function(e){return n().createElement("div",{key:e,className:W.ratingWrapper,style:c(C,o.SummaryItemContainer,e)},s&&n().createElement(n().Fragment,null,s(e))||n().createElement(T,{ratingId:e,styles:C}),n().createElement(k,{currentRatingId:e,currentRatingValue:a[e],totalRatingCount:A(a),showCount:d,showAnimation:p,styles:C,barColors:m,onBarClick:f,thousandsSeparator:I}))}))))}})(),r})()));
//# sourceMappingURL=index.js.map
{
"name": "@keyvaluesystems/react-star-rating-summary",
"version": "1.0.0",
"version": "1.0.1",
"description": "A ready to use rating summary component",

@@ -27,3 +27,3 @@ "main": "build/index.js",

"author": "Keyvalue",
"license": "ISC",
"license": "MIT",
"homepage": "https://github.com/KeyValueSoftwareSystems/react-star-rating-summary",

@@ -30,0 +30,0 @@ "keywords": [

@@ -73,7 +73,2 @@

```jsx
const stylesOverride = {
Chart: (ratingId) => ({...styles}),
Count: (ratingId) => ({...styles})
};
<RatingSummary

@@ -88,3 +83,6 @@ ratings={ratingValues}

}}
styles={stylesOverride}
styles={{
Chart: (ratingId) => ({...styles}),
Count: (ratingId) => ({...styles})
}}
/>

@@ -96,7 +94,2 @@ ```

```jsx
const stylesOverride = {
Bar: (ratingId) => ({...styles}),
Count: (ratingId) => ({...styles})
};
<RatingSummary

@@ -111,3 +104,6 @@ ratings={ratingValues}

}}
styles={stylesOverride}
styles={{
Bar: (ratingId) => ({...styles}),
Count: (ratingId) => ({...styles})
}}
/>

@@ -257,10 +253,2 @@ ```

const ratings = {
1: 100,
2: 200,
3: 300,
4: 400,
5: 500
};
const countColors = {

@@ -274,20 +262,24 @@ 1: 'red',

const stylesOverride = {
Average: { color: 'purple' },
AverageStarIcon: {
width: '20px',
height: '20px'
},
LabelStarIcon: () => ({
width: '15px',
height: '15px'
}),
Label: (ratingId) => ({ fontSize: '12px' }),
Count: (ratingId) => ({color: countColors[ratingId]})
};
return (
<RatingSummary
ratings={ratings}
styles={stylesOverride}
ratings={{
1: 100,
2: 200,
3: 300,
4: 400,
5: 500
}}
styles={{
Average: { color: 'purple' },
AverageStarIcon: {
width: '20px',
height: '20px'
},
LabelStarIcon: () => ({
width: '15px',
height: '15px'
}),
Label: (ratingId) => ({ fontSize: '12px' }),
Count: (ratingId) => ({color: countColors[ratingId]})
}}
/>

@@ -331,35 +323,5 @@ );

const ratings = {
1: 100,
2: 200,
3: 300,
4: 400,
5: 500
};
const countColors = {
1: 'red',
2: 'yellow',
3: 'blue',
4: 'orange',
5: 'white'
};
const stylesOverride = {
Average: { color: 'purple' },
AverageStarIcon: {
width: '20px',
height: '20px'
},
LabelStarIcon: () => ({
width: '15px',
height: '15px'
}),
Label: (ratingId) => ({ fontSize: '12px' }),
Count: (ratingId) => ({color: countColors[ratingId]})
};
return (
<RatingSummary
ratings={ratings}
ratings={ratingValues}
showAnimation={false}

@@ -366,0 +328,0 @@ showCount={false}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc