UNPKG

@chief-editor/ui

Version:

UI Component for chief editor

1 lines 1.2 kB
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(o){for(var t,e=1,r=arguments.length;e<r;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o}).apply(this,arguments)},__rest=this&&this.__rest||function(o,t){var e={};for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&t.indexOf(r)<0&&(e[r]=o[r]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(o);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(o,r[n])&&(e[r[n]]=o[r[n]])}return e};import{RcColor}from"@rc-hooks/color";import React from"react";import{ColorContent}from"./components/ColorContent";import{Hue}from"./Hue";import{Saturation}from"./Saturation";export function ColorPanel(o){var t=o.children,e=o.onChange,r=o.onValueChange,n=o.value,a=o.hasAlpha,l=o.format,i=void 0===l?"hex":l,s=__rest(o,["children","onChange","onValueChange","value","hasAlpha","format"]);return React.createElement(RcColor,{hasAlpha:a,value:n,format:i,onChange:e,onValueChange:r},React.createElement(ColorContent,__assign({hasAlpha:a},s),t))}ColorPanel.Hue=Hue,ColorPanel.Saturation=Saturation;