theme.keycloak.v2.admin.resources.assets.DropdownPanel-CvKbZ6hZ.js Maven / Gradle / Ivy
import{jsxs as s,jsx as i}from"react/jsx-runtime";import{useRef as u,useEffect as d}from"react";import{ca as f,aN as v}from"./index-C1LIsRX7.js";const y=({buttonText:o,children:c,setSearchDropdownOpen:e,searchDropdownOpen:a,marginRight:l,width:r})=>{const t=u(null);return d(()=>{const n=m=>{t.current&&!t.current.contains(m.target)&&e(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[e]),d(()=>{const n=()=>{document.visibilityState==="hidden"&&e(!1)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[e]),s("span",{ref:t,children:[s("button",{className:"kc-dropdown-panel",onClick:()=>e(!a),"aria-label":o,style:{width:r,marginRight:l},"data-testid":"dropdown-panel-btn",children:[o,i(f,{className:"kc-dropdown-panel-icon",children:i(v,{})})]}),a&&i("div",{className:"kc-dropdown-panel-content",children:c})]})};export{y as D};
//# sourceMappingURL=DropdownPanel-CvKbZ6hZ.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy