import{r as u,j as t,w as i,H as m}from"./index-C9vqJYWU.js";import{j as p}from"./command-CfddNxWu.js";import{F as v}from"./funnel-4MrLJ-fr.js";const h=({children:l,variant:s="search",className:r})=>{const e=s==="filter"||s==="date";return t.jsxs("div",{className:i("relative flex items-center h-10 min-w-[70px] w-full max-w-[504px] rounded-[30px] pl-4 pr-1 py-1","bg-background dark:bg-card backdrop-blur-[4px]",e?"border border-transparent 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":"shadow-[0px_1px_2px_0px_rgba(16,24,40,0.05),0px_4px_20px_0px_rgba(0,0,0,0.08)]",r),children:[e&&t.jsx("div",{className:"absolute inset-px rounded-[30px] bg-background dark:bg-card -z-[1]"}),l]})},w=u.forwardRef(({className:l,containerClassName:s,onSearch:r,...e},n)=>{const[d,a]=u.useState(e.value?.toString()||"");u.useEffect(()=>{e.value!==void 0&&a(e.value.toString())},[e.value]);const f=c=>{const o=c.target.value;a(o),e.onChange?.(c),r?.(o)},x=()=>{r?.(d)},b=c=>{c.key==="Enter"&&x(),e.onKeyDown?.(c)};return t.jsxs(h,{variant:"search",className:s,children:[t.jsx("input",{ref:n,type:"text",value:d,onChange:f,onKeyDown:b,className:i("flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",l),...e}),t.jsx("button",{type:"button",onClick:x,className:i("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:t.jsx(p,{className:"w-4 h-4 text-foreground"})})]})});w.displayName="SearchInput";const y=u.forwardRef(({className:l,containerClassName:s,onFilter:r,active:e,...n},d)=>{const[a,f]=u.useState(n.value?.toString()||"");u.useEffect(()=>{n.value!==void 0&&f(n.value.toString())},[n.value]);const x=o=>{const g=o.target.value;f(g),n.onChange?.(o),r?.(g)},b=()=>{r?.(a)},c=o=>{o.key==="Enter"&&b(),n.onKeyDown?.(o)};return t.jsxs(h,{variant:"filter",className:s,children:[t.jsx("input",{ref:d,type:"text",value:a,onChange:x,onKeyDown:c,className:i("flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",l),...n}),t.jsx("button",{type:"button",onClick:b,className:i("flex items-center justify-center w-9 h-9 rounded-[33px] shrink-0 transition-all",e||a?"bg-primary hover:bg-primary/90":"bg-background dark:bg-card hover:bg-muted","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"),"aria-label":"Filter",children:t.jsx(v,{className:i("w-4 h-4",e||a?"text-white":"text-foreground")})})]})});y.displayName="FilterInput";const j=u.forwardRef(({className:l,containerClassName:s,onDateSelect:r,...e},n)=>{const d=a=>{e.onChange?.(a),r?.(a.target.value)};return t.jsxs(h,{variant:"date",className:s,children:[t.jsx("input",{ref:n,type:"date",onChange:d,className:i("flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground","[&::-webkit-calendar-picker-indicator]:hidden",l),...e}),t.jsx("button",{type:"button",onClick:()=>{n.current?.showPicker?.()},className:i("flex items-center justify-center w-9 h-9 rounded-[33px] bg-primary 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":"Select date",children:t.jsx(m,{className:"w-4 h-4 text-white"})})]})});j.displayName="DateInput";export{w as S};
