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

@uiw/react-color-saturation

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-saturation - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

5

lib/cjs/index.d.ts
import React from 'react';
import { HsvaColor } from '@uiw/color-convert';
export * from '@uiw/color-convert';
interface ColorSaturationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
export interface ColorSaturationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
prefixCls?: string;
/** hsva => `{ h: 0, s: 75, v: 82, a: 1 }` */
hsva: HsvaColor;
onChange: (newColor: HsvaColor) => void;
onChange?: (newColor: HsvaColor) => void;
}
declare const _default: React.ForwardRefExoticComponent<ColorSaturationProps & React.RefAttributes<HTMLDivElement>>;
export default _default;

56

lib/cjs/index.js

@@ -5,4 +5,2 @@ "use strict";

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

@@ -16,5 +14,7 @@ value: true

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _react = _interopRequireDefault(require("react"));

@@ -35,35 +35,47 @@ var _colorConvert = require("@uiw/color-convert");

var _reactDragEventInteractive = _interopRequireDefault(require("@uiw/react-drag-event-interactive"));
var _Pointer = require("./Pointer");
var _utils = require("./utils");
var _excluded = ["prefixCls", "className", "style", "hsva", "onChange"];
var _excluded = ["prefixCls", "hsva", "onChange"];
var _default = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-color-saturation' : _props$prefixCls,
className = props.className,
style = props.style,
hsva = props.hsva,
onChange = props.onChange,
other = (0, _objectWithoutProperties2.default)(props, _excluded);
var container = (0, _react.useRef)(null);
(0, _react.useImperativeHandle)(ref, function () {
return container.current;
});
var containerStyle = {
var containerStyle = (0, _objectSpread2.default)((0, _objectSpread2.default)({
width: 200,
height: 200,
height: 200
}, style), {}, {
position: 'relative',
backgroundColor: "hsl(".concat(hsva.h, ",100%, 50%)")
});
var handleChange = function handleChange(interaction, event) {
onChange && onChange({
h: hsva.h,
s: interaction.left * 100,
v: (1 - interaction.top) * 100,
a: hsva.a // source: 'hsv',
});
};
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
className: prefixCls,
className: "".concat(prefixCls, " ").concat(className || ''),
style: containerStyle,
ref: container
}, other, {
onMouseDown: function onMouseDown(event) {
var rect = (0, _utils.calculateChange)(event, hsva, container.current);
onChange && onChange(rect);
}
}), /*#__PURE__*/_react.default.createElement("div", {
ref: ref
}, other), /*#__PURE__*/_react.default.createElement(_reactDragEventInteractive.default, {
style: {
position: 'absolute',
inset: 0
},
onMove: handleChange,
onDown: handleChange
}, /*#__PURE__*/_react.default.createElement("div", {
style: {
inset: 0,

@@ -84,6 +96,6 @@ background: 'linear-gradient(to right, rgb(255, 255, 255), rgba(255, 255, 255, 0))',

color: (0, _colorConvert.hsvaToHslaString)(hsva)
}))));
})))));
});
exports.default = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmRleC50c3giXSwibmFtZXMiOlsiUmVhY3QiLCJmb3J3YXJkUmVmIiwicHJvcHMiLCJyZWYiLCJwcmVmaXhDbHMiLCJoc3ZhIiwib25DaGFuZ2UiLCJvdGhlciIsImNvbnRhaW5lciIsImN1cnJlbnQiLCJjb250YWluZXJTdHlsZSIsIndpZHRoIiwiaGVpZ2h0IiwicG9zaXRpb24iLCJiYWNrZ3JvdW5kQ29sb3IiLCJoIiwiZXZlbnQiLCJyZWN0Iiwi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AgICByZWY9e2NvbnRhaW5lcn1cbiAgICAgICAgey4uLm90aGVyfVxuICAgICAgICBvbk1vdXNlRG93bj17KGV2ZW50KSA9PiB7XG4gICAgICAgICAgY29uc3QgcmVjdCA9IGNhbGN1bGF0ZUNoYW5nZShldmVudCBhcyBhbnksIGhzdmEsIGNvbnRhaW5lci5jdXJyZW50ISk7XG4gICAgICAgICAgb25DaGFuZ2UgJiYgb25DaGFuZ2UocmVjdCk7XG4gICAgICAgIH19XG4gICAgICA+XG4gICAgICAgIDxkaXZcbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgaW5zZXQ6IDAsXG4gICAgICAgICAgICBiYWNrZ3JvdW5kOlxuICAgICAgICAgICAgICAnbGluZWFyLWdyYWRpZW50KHRvIHJpZ2h0LCByZ2IoMjU1LCAyNTUsIDI1NSksIHJnYmEoMjU1LCAyNTUsIDI1NSwgMCkpJyxcbiAgICAgICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgICAgIH19XG4gICAgICAgID5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgICBpbnNldDogMCxcbiAgICAgICAgICAgICAgYmFja2dyb3VuZDpcbiAgICAgICAgICAgICAgICAnbGluZWFyLWdyYWRpZW50KHRvIHRvcCwgcmdiKDAsIDAsIDApLCByZ2JhKDAsIDAsIDAsIDApKScsXG4gICAgICAgICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgICAgICAgfX1cbiAgICAgICAgICA+XG4gICAgICAgICAgICA8UG9pbnRlclxuICAgICAgICAgICAgICBwcmVmaXhDbHM9e3ByZWZpeENsc31cbiAgICAgICAgICAgICAgdG9wPXtgJHsxMDAgLSBoc3ZhLnZ9JWB9XG4gICAgICAgICAgICAgIGxlZnQ9e2Ake2hzdmEuc30lYH1cbiAgICAgICAgICAgICAgY29sb3I9e2hzdmFUb0hzbGFTdHJpbmcoaHN2YSl9XG4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AgIGE6IGhzdmEuYSxcbiAgICAgICAgLy8gc291cmNlOiAnaHN2JyxcbiAgICAgIH0pO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPGRpdiBjbGFzc05hbWU9e2Ake3ByZWZpeENsc30gJHtjbGFzc05hbWUgfHwgJyd9YH0gc3R5bGU9e2NvbnRhaW5lclN0eWxlfSByZWY9e3JlZn0gey4uLm90aGVyfT5cbiAgICAgIDxJbnRlcmFjdGl2ZVxuICAgICAgICBzdHlsZT17e1xuICAgICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgICAgIGluc2V0OiAwLFxuICAgICAgICB9fVxuICAgICAgICBvbk1vdmU9e2hhbmRsZUNoYW5nZX1cbiAgICAgICAgb25Eb3duPXtoYW5kbGVDaGFuZ2V9XG4gICAgICA+XG4gICAgICAgIDxkaXZcbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgaW5zZXQ6IDAsXG4gICAgICAgICAgICBiYWNrZ3JvdW5kOiAnbGluZWFyLWdyYWRpZW50KHRvIHJpZ2h0LCByZ2IoMjU1LCAyNTUsIDI1NSksIHJnYmEoMjU1LCAyNTUsIDI1NSwgMCkpJyxcbiAgICAgICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgICAgIH19XG4gICAgICAgID5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgICBpbnNldDogMCxcbiAgICAgICAgICAgICAgYmFja2dyb3VuZDogJ2xpbmVhci1ncmFkaWVudCh0byB0b3AsIHJnYigwLCAwLCAwKSwgcmdiYSgwLCAwLCAwLCAwKSknLFxuICAgICAgICAgICAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICAgICAgICAgIH19XG4gICAgICAgICAgPlxuICAgICAgICAgICAgPFBvaW50ZXIgcHJlZml4Q2xzPXtwcmVmaXhDbHN9IHRvcD17YCR7MTAwIC0gaHN2YS52fSVgfSBsZWZ0PXtgJHtoc3ZhLnN9JWB9IGNvbG9yPXtoc3ZhVG9Ic2xhU3RyaW5nKGhzdmEpfSAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5cbiAgICAgIDwvSW50ZXJhY3RpdmU+XG4gICAgPC9kaXY+XG4gICk7XG59KTtcbiJdfQ==
import React from 'react';
interface PointerProps extends React.HTMLAttributes<HTMLDivElement> {
export interface PointerProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;

@@ -8,3 +8,2 @@ top?: string;

}
export declare const Pointer: ({ className, color, left, top, prefixCls, }: PointerProps) => JSX.Element;
export {};
export declare const Pointer: ({ className, color, left, top, prefixCls }: PointerProps) => JSX.Element;
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;

