Socket
Socket
Sign inDemoInstall

@uiw/react-color-alpha

Package Overview
Dependencies
Maintainers
2
Versions
81
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.1.0 to 1.1.1

52

cjs/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -11,42 +9,33 @@ value: true

exports["default"] = exports.BACKGROUND_IMG = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _colorConvert = require("@uiw/color-convert");
var _reactDragEventInteractive = _interopRequireDefault(require("@uiw/react-drag-event-interactive"));
var _Pointer = require("./Pointer");
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["prefixCls", "className", "hsva", "background", "bgProps", "innerProps", "radius", "width", "height", "direction", "style", "onChange", "pointer"];
var BACKGROUND_IMG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==';
exports.BACKGROUND_IMG = BACKGROUND_IMG;
var Aplha = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-color-alpha' : _props$prefixCls,
className = props.className,
hsva = props.hsva,
background = props.background,
_props$bgProps = props.bgProps,
bgProps = _props$bgProps === void 0 ? {} : _props$bgProps,
_props$innerProps = props.innerProps,
innerProps = _props$innerProps === void 0 ? {} : _props$innerProps,
_props$radius = props.radius,
radius = _props$radius === void 0 ? 0 : _props$radius,
width = props.width,
_props$height = props.height,
height = _props$height === void 0 ? 16 : _props$height,
_props$direction = props.direction,
direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
style = props.style,
onChange = props.onChange,
pointer = props.pointer,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
prefixCls = _props$prefixCls === void 0 ? 'w-color-alpha' : _props$prefixCls,
className = props.className,
hsva = props.hsva,
background = props.background,
_props$bgProps = props.bgProps,
bgProps = _props$bgProps === void 0 ? {} : _props$bgProps,
_props$innerProps = props.innerProps,
innerProps = _props$innerProps === void 0 ? {} : _props$innerProps,
_props$radius = props.radius,
radius = _props$radius === void 0 ? 0 : _props$radius,
width = props.width,
_props$height = props.height,
height = _props$height === void 0 ? 16 : _props$height,
_props$direction = props.direction,
direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
style = props.style,
onChange = props.onChange,
pointer = props.pointer,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
var handleChange = (0, _react.useCallback)(function (offset) {

@@ -62,3 +51,2 @@ onChange && onChange((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, hsva), {}, {

var comProps = {};
if (direction === 'horizontal') {

@@ -69,3 +57,2 @@ comProps.left = "".concat(hsva.a * 100, "%");

}
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {

@@ -105,3 +92,2 @@ className: [prefixCls, "".concat(prefixCls, "-").concat(direction), className || ''].filter(Boolean).join(' '),

});
Aplha.displayName = 'Aplha';

@@ -108,0 +94,0 @@ var _default = Aplha;

"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
Object.defineProperty(exports, "__esModule", {

@@ -9,14 +8,10 @@ value: true

exports.Pointer = void 0;
var _react = _interopRequireWildcard(require("react"));
var _jsxRuntime = require("react/jsx-runtime");
var BOXSHADOW = 'rgb(0 0 0 / 37%) 0px 1px 4px 0px';
var Pointer = function Pointer(_ref) {
var className = _ref.className,
prefixCls = _ref.prefixCls,
left = _ref.left,
top = _ref.top;
prefixCls = _ref.prefixCls,
left = _ref.left,
top = _ref.top;
var style = {

@@ -45,4 +40,3 @@ position: 'absolute',

};
exports.Pointer = Pointer;
//# sourceMappingURL=Pointer.js.map

@@ -13,18 +13,17 @@ import _extends from "@babel/runtime/helpers/extends";

var {
prefixCls = 'w-color-alpha',
className,
hsva,
background,
bgProps = {},
innerProps = {},
radius = 0,
width,
height = 16,
direction = 'horizontal',
style,
onChange,
pointer
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
prefixCls = 'w-color-alpha',
className,
hsva,
background,
bgProps = {},
innerProps = {},
radius = 0,
width,
height = 16,
direction = 'horizontal',
style,
onChange,
pointer
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
var handleChange = useCallback(offset => {

@@ -40,3 +39,2 @@ onChange && onChange(_extends({}, hsva, {

var comProps = {};
if (direction === 'horizontal') {

@@ -47,3 +45,2 @@ comProps.left = hsva.a * 100 + "%";

}
return /*#__PURE__*/_jsxs("div", _extends({}, other, {

@@ -50,0 +47,0 @@ className: [prefixCls, prefixCls + "-" + direction, className || ''].filter(Boolean).join(' '),

{
"name": "@uiw/react-color-alpha",
"version": "1.1.0",
"version": "1.1.1",
"description": "Color alpha",

@@ -37,6 +37,6 @@ "author": "Kenny Wong <wowohoo@qq.com>",

"dependencies": {
"@babel/runtime": "~7.18.0",
"@uiw/color-convert": "1.1.0",
"@uiw/react-drag-event-interactive": "1.1.0"
"@babel/runtime": "~7.19.0",
"@uiw/color-convert": "1.1.1",
"@uiw/react-drag-event-interactive": "1.1.1"
}
}

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