import{r as i,j as e,w as a}from"./index-C9vqJYWU.js";import{j as h}from"./command-CfddNxWu.js";const p=i.forwardRef(({className:c,containerClassName:d,onSearch:o,...t},f)=>{const[n,u]=i.useState(""),b=r=>{const l=r.target.value;u(l),o?.(l)},s=()=>{o?.(n)},x=r=>{r.key==="Enter"&&s(),t.onKeyDown?.(r)};return e.jsxs("div",{className:a("relative flex items-center h-11 min-w-[70px] w-full max-w-[504px] rounded-[30px] pl-4 pr-1 py-1","bg-muted/5 shadow-inner","before:absolute before:inset-0 before:rounded-[30px] before:p-px","before:bg-gradient-to-r before:from-white/100 before:via-white/0 before:to-white/100","before:-z-10","isolate",d),children:[e.jsx("div",{className:"absolute inset-px rounded-[30px] bg-transparent -z-[1]"}),e.jsx("input",{ref:f,type:"text",value:n,onChange:b,onKeyDown:x,className:a("flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground","text-foreground",c),placeholder:t.placeholder||"Search...",...t}),e.jsx("button",{type:"button",onClick:s,className:a("flex items-center justify-center w-9 h-9 rounded-[33px] bg-background dark:bg-card shrink-0","transition-transform hover:scale-105 active:scale-95","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"),"aria-label":"Search",children:e.jsx(h,{className:"w-4 h-4 text-foreground"})})]})});p.displayName="GlobalSearch";