@@ -10,4 +10,6 @@ Object.defineProperty(exports, "__esModule", {

var _react = _interopRequireDefault(require("react"));
var _react = _interopRequireWildcard(require("react"));
var BOXSHADOW = 'rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px';
var Pointer = function Pointer(_ref) {

@@ -24,19 +26,28 @@ var className = _ref.className,

};
return /*#__PURE__*/_react.default.createElement("div", {
className: "".concat(prefixCls, "-pointer ").concat(className || ''),
style: style
}, /*#__PURE__*/_react.default.createElement("div", {
className: "".concat(prefixCls, "-fill"),
style: {
width: 5,
height: 5,
transform: 'translate(-3px, -3px)',
boxShadow: 'rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px',
borderRadius: '50%',
backgroundColor: color
}
}));
return (0, _react.useMemo)(function () {
return /*#__PURE__*/_react.default.createElement("div", {
className: "".concat(prefixCls, "-pointer ").concat(className || ''),
style: style
}, /*#__PURE__*/_react.default.createElement("div", {
className: "".concat(prefixCls, "-fill"),
style: {
width: 5,
height: 5,
transform: 'translate(-3px, -3px)',
boxShadow: BOXSHADOW,
borderRadius: '50%',
backgroundColor: '#fff'
}
}, /*#__PURE__*/_react.default.createElement("div", {
style: {
inset: 0,
borderRadius: '50%',
position: 'absolute',
backgroundColor: color
}
})));
}, [top, left, color, className, prefixCls]);
};
exports.Pointer = Pointer;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Qb2ludGVyLnRzeCJdLCJuYW1lcyI6WyJQb2ludGVyIiwiY2xhc3NOYW1lIiwiY29sb3IiLCJsZWZ0IiwidG9wIiwicHJlZml4Q2xzIiwic3R5bGUiLCJwb3NpdGlvbiIsIndpZHRoIiwiaGVpZ2h0IiwidHJhbnNmb3JtIiwiYm94U2hhZG93IiwiYm9yZGVyUmFkaXVzIiwiYmFja2dyb3VuZENvbG9yIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQTs7QUFTTyxJQUFNQSxPQUFPLEdBQUcsU0FBVkEsT0FBVSxPQU1VO0FBQUEsTUFML0JDLFNBSytCLFFBTC9CQSxTQUsrQjtBQUFBLE1BSi9CQyxLQUkrQixRQUovQkEsS0FJK0I7QUFBQSxNQUgvQkMsSUFHK0IsUUFIL0JBLElBRytCO0FBQUEsTUFGL0JDLEdBRStCLFFBRi9CQSxHQUUrQjtBQUFBLE1BRC9CQyxTQUMrQixRQUQvQkEsU0FDK0I7QUFDL0IsTUFBTUMsS0FBMEIsR0FBRztBQUNqQ0MsSUFBQUEsUUFBUSxFQUFFLFVBRHVCO0FBRWpDSCxJQUFBQSxHQUFHLEVBQUhBLEdBRmlDO0FBR2pDRCxJQUFBQSxJQUFJLEVBQUpBO0FBSGlDLEdBQW5DO0FBTUEsc0JBQ0U7QUFBSyxJQUFBLFNBQVMsWUFBS0UsU0FBTCxzQkFBMEJKLFNBQVMsSUFBSSxFQUF2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IDUsXG4gICAgICAgICAgICB0cmFuc2Zvcm06ICd0cmFuc2xhdGUoLTNweCwgLTNweCknLFxuICAgICAgICAgICAgYm94U2hhZG93OiBCT1hTSEFET1csXG4gICAgICAgICAgICBib3JkZXJSYWRpdXM6ICc1MCUnLFxuICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiAnI2ZmZicsXG4gICAgICAgICAgfX1cbiAgICAgICAgPlxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICAgIGluc2V0OiAwLFxuICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6ICc1MCUnLFxuICAgICAgICAgICAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiBjb2xvcixcbiAgICAgICAgICAgIH19XG4gICAgICAgICAgLz5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L2Rpdj5cbiAgICApLFxuICAgIFt0b3AsIGxlZnQsIGNvbG9yLCBjbGFzc05hbWUsIHByZWZpeENsc10sXG4gICk7XG59O1xuIl19
import React from 'react';
import { HsvaColor } from '@uiw/color-convert';
export * from '@uiw/color-convert';
interface ColorSaturationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
export interface ColorSaturationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
prefixCls?: string;
/** hsva => `{ h: 0, s: 75, v: 82, a: 1 }` */
hsva: HsvaColor;
onChange: (newColor: HsvaColor) => void;
onChange?: (newColor: HsvaColor) => void;
}
declare const _default: React.ForwardRefExoticComponent<ColorSaturationProps & React.RefAttributes<HTMLDivElement>>;
export default _default;
import _extends from "@babel/runtime/helpers/extends";
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["prefixCls", "hsva", "onChange"];
import React, { useRef, useImperativeHandle } from 'react';
var _excluded = ["prefixCls", "className", "style", "hsva", "onChange"];
import React from 'react';
import { hsvaToHslaString } from '@uiw/color-convert';
import Interactive from '@uiw/react-drag-event-interactive';
import { Pointer } from './Pointer';
import { calculateChange } from './utils';
export * from '@uiw/color-convert';

