Socket
Socket
Sign inDemoInstall

@uiw/react-color-swatch

Package Overview
Dependencies
1
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2 to 1.2.3

4

cjs/index.d.ts
import React from 'react';
import { HsvaColor } from '@uiw/color-convert';
import { HsvaColor, ColorResult } from '@uiw/color-convert';
export type SwatchPresetColor = {

@@ -21,3 +21,3 @@ color: string;

rectRender?: (props: SwatchRectRenderProps) => JSX.Element;
onChange?: (hsva: HsvaColor) => void;
onChange?: (hsva: HsvaColor, color: ColorResult, evn: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
addonAfter?: React.ReactNode;

@@ -24,0 +24,0 @@ addonBefore?: React.ReactNode;

@@ -41,4 +41,4 @@ "use strict";

}, rectProps.style);
var handleClick = function handleClick(hex) {
onChange && onChange((0, _colorConvert.hexToHsva)(hex));
var handleClick = function handleClick(hex, evn) {
onChange && onChange((0, _colorConvert.hexToHsva)(hex), (0, _colorConvert.color)((0, _colorConvert.hexToHsva)(hex)), evn);
};

@@ -75,4 +75,4 @@ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({

}),
onClick: function onClick() {
return handleClick(background);
onClick: function onClick(evn) {
return handleClick(background, evn);
}

@@ -88,4 +88,4 @@ });

title: title,
onClick: function onClick() {
return handleClick(background);
onClick: function onClick(evn) {
return handleClick(background, evn);
}

@@ -92,0 +92,0 @@ }, rectProps), {}, {

import React from 'react';
import { HsvaColor } from '@uiw/color-convert';
import { HsvaColor, ColorResult } from '@uiw/color-convert';
export type SwatchPresetColor = {

@@ -21,3 +21,3 @@ color: string;

rectRender?: (props: SwatchRectRenderProps) => JSX.Element;
onChange?: (hsva: HsvaColor) => void;
onChange?: (hsva: HsvaColor, color: ColorResult, evn: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
addonAfter?: React.ReactNode;

@@ -24,0 +24,0 @@ addonBefore?: React.ReactNode;

@@ -5,3 +5,3 @@ import _extends from "@babel/runtime/helpers/extends";

import React from 'react';
import { hexToHsva } from '@uiw/color-convert';
import { hexToHsva, color as handleColor } from '@uiw/color-convert';
import { jsx as _jsx } from "react/jsx-runtime";

@@ -34,4 +34,4 @@ import { jsxs as _jsxs } from "react/jsx-runtime";

}, rectProps.style);
var handleClick = hex => {
onChange && onChange(hexToHsva(hex));
var handleClick = (hex, evn) => {
onChange && onChange(hexToHsva(hex), handleColor(hexToHsva(hex)), evn);
};

@@ -68,3 +68,3 @@ return /*#__PURE__*/_jsxs("div", _extends({

}),
onClick: () => handleClick(background)
onClick: evn => handleClick(background, evn)
});

@@ -79,3 +79,3 @@ }

title: title,
onClick: () => handleClick(background)
onClick: evn => handleClick(background, evn)
}, rectProps, {

@@ -82,0 +82,0 @@ children: child,

{
"name": "@uiw/react-color-swatch",
"version": "1.2.2",
"version": "1.2.3",
"description": "Color swatch component for React.",

@@ -38,3 +38,3 @@ "homepage": "https://uiwjs.github.io/react-color/#/swatch",

"dependencies": {
"@uiw/color-convert": "1.2.2"
"@uiw/color-convert": "1.2.3"
},

@@ -41,0 +41,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc