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

@uiw/react-color-material

Package Overview
Dependencies
Maintainers
2
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 1.1.0 to 1.1.1

26

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

@@ -9,17 +8,9 @@ value: true

exports["default"] = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _colorConvert = require("@uiw/color-convert");
var _reactColorEditableInput = _interopRequireDefault(require("@uiw/react-color-editable-input"));
var _reactColorEditableInputRgba = _interopRequireDefault(require("@uiw/react-color-editable-input-rgba"));
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["prefixCls", "className", "style", "color", "onChange"];

@@ -36,18 +27,15 @@ var styleRBG = {

};
var Material = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-color-material' : _props$prefixCls,
className = props.className,
style = props.style,
color = props.color,
onChange = props.onChange,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
prefixCls = _props$prefixCls === void 0 ? 'w-color-material' : _props$prefixCls,
className = props.className,
style = props.style,
color = props.color,
onChange = props.onChange,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
var hsva = typeof color === 'string' && (0, _colorConvert.validHex)(color) ? (0, _colorConvert.hexToHsva)(color) : color;
var hex = color ? (0, _colorConvert.hsvaToHex)(hsva).replace(/^#/, '') : '';
var handleChange = function handleChange(hsv) {
onChange && onChange((0, _colorConvert.color)(hsv));
};
var handleHex = function handleHex(value, evn) {

@@ -58,3 +46,2 @@ if (typeof value === 'string' && (0, _colorConvert.validHex)(value) && /(3|6)/.test(String(value.length))) {

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

@@ -127,3 +114,2 @@ ref: ref,

});
Material.displayName = 'Material';

@@ -130,0 +116,0 @@ var _default = Material;

@@ -22,17 +22,14 @@ import _extends from "@babel/runtime/helpers/extends";

var {
prefixCls = 'w-color-material',
className,
style,
color,
onChange
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
prefixCls = 'w-color-material',
className,
style,
color,
onChange
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
var hsva = typeof color === 'string' && validHex(color) ? hexToHsva(color) : color;
var hex = color ? hsvaToHex(hsva).replace(/^#/, '') : '';
var handleChange = hsv => {
onChange && onChange(handleColor(hsv));
};
var handleHex = (value, evn) => {

@@ -43,3 +40,2 @@ if (typeof value === 'string' && validHex(value) && /(3|6)/.test(String(value.length))) {

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

@@ -46,0 +42,0 @@ ref: ref,

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

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

"dependencies": {
"@babel/runtime": "~7.18.0",
"@uiw/color-convert": "1.1.0",
"@uiw/react-color-editable-input": "1.1.0",
"@uiw/react-color-editable-input-rgba": "1.1.0"
"@babel/runtime": "~7.19.0",
"@uiw/color-convert": "1.1.1",
"@uiw/react-color-editable-input": "1.1.1",
"@uiw/react-color-editable-input-rgba": "1.1.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