| 1 |
import{j as o}from"./jsx-runtime.js?ver=1.6.4";import{e as i,f as p}from"./Icons.js?ver=1.6.4";import{b as s}from"./BlockEditorTranslator.js?ver=1.6.4";const{Button:d,Dropdown:m,ColorPicker:x}=wp.components,{Fragment:j}=wp.element,v=l=>{const{label:n,value:r,onChange:e}=l,c=()=>{e(null)};return o.jsxs("div",{className:"fct-color-picker-control-wrap",children:[o.jsx("span",{className:"label",children:n}),o.jsx("div",{className:"fct-color-picker-control-action-wrap",children:o.jsx(m,{popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:a,onToggle:t})=>o.jsx(j,{children:o.jsxs("div",{className:"fct-color-picker-control-action",children:[o.jsx("div",{className:`picker-button ${r?"has-color":""}`,style:{backgroundColor:r},onClick:t,"aria-expanded":a,children:!r&&o.jsx(i,{})}),o.jsx("span",{className:`picker-text ${r?"has-color":""}`,children:r||s("Add...")}),r&&o.jsx("span",{className:"picker-remove",onClick:c,children:o.jsx(p,{})})]})}),renderContent:()=>o.jsxs("div",{children:[o.jsx(x,{enableAlpha:!0,color:r,onChange:e}),o.jsx(d,{onClick:c,variant:"secondary",size:"compact",children:s("Clear")})]})})})]})};export{v as C}; |