import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["color","value","clickHandler","opacity","description","className","rgba"];import"./ColorPreview.css";import{IconCopy}from"@consta/icons/IconCopy";import React from"react";import{Text}from"../../../components/Text/Text";import{cn}from"../../cn";import*as wp from"../../whitepaper/whitepaper";var cnColorPreview=cn("ColorPreview");export var ColorPreview=function(a){var b=a.color,c=a.value,d=a.clickHandler,e=a.opacity,f=a.description,g=a.className,h=a.rgba,i=_objectWithoutProperties(a,_excluded);return React.createElement("div",Object.assign({},i,{className:cnColorPreview("",[wp.ptIconPlus(),g])}),React.createElement("div",{className:cnColorPreview("Circle",[wp.ptIconPlus("icon",{"vertical-align":"top","indent-r":"m"}),wp.decorator({"indent-b":"l"})]),style:h?{color:"rgba(var(".concat(b,"), 0.5)")}:{color:"var(".concat(b,")")}}),React.createElement("div",{className:wp.ptIconPlus("block")},React.createElement(Text,{as:"h3",size:"m",font:"mono",view:"primary",lineHeight:"m",className:cnColorPreview("Name",[wp.decorator({"indent-b":"2xs","indent-l":"2xs"})])},b),React.createElement("div",{className:cnColorPreview("ColorCode",[wp.decorator({"indent-t":"none","space-h":"2xs"})]),onClick:function onClick(){navigator.clipboard.writeText(c),d()}},React.createElement(IconCopy,{size:"xs"}),React.createElement(Text,{size:"s",font:"mono",view:"primary",lineHeight:"m"},c)),React.createElement(Text,{as:"p",size:"s",view:"primary",lineHeight:"m",className:cnColorPreview("Description",[wp.decorator({"indent-t":"none","indent-l":"2xs"})])},f)))};export default ColorPreview;
//# sourceMappingURL=ColorPreview.js.map