Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-custom-ratings

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-custom-ratings - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

src/components/ProgressBar/progressBar.css

1

dist/components/ProgressBar/ProgressBar.d.ts
/// <reference types="react" />
import { ProgressBarProps } from '../../Types/ProgressBar';
import './progressBar.css';
declare function RatingBars(props: ProgressBarProps): JSX.Element;
export default RatingBars;
import React from 'react';
import './filled.css';
import { Data } from '../../../Types/Data';

@@ -3,0 +4,0 @@ interface Props {

/// <reference types="react" />
import './starRating.css';
import { RatingHeaderType } from '../../Types/RatingHeader';
declare function StarRating(props: RatingHeaderType): JSX.Element;
export default StarRating;
/// <reference types="react" />
import './ratings.css';
import { RatingsProps } from '../../Types/Ratings';
declare const Ratings: ({ data, options }: RatingsProps) => JSX.Element;
export default Ratings;

38

dist/react-custom-ratings.cjs.development.js

@@ -10,4 +10,2 @@ 'use strict';

var classes = {"filled":"filled-module_filled__7APsd","star":"filled-module_star__DjRcp"};
var clsx = function clsx() {

@@ -44,3 +42,3 @@ for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {

return React.createElement("div", {
className: classes.filled,
className: 'filled',
style: {

@@ -52,3 +50,3 @@ width: width

key: "unfilled-star custom icon " + i,
className: clsx(classes.star, ratingIconClassname),
className: clsx('star', ratingIconClassname),
style: {

@@ -61,3 +59,3 @@ color: filledColor || starColors.filled

var classes$1 = {"unfilled":"Unfilled-module_unfilled__2wGJ3","filled":"Unfilled-module_filled__-I2up"};
var classes = {"unfilled":"Unfilled-module_unfilled__2wGJ3","filled":"Unfilled-module_filled__-I2up"};

@@ -79,3 +77,3 @@ /*eslint-disable*/

return React.createElement("div", {
className: classes$1.unfilled
className: classes.unfilled
}, [].concat(Array(numberOfRating)).map(function (_, i) {

@@ -85,3 +83,3 @@ return React.createElement("span", {

// eslint-disable-next-line no-unneeded-ternary
className: clsx(classes$1.star, ratingIconClassname),
className: clsx(classes.star, ratingIconClassname),
style: {

@@ -101,4 +99,2 @@ // eslint-disable-next-line no-unneeded-ternary

var classes$2 = {"starRating":"starRating-module_starRating__8Gp7A","rating":"starRating-module_rating__WyRjo"};
function StarRating$1(props) {

@@ -142,3 +138,3 @@ var data = props.data,

return React.createElement(React.Fragment, null, show && React.createElement("div", {
className: classes$2.starRating
className: 'starRating'
}, React.createElement(StarRating, {

@@ -153,8 +149,6 @@ data: data,

}), (headerText == null ? void 0 : headerText(totalPercentage)) || React.createElement("p", {
className: clsx(classes$2.rating, className)
className: clsx('rating', className)
}, totalPercentage.toFixed(2), " out of ", numberOfRating)));
}
var classes$3 = {"container":"ratings-module_container__3oVdJ"};
function _extends() {

@@ -178,3 +172,3 @@ _extends = Object.assign || function (target) {

var classes$4 = {"progress_bar":"progress-module_progress_bar__QisS6","filled_bar":"progress-module_filled_bar__gDcZy"};
var classes$1 = {"progress_bar":"progress-module_progress_bar__QisS6","filled_bar":"progress-module_filled_bar__gDcZy"};

@@ -186,3 +180,3 @@ function Progress(props) {

return React.createElement("div", {
className: classes$4.progress_bar,
className: classes$1.progress_bar,
style: {

@@ -196,3 +190,3 @@ backgroundColor: unfilledColor || progressBarColors.unfilled

}, React.createElement("div", {
className: classes$4.filled_bar,
className: classes$1.filled_bar,
style: {

@@ -205,4 +199,2 @@ width: percentage + "%",

var classes$5 = {"container":"progressBar-module_container__cq1Qv","inner_container":"progressBar-module_inner_container__Ig-ty","subtext":"progressBar-module_subtext__bfp0o","percent_text":"progressBar-module_percent_text__h5xUT"};
function RatingBars(props) {

@@ -259,3 +251,3 @@ var _props$data = props.data,

return React.createElement("div", {
className: classes$5.container
className: 'container'
}, combinedData.map(function (item, index) {

@@ -267,3 +259,3 @@ var count = item.count,

key: index + count,
className: clsx(classes$5.inner_container, className),
className: clsx('inner_container', className),
onClick: function onClick() {

@@ -273,3 +265,3 @@ return _onClick && _onClick(item);

}, options != null && options.progressBarText ? options.progressBarText(item) : React.createElement("span", {
className: classes$5.subtext
className: 'subtext'
}, rating, "\xA0stars"), React.createElement(Progress, {

@@ -283,3 +275,3 @@ rating: rating,

}), React.createElement("div", null, !(options != null && options.percentage) ? React.createElement("span", {
className: classes$5.percent_text
className: 'percent_text'
}, Math.ceil(percent), " %") : React.createElement(React.Fragment, null, options.percentage(percent, item), " ")));

@@ -299,3 +291,3 @@ }));

return React.createElement("div", {
className: classes$3.container
className: 'ratings_container'
}, React.createElement(StarRating$1, {

@@ -302,0 +294,0 @@ data: data,

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e,l=require("react-icons/ai");function t(e,n){void 0===n&&(n={});var l=n.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===l&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}t(".filled-module_filled__7APsd {\n font-size: 3rem;\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n width: 0;\n /* overflow: hidden; */\n}\nspan {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n.filled-module_star__DjRcp {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n");var r=function(){for(var e=arguments.length,n=new Array(e),l=0;l<e;l++)n[l]=arguments[l];return n.filter(Boolean).map((function(e){return e.trim()})).join(" ")};function a(e){var l=e.filledColor,t=void 0===l?"":l,a=e.ratingIconClassname,o=void 0===a?"":a,i=e.FilledRatingIcon,d=e.width,s=Math.max.apply(Math,e.data.map((function(e){return e.rating})));return n.createElement("div",{className:"filled-module_filled__7APsd",style:{width:d}},[].concat(Array(s)).map((function(e,l){return n.createElement("span",{key:"unfilled-star custom icon "+l,className:r("filled-module_star__DjRcp",o),style:{color:t||"#ffa41c"}},i)})))}var o={unfilled:"Unfilled-module_unfilled__2wGJ3",filled:"Unfilled-module_filled__-I2up"};t(".Unfilled-module_unfilled__2wGJ3 {\n position: relative;\n display: inline-block;\n}\n.Unfilled-module_unfilled__2wGJ3 span {\n font-size: 3rem;\n padding: 0.1rem;\n}\n\n.Unfilled-module_unfilled__2wGJ3 .Unfilled-module_filled__-I2up {\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n width: 0;\n}\n");var i=function(e){var l=e.data,t=e.filledColor,i=e.unfilledColor,d=e.ratingIconClassname,s=void 0===d?"":d,c=e.FilledRatingIcon,u=e.UnfilledRatingIcon,f=e.width,m=Math.max.apply(Math,l.map((function(e){return e.rating})));return n.createElement("div",{className:o.unfilled},[].concat(Array(m)).map((function(e,l){return n.createElement("span",{key:"unfilled-star custom icon "+l,className:r(o.star,s),style:{color:i||"#ffa41c"}},i?c:u)})),n.createElement(a,{data:l,filledColor:t,ratingIconClassname:s,FilledRatingIcon:c,width:f}))};function d(e){var t=e.data,a=e.options,o=void 0===a?{}:a,d=o.filledColor,s=o.unfilledColor,c=o.ratingIconClassname,u=o.show,f=void 0===u||u,m=o.className,p=void 0===m?"":m,g=o.FilledRatingIcon,_=void 0===g?n.createElement(l.AiFillStar,null):g,v=o.UnfilledRatingIcon,h=void 0===v?n.createElement(l.AiOutlineStar,null):v,x=o.headerText,y=Math.max.apply(Math,t.map((function(e){return e.rating}))),w=t.reduce((function(e,n){return e+n.count}),0),C={},b=0;for(var E in t.forEach((function(e){C[""+e.rating]=e.count/w})),C)b+=Number(E)*C[E];var R=Number(b.toFixed(2))/y*100;return n.createElement(n.Fragment,null,f&&n.createElement("div",{className:"starRating-module_starRating__8Gp7A"},n.createElement(i,{data:t,filledColor:d,unfilledColor:s,ratingIconClassname:c,FilledRatingIcon:_,UnfilledRatingIcon:h,width:R+"%"}),(null==x?void 0:x(b))||n.createElement("p",{className:r("starRating-module_rating__WyRjo",p)},b.toFixed(2)," out of ",y)))}function s(){return(s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=l[t])}return e}).apply(this,arguments)}function c(e){return n.createElement("div",{className:"progress-module_progress_bar__QisS6",style:{backgroundColor:e.unfilledColor||"#f0f2f2"},role:"progressbar","aria-valuenow":40,"aria-valuemax":20,"aria-valuemin":0},n.createElement("div",{className:"progress-module_filled_bar__gDcZy",style:{width:e.percentage+"%",backgroundColor:e.filledColor||"#ffa41c"}}))}function u(e){var l=e.data,t=void 0===l?[]:l,a=e.options,o=void 0===a?{}:a,i=o.className,d=void 0===i?"":i,u=o.filledColor,f=o.unfilledColor,m=o.onClick,p=t.reduce((function(e,n){var l,t;return s({},e,e[n.rating]?((l={})[n.rating]=e[n.rating]+n.count,l):((t={})[n.rating]=n.count,t))}),{}),g=Math.max.apply(Math,t.map((function(e){return e.rating}))),_=[].concat(Array(g)).map((function(e,n){return n+1})).reduce((function(e,n){var l,t;return s({},e,p[n]?((l={})[n]=p[n],l):((t={})[n]=0,t))}),{}),v=Object.entries(_).map((function(e){return{count:e[1],rating:Number(e[0])}})),h=v.reduce((function(e,n){return e+n.count}),0);return n.createElement("div",{className:"progressBar-module_container__cq1Qv"},v.map((function(e,l){var t=e.count,a=e.rating,i=100*t/h||0;return n.createElement("div",{key:l+t,className:r("progressBar-module_inner_container__Ig-ty",d),onClick:function(){return m&&m(e)}},null!=o&&o.progressBarText?o.progressBarText(e):n.createElement("span",{className:"progressBar-module_subtext__bfp0o"},a," stars"),n.createElement(c,{rating:a,value:t,total:h,percentage:i,filledColor:u,unfilledColor:f}),n.createElement("div",null,null!=o&&o.percentage?n.createElement(n.Fragment,null,o.percentage(i,e)," "):n.createElement("span",{className:"progressBar-module_percent_text__h5xUT"},Math.ceil(i)," %")))})))}t(".starRating-module_starRating__8Gp7A {\n display: flex;\n justify-content: center;\n}\n.starRating-module_starRating__8Gp7A .starRating-module_rating__WyRjo {\n font-size: 14px;\n white-space: nowrap;\n margin-left: 1rem;\n}\n"),t(".ratings-module_container__3oVdJ {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n justify-content: center;\n background-color: #fff;\n}\n"),t(".progress-module_progress_bar__QisS6 {\n display: flex;\n flex: 1;\n align-self: stretch;\n border-radius: 4px;\n}\n\n.progress-module_filled_bar__gDcZy {\n border-radius: 4px 0 0 4px;\n height: 100%;\n}\n"),t(".progressBar-module_container__cq1Qv {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 1.2rem;\n box-sizing: border-box;\n padding: 10px;\n}\n\n.progressBar-module_inner_container__Ig-ty {\n width: 100%;\n height: 1.2rem;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.8rem;\n}\n\n.progressBar-module_subtext__bfp0o {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n}\n\n.progressBar-module_percent_text__h5xUT {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n width: 35px;\n justify-content: flex-end;\n}\n"),exports.ProgressBar=u,exports.Rating=d,exports.Ratings=function(e){var l=e.data,t=e.options,r=void 0===t?{progressBar:{},rating:{}}:t,a=r.progressBar,o=r.rating;return n.createElement("div",{className:"ratings-module_container__3oVdJ"},n.createElement(d,{data:l,options:{show:null==o?void 0:o.show,filledColor:null==o?void 0:o.filledColor,unfilledColor:null==o?void 0:o.unfilledColor,ratingIconClassname:null==o?void 0:o.className,className:null==o?void 0:o.className,FilledRatingIcon:null==o?void 0:o.FilledRatingIcon,UnfilledRatingIcon:null==o?void 0:o.UnfilledRatingIcon,headerText:null==o?void 0:o.headerText}}),n.createElement(u,{data:l,options:{filledColor:null==a?void 0:a.filledColor,unfilledColor:null==a?void 0:a.unfilledColor,className:null==a?void 0:a.className,percentage:null==a?void 0:a.percentage,progressBarText:null==a?void 0:a.progressBarText,onClick:null==a?void 0:a.onClick}}))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e,t=require("react-icons/ai");function l(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&l.firstChild?l.insertBefore(r,l.firstChild):l.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}l(".filled {\n font-size: 3rem;\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n width: 0;\n /* overflow: hidden; */\n}\nspan {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n.star {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n");var r=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return n.filter(Boolean).map((function(e){return e.trim()})).join(" ")};function a(e){var t=e.filledColor,l=void 0===t?"":t,a=e.ratingIconClassname,i=void 0===a?"":a,o=e.FilledRatingIcon,d=e.width,s=Math.max.apply(Math,e.data.map((function(e){return e.rating})));return n.createElement("div",{className:"filled",style:{width:d}},[].concat(Array(s)).map((function(e,t){return n.createElement("span",{key:"unfilled-star custom icon "+t,className:r("star",i),style:{color:l||"#ffa41c"}},o)})))}var i={unfilled:"Unfilled-module_unfilled__2wGJ3",filled:"Unfilled-module_filled__-I2up"};l(".Unfilled-module_unfilled__2wGJ3 {\n position: relative;\n display: inline-block;\n}\n.Unfilled-module_unfilled__2wGJ3 span {\n font-size: 3rem;\n padding: 0.1rem;\n}\n\n.Unfilled-module_unfilled__2wGJ3 .Unfilled-module_filled__-I2up {\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n width: 0;\n}\n");var o=function(e){var t=e.data,l=e.filledColor,o=e.unfilledColor,d=e.ratingIconClassname,s=void 0===d?"":d,c=e.FilledRatingIcon,u=e.UnfilledRatingIcon,f=e.width,p=Math.max.apply(Math,t.map((function(e){return e.rating})));return n.createElement("div",{className:i.unfilled},[].concat(Array(p)).map((function(e,t){return n.createElement("span",{key:"unfilled-star custom icon "+t,className:r(i.star,s),style:{color:o||"#ffa41c"}},o?c:u)})),n.createElement(a,{data:t,filledColor:l,ratingIconClassname:s,FilledRatingIcon:c,width:f}))};function d(e){var l=e.data,a=e.options,i=void 0===a?{}:a,d=i.filledColor,s=i.unfilledColor,c=i.ratingIconClassname,u=i.show,f=void 0===u||u,p=i.className,m=void 0===p?"":p,g=i.FilledRatingIcon,v=void 0===g?n.createElement(t.AiFillStar,null):g,h=i.UnfilledRatingIcon,x=void 0===h?n.createElement(t.AiOutlineStar,null):h,_=i.headerText,y=Math.max.apply(Math,l.map((function(e){return e.rating}))),w=l.reduce((function(e,n){return e+n.count}),0),C={},b=0;for(var E in l.forEach((function(e){C[""+e.rating]=e.count/w})),C)b+=Number(E)*C[E];var N=Number(b.toFixed(2))/y*100;return n.createElement(n.Fragment,null,f&&n.createElement("div",{className:"starRating"},n.createElement(o,{data:l,filledColor:d,unfilledColor:s,ratingIconClassname:c,FilledRatingIcon:v,UnfilledRatingIcon:x,width:N+"%"}),(null==_?void 0:_(b))||n.createElement("p",{className:r("rating",m)},b.toFixed(2)," out of ",y)))}function s(){return(s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e}).apply(this,arguments)}function c(e){return n.createElement("div",{className:"progress-module_progress_bar__QisS6",style:{backgroundColor:e.unfilledColor||"#f0f2f2"},role:"progressbar","aria-valuenow":40,"aria-valuemax":20,"aria-valuemin":0},n.createElement("div",{className:"progress-module_filled_bar__gDcZy",style:{width:e.percentage+"%",backgroundColor:e.filledColor||"#ffa41c"}}))}function u(e){var t=e.data,l=void 0===t?[]:t,a=e.options,i=void 0===a?{}:a,o=i.className,d=void 0===o?"":o,u=i.filledColor,f=i.unfilledColor,p=i.onClick,m=l.reduce((function(e,n){var t,l;return s({},e,e[n.rating]?((t={})[n.rating]=e[n.rating]+n.count,t):((l={})[n.rating]=n.count,l))}),{}),g=Math.max.apply(Math,l.map((function(e){return e.rating}))),v=[].concat(Array(g)).map((function(e,n){return n+1})).reduce((function(e,n){var t,l;return s({},e,m[n]?((t={})[n]=m[n],t):((l={})[n]=0,l))}),{}),h=Object.entries(v).map((function(e){return{count:e[1],rating:Number(e[0])}})),x=h.reduce((function(e,n){return e+n.count}),0);return n.createElement("div",{className:"container"},h.map((function(e,t){var l=e.count,a=e.rating,o=100*l/x||0;return n.createElement("div",{key:t+l,className:r("inner_container",d),onClick:function(){return p&&p(e)}},null!=i&&i.progressBarText?i.progressBarText(e):n.createElement("span",{className:"subtext"},a," stars"),n.createElement(c,{rating:a,value:l,total:x,percentage:o,filledColor:u,unfilledColor:f}),n.createElement("div",null,null!=i&&i.percentage?n.createElement(n.Fragment,null,i.percentage(o,e)," "):n.createElement("span",{className:"percent_text"},Math.ceil(o)," %")))})))}l(".starRating {\n display: flex;\n justify-content: center;\n}\n.starRating .rating {\n font-size: 14px;\n white-space: nowrap;\n margin-left: 1rem;\n}\n"),l(".ratings_container {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n justify-content: center;\n background-color: #fff;\n}\n"),l(".progress-module_progress_bar__QisS6 {\n display: flex;\n flex: 1;\n align-self: stretch;\n border-radius: 4px;\n}\n\n.progress-module_filled_bar__gDcZy {\n border-radius: 4px 0 0 4px;\n height: 100%;\n}\n"),l(".container {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 1.2rem;\n box-sizing: border-box;\n padding: 10px;\n}\n\n.inner_container {\n width: 100%;\n height: 1.2rem;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.8rem;\n}\n\n.subtext {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n}\n\n.percent_text {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n width: 35px;\n justify-content: flex-end;\n}\n"),exports.ProgressBar=u,exports.Rating=d,exports.Ratings=function(e){var t=e.data,l=e.options,r=void 0===l?{progressBar:{},rating:{}}:l,a=r.progressBar,i=r.rating;return n.createElement("div",{className:"ratings_container"},n.createElement(d,{data:t,options:{show:null==i?void 0:i.show,filledColor:null==i?void 0:i.filledColor,unfilledColor:null==i?void 0:i.unfilledColor,ratingIconClassname:null==i?void 0:i.className,className:null==i?void 0:i.className,FilledRatingIcon:null==i?void 0:i.FilledRatingIcon,UnfilledRatingIcon:null==i?void 0:i.UnfilledRatingIcon,headerText:null==i?void 0:i.headerText}}),n.createElement(u,{data:t,options:{filledColor:null==a?void 0:a.filledColor,unfilledColor:null==a?void 0:a.unfilledColor,className:null==a?void 0:a.className,percentage:null==a?void 0:a.percentage,progressBarText:null==a?void 0:a.progressBarText,onClick:null==a?void 0:a.onClick}}))};
//# sourceMappingURL=react-custom-ratings.cjs.production.min.js.map

@@ -31,4 +31,3 @@ import React from 'react';

var css_248z = ".filled-module_filled__7APsd {\n font-size: 3rem;\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n width: 0;\n /* overflow: hidden; */\n}\nspan {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n.filled-module_star__DjRcp {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n";
var classes = {"filled":"filled-module_filled__7APsd","star":"filled-module_star__DjRcp"};
var css_248z = ".filled {\n font-size: 3rem;\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n width: 0;\n /* overflow: hidden; */\n}\nspan {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n.star {\n font-size: 3rem;\n /* overflow: hidden; */\n}\n";
styleInject(css_248z);

@@ -67,3 +66,3 @@

return React.createElement("div", {
className: classes.filled,
className: 'filled',
style: {

@@ -75,3 +74,3 @@ width: width

key: "unfilled-star custom icon " + i,
className: clsx(classes.star, ratingIconClassname),
className: clsx('star', ratingIconClassname),
style: {

@@ -85,3 +84,3 @@ color: filledColor || starColors.filled

var css_248z$1 = ".Unfilled-module_unfilled__2wGJ3 {\n position: relative;\n display: inline-block;\n}\n.Unfilled-module_unfilled__2wGJ3 span {\n font-size: 3rem;\n padding: 0.1rem;\n}\n\n.Unfilled-module_unfilled__2wGJ3 .Unfilled-module_filled__-I2up {\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n overflow: hidden;\n width: 0;\n}\n";
var classes$1 = {"unfilled":"Unfilled-module_unfilled__2wGJ3","filled":"Unfilled-module_filled__-I2up"};
var classes = {"unfilled":"Unfilled-module_unfilled__2wGJ3","filled":"Unfilled-module_filled__-I2up"};
styleInject(css_248z$1);

@@ -104,3 +103,3 @@

return React.createElement("div", {
className: classes$1.unfilled
className: classes.unfilled
}, [].concat(Array(numberOfRating)).map(function (_, i) {

@@ -110,3 +109,3 @@ return React.createElement("span", {

// eslint-disable-next-line no-unneeded-ternary
className: clsx(classes$1.star, ratingIconClassname),
className: clsx(classes.star, ratingIconClassname),
style: {

@@ -126,4 +125,3 @@ // eslint-disable-next-line no-unneeded-ternary

var css_248z$2 = ".starRating-module_starRating__8Gp7A {\n display: flex;\n justify-content: center;\n}\n.starRating-module_starRating__8Gp7A .starRating-module_rating__WyRjo {\n font-size: 14px;\n white-space: nowrap;\n margin-left: 1rem;\n}\n";
var classes$2 = {"starRating":"starRating-module_starRating__8Gp7A","rating":"starRating-module_rating__WyRjo"};
var css_248z$2 = ".starRating {\n display: flex;\n justify-content: center;\n}\n.starRating .rating {\n font-size: 14px;\n white-space: nowrap;\n margin-left: 1rem;\n}\n";
styleInject(css_248z$2);

@@ -169,3 +167,3 @@

return React.createElement(React.Fragment, null, show && React.createElement("div", {
className: classes$2.starRating
className: 'starRating'
}, React.createElement(StarRating, {

@@ -180,8 +178,7 @@ data: data,

}), (headerText == null ? void 0 : headerText(totalPercentage)) || React.createElement("p", {
className: clsx(classes$2.rating, className)
className: clsx('rating', className)
}, totalPercentage.toFixed(2), " out of ", numberOfRating)));
}
var css_248z$3 = ".ratings-module_container__3oVdJ {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n justify-content: center;\n background-color: #fff;\n}\n";
var classes$3 = {"container":"ratings-module_container__3oVdJ"};
var css_248z$3 = ".ratings_container {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n justify-content: center;\n background-color: #fff;\n}\n";
styleInject(css_248z$3);

@@ -208,3 +205,3 @@

var css_248z$4 = ".progress-module_progress_bar__QisS6 {\n display: flex;\n flex: 1;\n align-self: stretch;\n border-radius: 4px;\n}\n\n.progress-module_filled_bar__gDcZy {\n border-radius: 4px 0 0 4px;\n height: 100%;\n}\n";
var classes$4 = {"progress_bar":"progress-module_progress_bar__QisS6","filled_bar":"progress-module_filled_bar__gDcZy"};
var classes$1 = {"progress_bar":"progress-module_progress_bar__QisS6","filled_bar":"progress-module_filled_bar__gDcZy"};
styleInject(css_248z$4);

@@ -217,3 +214,3 @@

return React.createElement("div", {
className: classes$4.progress_bar,
className: classes$1.progress_bar,
style: {

@@ -227,3 +224,3 @@ backgroundColor: unfilledColor || progressBarColors.unfilled

}, React.createElement("div", {
className: classes$4.filled_bar,
className: classes$1.filled_bar,
style: {

@@ -236,4 +233,3 @@ width: percentage + "%",

var css_248z$5 = ".progressBar-module_container__cq1Qv {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 1.2rem;\n box-sizing: border-box;\n padding: 10px;\n}\n\n.progressBar-module_inner_container__Ig-ty {\n width: 100%;\n height: 1.2rem;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.8rem;\n}\n\n.progressBar-module_subtext__bfp0o {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n}\n\n.progressBar-module_percent_text__h5xUT {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n width: 35px;\n justify-content: flex-end;\n}\n";
var classes$5 = {"container":"progressBar-module_container__cq1Qv","inner_container":"progressBar-module_inner_container__Ig-ty","subtext":"progressBar-module_subtext__bfp0o","percent_text":"progressBar-module_percent_text__h5xUT"};
var css_248z$5 = ".container {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 1.2rem;\n box-sizing: border-box;\n padding: 10px;\n}\n\n.inner_container {\n width: 100%;\n height: 1.2rem;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.8rem;\n}\n\n.subtext {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n}\n\n.percent_text {\n font-size: 14px;\n white-space: nowrap;\n display: flex;\n width: 35px;\n justify-content: flex-end;\n}\n";
styleInject(css_248z$5);

@@ -292,3 +288,3 @@

return React.createElement("div", {
className: classes$5.container
className: 'container'
}, combinedData.map(function (item, index) {

@@ -300,3 +296,3 @@ var count = item.count,

key: index + count,
className: clsx(classes$5.inner_container, className),
className: clsx('inner_container', className),
onClick: function onClick() {

@@ -306,3 +302,3 @@ return _onClick && _onClick(item);

}, options != null && options.progressBarText ? options.progressBarText(item) : React.createElement("span", {
className: classes$5.subtext
className: 'subtext'
}, rating, "\xA0stars"), React.createElement(Progress, {

@@ -316,3 +312,3 @@ rating: rating,

}), React.createElement("div", null, !(options != null && options.percentage) ? React.createElement("span", {
className: classes$5.percent_text
className: 'percent_text'
}, Math.ceil(percent), " %") : React.createElement(React.Fragment, null, options.percentage(percent, item), " ")));

@@ -332,3 +328,3 @@ }));

return React.createElement("div", {
className: classes$3.container
className: 'ratings_container'
}, React.createElement(StarRating$1, {

@@ -335,0 +331,0 @@ data: data,

{
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",

@@ -4,0 +4,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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