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

@uiw/react-color-alpha

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-color-alpha - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

38

lib/index.js

@@ -7,8 +7,10 @@ "use strict";

exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.BACKGROUND_IMG = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

@@ -49,5 +51,5 @@ var _react = _interopRequireWildcard(require("react"));

pointer = props.pointer,
other = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
var handleChange = (0, _react.useCallback)(function (offset) {
onChange && onChange((0, _extends2["default"])({}, hsva, {
onChange && onChange((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, hsva), {}, {
a: direction === 'horizontal' ? offset.left : offset.top

@@ -59,18 +61,18 @@ }), offset);

}));
var innerBackground = "linear-gradient(to " + (direction === 'horizontal' ? 'right' : 'bottom') + ", rgba(244, 67, 54, 0) 0%, " + colorTo + " 100%)";
var innerBackground = "linear-gradient(to ".concat(direction === 'horizontal' ? 'right' : 'bottom', ", rgba(244, 67, 54, 0) 0%, ").concat(colorTo, " 100%)");
var comProps = {};
if (direction === 'horizontal') {
comProps.left = hsva.a * 100 + "%";
comProps.left = "".concat(hsva.a * 100, "%");
} else {
comProps.top = hsva.a * 100 + "%";
comProps.top = "".concat(hsva.a * 100, "%");
}
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2["default"])({}, other, {
className: [prefixCls, prefixCls + "-" + direction, className || ''].filter(Boolean).join(' '),
style: (0, _extends2["default"])({
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
className: [prefixCls, "".concat(prefixCls, "-").concat(direction), className || ''].filter(Boolean).join(' '),
style: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
borderRadius: radius,
background: "url(" + BACKGROUND_IMG + ") left center",
background: "url(".concat(BACKGROUND_IMG, ") left center"),
backgroundColor: '#fff'
}, style, {
}, style), {}, {
position: 'relative'

@@ -82,4 +84,4 @@ }, {

ref: ref,
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", (0, _extends2["default"])({}, bgProps, {
style: (0, _extends2["default"])({
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, bgProps), {}, {
style: (0, _objectSpread2["default"])({
inset: 0,

@@ -90,4 +92,4 @@ position: 'absolute',

}, bgProps.style)
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDragEventInteractive["default"], (0, _extends2["default"])({}, innerProps, {
style: (0, _extends2["default"])({}, innerProps.style, {
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDragEventInteractive["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, innerProps), {}, {
style: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, innerProps.style), {}, {
inset: 0,

@@ -99,3 +101,3 @@ zIndex: 1,

onDown: handleChange,
children: /*#__PURE__*/_react["default"].createElement(pointer || _Pointer.Pointer, (0, _extends2["default"])({
children: /*#__PURE__*/_react["default"].createElement(pointer || _Pointer.Pointer, (0, _objectSpread2["default"])({
prefixCls: prefixCls

@@ -102,0 +104,0 @@ }, comProps))

@@ -5,3 +5,5 @@ "use strict";

exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Pointer = void 0;

@@ -27,6 +29,6 @@

return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
className: prefixCls + "-pointer " + (className || ''),
className: "".concat(prefixCls, "-pointer ").concat(className || ''),
style: style,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
className: prefixCls + "-fill",
className: "".concat(prefixCls, "-fill"),
style: {

@@ -33,0 +35,0 @@ width: 18,

{
"name": "@uiw/react-color-alpha",
"version": "1.0.0",
"version": "1.0.1",
"description": "Color alpha",

@@ -32,8 +32,8 @@ "author": "Kenny Wong <wowohoo@qq.com>",

"dependencies": {
"@babel/runtime": "7.15.3",
"@babel/runtime": "7.15.4",
"@uiw/color-convert": "^1.0.0",
"@uiw/react-drag-event-interactive": "^1.0.0"
"@uiw/react-drag-event-interactive": "^1.0.1"
},
"devDependencies": {
"@types/react": "17.0.19",
"@types/react": "17.0.20",
"@types/react-dom": "17.0.9",

@@ -40,0 +40,0 @@ "@types/react-test-renderer": "17.0.1",

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