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

react-star-ratings-eco

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-star-ratings-eco - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

src/.prettierrc.json

75

build/star.js

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

'use strict';
"use strict";

@@ -9,11 +9,11 @@ Object.defineProperty(exports, "__esModule", {

var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _classnames = require('classnames');
var _classnames = require("classnames");
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");

@@ -40,3 +40,3 @@ var _propTypes2 = _interopRequireDefault(_propTypes);

_createClass(Star, [{
key: 'render',
key: "render",
value: function render() {

@@ -51,5 +51,5 @@ var _props = this.props,

return _react2.default.createElement(
'div',
"div",
{
className: 'star-container',
className: "star-container",
style: this.starContainerStyle,

@@ -61,3 +61,3 @@ onMouseEnter: hoverOverStar,

_react2.default.createElement(
'svg',
"svg",
{

@@ -69,10 +69,19 @@ viewBox: svgIconViewBox,

_react2.default.createElement(
'g',
{ id: 'Category-Page', stroke: 'none', 'stroke-width': '1', fill: 'none', 'fill-rule': 'evenodd' },
_react2.default.createElement('g', { id: 'Product-preview---salmon-no-discount-Copy-12', transform: 'translate(-49, -490)', fill: '#818181' }),
_react2.default.createElement('path', {
className: 'star',
style: this.pathStyle,
d: svgIconPath
})
"g",
{
id: "Category-Page",
stroke: "none",
"stroke-width": "1",
fill: "none",
"fill-rule": "evenodd"
},
_react2.default.createElement(
"g",
{
id: "Product-preview---salmon-no-discount-Copy-12",
transform: "translate(-49, -490)",
fill: "#818181"
},
_react2.default.createElement("path", { className: "star", style: this.pathStyle, d: svgIconPath })
)
)

@@ -83,3 +92,3 @@ )

}, {
key: 'starContainerStyle',
key: "starContainerStyle",
get: function get() {

@@ -95,8 +104,8 @@ var _props2 = this.props,

var starContainerStyle = {
position: 'relative',
display: 'inline-block',
verticalAlign: 'middle',
position: "relative",
display: "inline-block",
verticalAlign: "middle",
paddingLeft: isFirstStar ? undefined : starSpacing,
paddingRight: isLastStar ? undefined : starSpacing,
cursor: changeRating ? 'pointer' : undefined
cursor: changeRating ? "pointer" : undefined
};

@@ -106,3 +115,3 @@ return ignoreInlineStyles ? {} : starContainerStyle;

}, {
key: 'starSvgStyle',
key: "starSvgStyle",
get: function get() {

@@ -117,4 +126,4 @@ var _props3 = this.props,

height: starDimension,
transition: 'transform .2s ease-in-out',
transform: isCurrentHoveredStar ? 'scale(1.1)' : undefined
transition: "transform .2s ease-in-out",
transform: isCurrentHoveredStar ? "scale(1.1)" : undefined
};

@@ -125,3 +134,3 @@

}, {
key: 'pathStyle',
key: "pathStyle",
get: function get() {

@@ -145,3 +154,3 @@ var _props4 = this.props,

} else {
if (isPartiallyFullStar) fill = 'url(\'' + gradientPathName + '#' + fillId + '\')';else if (isStarred) fill = starRatedColor;else fill = starEmptyColor;
if (isPartiallyFullStar) fill = "url('" + gradientPathName + "#" + fillId + "')";else if (isStarred) fill = starRatedColor;else fill = starEmptyColor;
}

@@ -151,3 +160,3 @@

fill: fill,
transition: 'fill .2s ease-in-out'
transition: "fill .2s ease-in-out"
};

@@ -158,3 +167,3 @@

}, {
key: 'starClasses',
key: "starClasses",
get: function get() {

@@ -170,7 +179,7 @@ var _props5 = this.props,

var starClasses = (0, _classnames2.default)({
'widget-svg': true,
'widget-selected': isSelected,
'multi-widget-selected': isPartiallyFullStar,
'hovered': isHovered,
'current-hovered': isCurrentHoveredStar
"widget-svg": true,
"widget-selected": isSelected,
"multi-widget-selected": isPartiallyFullStar,
hovered: isHovered,
"current-hovered": isCurrentHoveredStar
});

@@ -177,0 +186,0 @@

{
"name": "react-star-ratings-eco",
"version": "2.3.0",
"version": "2.3.1",
"description": "A customizable star rating component for selecting x stars or visualizing x stars",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -1,7 +0,6 @@

import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from "react";
import classNames from "classnames";
import PropTypes from "prop-types";
class Star extends React.Component {
get starContainerStyle() {

@@ -13,27 +12,24 @@ const {

isLastStar,
ignoreInlineStyles
ignoreInlineStyles,
} = this.props;
const starContainerStyle = {
position: 'relative',
display: 'inline-block',
verticalAlign: 'middle',
position: "relative",
display: "inline-block",
verticalAlign: "middle",
paddingLeft: isFirstStar ? undefined : starSpacing,
paddingRight: isLastStar ? undefined : starSpacing,
cursor: changeRating ? 'pointer' : undefined
cursor: changeRating ? "pointer" : undefined,
};
return ignoreInlineStyles ? {} : starContainerStyle
return ignoreInlineStyles ? {} : starContainerStyle;
}
get starSvgStyle() {
const {
ignoreInlineStyles,
isCurrentHoveredStar,
starDimension
} = this.props;
const { ignoreInlineStyles, isCurrentHoveredStar, starDimension } =
this.props;
const starSvgStyle = {
width: starDimension,
height: starDimension,
transition: 'transform .2s ease-in-out',
transform: isCurrentHoveredStar ? 'scale(1.1)' : undefined
transition: "transform .2s ease-in-out",
transform: isCurrentHoveredStar ? "scale(1.1)" : undefined,
};

@@ -55,3 +51,3 @@

fillId,
ignoreInlineStyles
ignoreInlineStyles,
} = this.props;

@@ -71,3 +67,3 @@

fill: fill,
transition: 'fill .2s ease-in-out',
transition: "fill .2s ease-in-out",
};

@@ -84,14 +80,14 @@

isCurrentHoveredStar,
ignoreInlineStyles
ignoreInlineStyles,
} = this.props;
const starClasses = classNames({
'widget-svg': true,
'widget-selected': isSelected,
'multi-widget-selected': isPartiallyFullStar,
'hovered': isHovered,
'current-hovered': isCurrentHoveredStar
})
"widget-svg": true,
"widget-selected": isSelected,
"multi-widget-selected": isPartiallyFullStar,
hovered: isHovered,
"current-hovered": isCurrentHoveredStar,
});
return ignoreInlineStyles ? {} : starClasses
return ignoreInlineStyles ? {} : starClasses;
}

@@ -105,3 +101,3 @@

svgIconViewBox,
svgIconPath
svgIconPath,
} = this.props;

@@ -121,9 +117,16 @@ return (

>
<g id="Category-Page" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Product-preview---salmon-no-discount-Copy-12" transform="translate(-49, -490)" fill="#818181"></g>
<path
className="star"
style={this.pathStyle}
d={svgIconPath}
/>
<g
id="Category-Page"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
>
<g
id="Product-preview---salmon-no-discount-Copy-12"
transform="translate(-49, -490)"
fill="#818181"
>
<path className="star" style={this.pathStyle} d={svgIconPath} />
</g>
</g>

@@ -156,5 +159,5 @@ </svg>

svgIconPath: PropTypes.string.isRequired,
svgIconViewBox: PropTypes.string.isRequired
svgIconViewBox: PropTypes.string.isRequired,
};
export default Star;
export default Star;
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