import{e as i,c as b,o as r,X as g,I as l,n as t,W as u,m as f,_ as k,w as p,bz as v,Z as z,$ as C,a5 as V,x as w,a6 as $,b as d,C as I}from"./BoB2h2qv.js";import{_ as y}from"./Bj6F-phl.js";import h from"./C5t96Cvs.js";const B=i({__name:"InputGroup",props:{class:{}},setup(s){const a=s;return(n,e)=>(r(),b("div",{"data-slot":"input-group",role:"group",class:l(t(u)("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none","h-10 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-offset-2 has-[[data-slot=input-group-control]:focus-visible]:ring-offset-background",a.class))},[g(n.$slots,"default")],2))}}),G=["data-align"],j=i({__name:"InputGroupAddon",props:{align:{default:"inline-start"},class:{}},setup(s){const a=s;function n(e){const o=e.currentTarget,c=e.target;c&&c.closest("button")||o&&o?.parentElement&&o.parentElement?.querySelector("input")?.focus()}return(e,o)=>(r(),b("div",{role:"group","data-slot":"input-group-addon","data-align":a.align,class:l(t(u)(t(M)({align:a.align}),a.class)),onClick:n},[g(e.$slots,"default")],10,G))}}),A=i({__name:"InputGroupButton",props:{variant:{default:"ghost"},size:{default:"xs"},class:{}},setup(s){const a=s;return(n,e)=>(r(),f(t(k),{"data-size":a.size,variant:a.variant,class:l(t(u)(t(S)({size:a.size}),a.class))},{default:p(()=>[g(n.$slots,"default")]),_:3},8,["data-size","variant","class"]))}}),E=i({__name:"InputGroupInput",props:{class:{}},setup(s){const a=s;return(n,e)=>(r(),f(t(y),{"data-slot":"input-group-control",class:l(t(u)("flex-1 rounded-none border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-transparent ring-offset-transparent dark:bg-transparent",a.class))},null,8,["class"]))}}),M=v("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5","block-end":"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}}),S=v("text-sm shadow-none flex gap-2 items-center",{variants:{size:{xs:"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",sm:"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}}),N=i({__name:"search-input",props:z({placeholder:{default:""},icon:{default:"ri:search-line"},groupClass:{default:void 0},inputClass:{default:void 0},addonClass:{default:void 0},clearable:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const a=C(s,"modelValue"),n=s,e=V(),o=w(()=>n.clearable&&!!a.value),c=()=>{a.value=""};return(x,m)=>(r(),f(t(B),$(t(e),{class:t(u)("w-full",s.groupClass)}),{default:p(()=>[d(t(j),{class:l(t(u)("text-muted-foreground",s.addonClass))},{default:p(()=>[d(t(h),{name:s.icon,class:"size-4"},null,8,["name"])]),_:1},8,["class"]),d(t(E),{modelValue:a.value,"onUpdate:modelValue":m[0]||(m[0]=_=>a.value=_),placeholder:s.placeholder,class:l(s.inputClass)},null,8,["modelValue","placeholder","class"]),o.value?(r(),f(t(A),{key:0,variant:"ghost",size:"icon-xs","aria-label":"Clear",onClick:c},{default:p(()=>[d(t(h),{name:"ri:close-line",class:"size-4"})]),_:1})):I("",!0),g(x.$slots,"default")]),_:3},16,["class"]))}}),P=Object.assign(N,{__name:"SearchInput"});export{P as _};
