import{r as u,j as e}from"./iframe-p4aYZyoq.js";import{S as d}from"./search-CiD9rZJ0.js";import{S as h}from"./spinner-CEdkaGgP.js";import{S as f}from"./times-DeY5Bu0x.js";const v=({value:t,onChange:n,onKeyDown:o,placeholder:p,isLoading:i=!1,...c})=>{const a=u.useRef(null),s=()=>{var l;(l=a==null?void 0:a.current)==null||l.focus(),t&&!i&&(n==null||n({target:{value:""}}))};let r;return i?r=e.jsx(h,{width:14,height:14}):t?r=e.jsx(f,{width:14,height:14}):r=e.jsx(d,{width:14,height:14}),e.jsxs("span",{className:"search-input",children:[e.jsx("input",{"data-testid":"search-input",type:"search",value:t,onChange:n,onKeyDown:o,placeholder:p,ref:a,...c}),e.jsx("span",{"data-testid":"search-input-suffix",role:"presentation",className:"search-input__suffix",onKeyPress:s,onClick:s,children:r})]})};try{searchinput.displayName="searchinput",searchinput.__docgenInfo={description:"",displayName:"searchinput",props:{value:{defaultValue:null,description:"The value to display in the text input.",name:"value",required:!1,type:{name:"string | (string & readonly string[])"}},onChange:{defaultValue:null,description:"Value change callback for the text input component.",name:"onChange",required:!1,type:{name:"ChangeEventHandler<HTMLInputElement>"}},onKeyDown:{defaultValue:null,description:"Key pressed callback for the text input component.",name:"onKeyDown",required:!1,type:{name:"(((event: KeyboardEvent<HTMLInputElement>) => void) & KeyboardEventHandler<HTMLInputElement>)"}},placeholder:{defaultValue:null,description:"Text to place in the text input component in the absence of value.",name:"placeholder",required:!1,type:{name:"string"}},isLoading:{defaultValue:{value:"false"},description:"Text to place in the text input component in the absence of value.",name:"isLoading",required:!1,type:{name:"boolean"}}}}}catch{}export{v as S};