@@ -12,2 +13,4 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {

prefixCls = _props$prefixCls === void 0 ? 'w-color-saturation' : _props$prefixCls,
className = props.className,
style = props.style,
hsva = props.hsva,

@@ -17,23 +20,33 @@ onChange = props.onChange,

var container = useRef(null);
useImperativeHandle(ref, function () {
return container.current;
});
var containerStyle = {
var containerStyle = _objectSpread(_objectSpread({
width: 200,
height: 200,
height: 200
}, style), {}, {
position: 'relative',
backgroundColor: "hsl(".concat(hsva.h, ",100%, 50%)")
});
var handleChange = function handleChange(interaction, event) {
onChange && onChange({
h: hsva.h,
s: interaction.left * 100,
v: (1 - interaction.top) * 100,
a: hsva.a // source: 'hsv',
});
};
return /*#__PURE__*/React.createElement("div", _extends({
className: prefixCls,
className: "".concat(prefixCls, " ").concat(className || ''),
style: containerStyle,
ref: container
}, other, {
onMouseDown: function onMouseDown(event) {
var rect = calculateChange(event, hsva, container.current);
onChange && onChange(rect);
}
}), /*#__PURE__*/React.createElement("div", {
ref: ref
}, other), /*#__PURE__*/React.createElement(Interactive, {
style: {
position: 'absolute',
inset: 0
},
onMove: handleChange,
onDown: handleChange
}, /*#__PURE__*/React.createElement("div", {
style: {
inset: 0,

@@ -54,4 +67,4 @@ background: 'linear-gradient(to right, rgb(255, 255, 255), rgba(255, 255, 255, 0))',

color: hsvaToHslaString(hsva)
}))));
})))));
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmRleC50c3giXSwibmFtZXMiOlsiUmVhY3QiLCJ1c2VSZWYiLCJ1c2VJbXBlcmF0aXZlSGFuZGxlIiwiaHN2YVRvSHNsYVN0cmluZyIsIlBvaW50ZXIiLCJjYWxjdWxhdG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yLmN1cnJlbnQhKTtcbiAgICBjb25zdCBjb250YWluZXJTdHlsZTogUmVhY3QuQ1NTUHJvcGVydGllcyA9IHtcbiAgICAgIHdpZHRoOiAyMDAsXG4gICAgICBoZWlnaHQ6IDIwMCxcbiAgICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiBgaHNsKCR7aHN2YS5ofSwxMDAlLCA1MCUpYCxcbiAgICB9O1xuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIGNsYXNzTmFtZT17cHJlZml4Q2xzfVxuICAgICAgICBzdHlsZT17Y29udGFpbmVyU3R5bGV9XG4gICAgICAgIHJlZj17Y29udGFpbmVyfVxuICAgICAgICB7Li4ub3RoZXJ9XG4gICAgICAgIG9uTW91c2VEb3duPXsoZXZlbnQpID0+IHtcbiAgICAgICAgICBjb25zdCByZWN0ID0gY2FsY3VsYXRlQ2hhbmdlKGV2ZW50IGFzIGFueSwgaHN2YSwgY29udGFpbmVyLmN1cnJlbnQhKTtcbiAgICAgICAgICBvbkNoYW5nZSAmJiBvbkNoYW5nZShyZWN0KTtcbiAgICAgICAgfX1cbiAgICAgID5cbiAgICAgICAgPGRpdlxuICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICBpbnNldDogMCxcbiAgICAgICAgICAgIGJhY2tncm91bmQ6XG4gICAgICAgICAgICAgICdsaW5lYXItZ3JhZGllbnQodG8gcmlnaHQsIHJnYigyNTUsIDI1NSwgMjU1KSwgcmdiYSgyNTUsIDI1NSwgMjU1LCAwKSknLFxuICAgICAgICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICAgICAgfX1cbiAgICAgICAgPlxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICAgIGluc2V0OiAwLFxuICAgICAgICAgICAgICBiYWNrZ3JvdW5kOlxuICAgICAgICAgICAgICAgICdsaW5lYXItZ3JhZGllbnQodG8gdG9wLCByZ2IoMCwgMCwgMCksIHJnYmEoMCwgMCwgMCwgMCkpJyxcbiAgICAgICAgICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICAgICAgICB9fVxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxQb2ludGVyXG4gICAgICAgICAgICAgIHByZWZpeENscz17cHJlZml4Q2xzfVxuICAgICAgICAgICAgICB0b3A9e2AkezEwMCAtIGhzdmEudn0lYH1cbiAgICAgICAgICAgICAgbGVmdD17YCR7aHN2YS5zfSVgfVxuICAgICAgICAgICAgICBjb2xvcj17aHN2YVRvSHNsYVN0cmluZyhoc3ZhKX1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfSxcbik7XG4iXX0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmRleC50c3giXSwibmFtZXMiOlsiUmVhY3QiLCJoc3ZhVG9Ic2xhU3RyaW5nIiwiSW50ZXJhY3RpdmUiLCJQb2ludGVyIiwiZm9yd2FyZFJlZiIsInByb3BzIiwicmVmIiwicHJlZml4Q2xzIiwiY2xhc3NOYW1lIiwic3R5bGUiLCJoc3ZhIiwib25DaGFuZ2UiLCJvdGhlciIsImNvbnRhaW5lclN0eWxlIiwid2lkdGgiLCJoZWlnaHQiLCJwb3NpdGlvbiIsImJhY2tncm91bmRDb2xvciIsImgiLCJoYW5kbGVDaGFuZ2UiLCJpbnRlcmFjdGlvbiIsImV2ZW50IiwicyIsImxlZnQiLCJ2IiwidG9wIiwiYSIsImluc2V0IiwiYmFja2dyb3VuZCJdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU9BLEtBQVAsTUFBa0IsT0FBbEI7QUFDQSxTQUFvQkMsZ0JBQXBCLFFBQTRDLG9CQUE1QztBQUNBLE9B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diKDI1NSwgMjU1LCAyNTUpLCByZ2JhKDI1NSwgMjU1LCAyNTUsIDApKScsXG4gICAgICAgICAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICAgICAgICB9fVxuICAgICAgICA+XG4gICAgICAgICAgPGRpdlxuICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgaW5zZXQ6IDAsXG4gICAgICAgICAgICAgIGJhY2tncm91bmQ6ICdsaW5lYXItZ3JhZGllbnQodG8gdG9wLCByZ2IoMCwgMCwgMCksIHJnYmEoMCwgMCwgMCwgMCkpJyxcbiAgICAgICAgICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICAgICAgICB9fVxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxQb2ludGVyIHByZWZpeENscz17cHJlZml4Q2xzfSB0b3A9e2AkezEwMCAtIGhzdmEudn0lYH0gbGVmdD17YCR7aHN2YS5zfSVgfSBjb2xvcj17aHN2YVRvSHNsYVN0cmluZyhoc3ZhKX0gLz5cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L0ludGVyYWN0aXZlPlxuICAgIDwvZGl2PlxuICApO1xufSk7XG4iXX0=
import React from 'react';
interface PointerProps extends React.HTMLAttributes<HTMLDivElement> {
export interface PointerProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;

@@ -8,3 +8,2 @@ top?: string;

}
export declare const Pointer: ({ className, color, left, top, prefixCls, }: PointerProps) => JSX.Element;
export {};
export declare const Pointer: ({ className, color, left, top, prefixCls }: PointerProps) => JSX.Element;
import React from 'react';
import { useMemo } from 'react';
var BOXSHADOW = 'rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px';
export var Pointer = function Pointer(_ref) {

@@ -13,17 +15,26 @@ var className = _ref.className,

};
return /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-pointer ").concat(className || ''),
style: style
}, /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-fill"),
style: {
width: 5,
height: 5,
transform: 'translate(-3px, -3px)',
boxShadow: 'rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px',
borderRadius: '50%',
backgroundColor: color
}
}));
return useMemo(function () {
return /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-pointer ").concat(className || ''),
style: style
}, /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-fill"),
style: {
width: 5,
height: 5,
transform: 'translate(-3px, -3px)',
boxShadow: BOXSHADOW,
borderRadius: '50%',
backgroundColor: '#fff'
}
}, /*#__PURE__*/React.createElement("div", {
style: {
inset: 0,
borderRadius: '50%',
position: 'absolute',
backgroundColor: color
}
})));
}, [top, left, color, className, prefixCls]);
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Qb2ludGVyLnRzeCJdLCJuYW1lcyI6WyJSZWFjdCIsIlBvaW50ZXIiLCJjbGFzc05hbWUiLCJjb2xvciIsImxlZnQiLCJ0b3AiLCJwcmVmaXhDbHMiLCJzdHlsZSIsInBvc2l0aW9uIiwid2lkdGgiLCJoZWlnaHQiLCJ0cmFuc2Zvcm0iLCJib3hTaGFkb3ciLCJib3JkZXJSYWRpdXMiLCJiYWNrZ3JvdW5kQ29sb3IiXSwibWFwcGluZ3MiOiJBQUFBLE9BQU9BLEtBQVAsTUFBa0IsT0FBbEI7QUFTQSxPQUFPLElBQU1DLE9BQU8sR0FBRyxTQUFWQSxPQUFVLE9BTVU7QUFBQSxNQUwvQkMsU0FLK0IsUUFML0JBLFNBSytCO0FBQUEsTUFKL0JDLEtBSStCLFFBSi9CQSxLQUkrQjtBQUFBLE1BSC9CQyxJQUcrQixRQUgvQkEsSUFHK0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gcHJlZml4Q2xzLFxufTogUG9pbnRlclByb3BzKTogSlNYLkVsZW1lbnQgPT4ge1xuICBjb25zdCBzdHlsZTogUmVhY3QuQ1NTUHJvcGVydGllcyA9IHtcbiAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICB0b3AsXG4gICAgbGVmdCxcbiAgfTtcblxuICByZXR1cm4gKFxuICAgIDxkaXYgY2xhc3NOYW1lPXtgJHtwcmVmaXhDbHN9LXBvaW50ZXIgJHtjbGFzc05hbWUgfHwgJyd9YH0gc3R5bGU9e3N0eWxlfT5cbiAgICAgIDxkaXZcbiAgICAgICAgY2xhc3NOYW1lPXtgJHtwcmVmaXhDbHN9LWZpbGxgfVxuICAgICAgICBzdHlsZT17e1xuICAgICAgICAgIHdpZHRoOiA1LFxuICAgICAgICAgIGhlaWdodDogNSxcbiAgICAgICAgICB0cmFuc2Zvcm06ICd0cmFuc2xhdGUoLTNweCwgLTNweCknLFxuICAgICAgICAgIGJveFNoYWRvdzpcbiAgICAgICAgICAgICdyZ2IoMjU1IDI1NSAyNTUpIDBweCAwcHggMHB4IDEuNXB4LCByZ2IoMCAwIDAgLyAzMCUpIDBweCAwcHggMXB4IDFweCBpbnNldCwgcmdiKDAgMCAwIC8gNDAlKSAwcHggMHB4IDFweCAycHgnLFxuICAgICAgICAgIGJvcmRlclJhZGl1czogJzUwJScsXG4gICAgICAgICAgYmFja2dyb3VuZENvbG9yOiBjb2xvcixcbiAgICAgICAgfX1cbiAgICAgIC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Qb2ludGVyLnRzeCJdLCJuYW1lcyI6WyJSZWFjdCIsInVzZU1lbW8iLCJCT1hTSEFET1ciLCJQb2ludGVyIiwiY2xhc3NOYW1lIiwiY29sb3IiLCJsZWZ0IiwidG9wIiwicHJlZml4Q2xzIiwic3R5bG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TogUmVhY3QuQ1NTUHJvcGVydGllcyA9IHtcbiAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICB0b3AsXG4gICAgbGVmdCxcbiAgfTtcbiAgcmV0dXJuIHVzZU1lbW8oXG4gICAgKCkgPT4gKFxuICAgICAgPGRpdiBjbGFzc05hbWU9e2Ake3ByZWZpeENsc30tcG9pbnRlciAke2NsYXNzTmFtZSB8fCAnJ31gfSBzdHlsZT17c3R5bGV9PlxuICAgICAgICA8ZGl2XG4gICAgICAgICAgY2xhc3NOYW1lPXtgJHtwcmVmaXhDbHN9LWZpbGxgfVxuICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICB3aWR0aDogNSxcbiAgICAgICAgICAgIGhlaWdodDogNSxcbiAgICAgICAgICAgIHRyYW5zZm9ybTogJ3RyYW5zbGF0ZSgtM3B4LCAtM3B4KScsXG4gICAgICAgICAgICBib3hTaGFkb3c6IEJPWFNIQURPVyxcbiAgICAgICAgICAgIGJvcmRlclJhZGl1czogJzUwJScsXG4gICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6ICcjZmZmJyxcbiAgICAgICAgICB9fVxuICAgICAgICA+XG4gICAgICAgICAgPGRpdlxuICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgaW5zZXQ6IDAsXG4gICAgICAgICAgICAgIGJvcmRlclJhZGl1czogJzUwJScsXG4gICAgICAgICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IGNvbG9yLFxuICAgICAgICAgICAgfX1cbiAgICAgICAgICAvPlxuICAgICAgICA8L2Rpdj5cbiAgICAgIDwvZGl2PlxuICAgICksXG4gICAgW3RvcCwgbGVmdCwgY29sb3IsIGNsYXNzTmFtZSwgcHJlZml4Q2xzXSxcbiAgKTtcbn07XG4iXX0=
{
"name": "@uiw/react-color-saturation",
"version": "0.0.1",
"version": "0.0.2",
"description": "Color Saturation",

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

"keywords": [
"react",
"react-color",
"react-color-saturation",
"saturation",
"color",

@@ -24,3 +28,4 @@ "convert"

"@babel/runtime": "7.14.6",
"@uiw/color-convert": "0.0.1"
"@uiw/color-convert": "^0.0.2",
"@uiw/react-drag-event-interactive": "^0.0.2"
},

@@ -34,3 +39,4 @@ "devDependencies": {

"react-test-renderer": "17.0.2"
}
},
"gitHead": "9505befd9da79920b371501b8cf2a320f3ab70c7"
}

@@ -13,7 +13,13 @@ Color Saturation

```js
import ColorSaturation from '@uiw/react-color-saturation';
import Saturation from '@uiw/react-color-saturation';
function Demo() {
const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
return (
<ColorSaturation hsva={{ h: 0, s: 75, v: 82, a: 1 }} />
<Saturation
hsva={hsva}
onChange={(newColor) => {
setHsva({ ...hsva, ...newColor, a: hsva.a });
}}
/>
);

@@ -20,0 +26,0 @@ }

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