@@ -86,7 +86,7 @@ export function AIFilterInput() {
8686 stiffness : 300 ,
8787 damping : 30 ,
8888 } }
89- className = "relative"
89+ className = "relative h-6 min-w-44 "
9090 >
9191 < AnimatePresence >
9292 { isFocused && (
@@ -95,60 +95,62 @@ export function AIFilterInput() {
9595 animate = { { opacity : 1 } }
9696 exit = { { opacity : 0 } }
9797 transition = { { duration : 0.2 , ease : "linear" } }
98- className = "animated-gradient-glow pointer-events-none absolute inset-0"
98+ className = "animated-gradient-glow-small pointer-events-none absolute inset-0 h-6 "
9999 />
100100 ) }
101101 </ AnimatePresence >
102- < Input
103- type = "text"
104- name = "text"
105- variant = "secondary-small"
106- placeholder = "Describe your filters…"
107- value = { text }
108- onChange = { ( e ) => setText ( e . target . value ) }
109- disabled = { isLoading }
110- fullWidth
111- ref = { inputRef }
112- className = { cn (
113- "disabled:text-text-dimmed/50" ,
114- isFocused && "placeholder:text-text-dimmed"
115- ) }
116- containerClassName = "has-[:disabled]:opacity-100"
117- onKeyDown = { ( e ) => {
118- if ( e . key === "Enter" && text . trim ( ) && ! isLoading ) {
119- e . preventDefault ( ) ;
120- const form = e . currentTarget . closest ( "form" ) ;
121- if ( form ) {
122- form . requestSubmit ( ) ;
102+ < div className = "absolute inset-0 left-0 top-0 h-6" >
103+ < Input
104+ type = "text"
105+ name = "text"
106+ variant = "secondary-small"
107+ placeholder = "Describe your filters…"
108+ value = { text }
109+ onChange = { ( e ) => setText ( e . target . value ) }
110+ disabled = { isLoading }
111+ fullWidth
112+ ref = { inputRef }
113+ className = { cn (
114+ "disabled:text-text-dimmed/50" ,
115+ isFocused && "placeholder:text-text-dimmed"
116+ ) }
117+ containerClassName = "has-[:disabled]:opacity-100"
118+ onKeyDown = { ( e ) => {
119+ if ( e . key === "Enter" && text . trim ( ) && ! isLoading ) {
120+ e . preventDefault ( ) ;
121+ const form = e . currentTarget . closest ( "form" ) ;
122+ if ( form ) {
123+ form . requestSubmit ( ) ;
124+ }
123125 }
126+ } }
127+ onFocus = { ( ) => setIsFocused ( true ) }
128+ onBlur = { ( ) => {
129+ // Only blur if the text is empty or we're not loading
130+ if ( text . length === 0 || ! isLoading ) {
131+ setIsFocused ( false ) ;
132+ }
133+ } }
134+ icon = { < AISparkleIcon className = "size-4" /> }
135+ accessory = {
136+ isLoading ? (
137+ < Spinner
138+ color = { {
139+ background : "rgba(99, 102, 241, 1)" ,
140+ foreground : "rgba(217, 70, 239, 1)" ,
141+ } }
142+ className = "size-4 opacity-80"
143+ />
144+ ) : text . length > 0 ? (
145+ < ShortcutKey
146+ shortcut = { { key : "enter" } }
147+ variant = "small"
148+ className = { cn ( "transition-opacity" , text . length === 0 && "opacity-0" ) }
149+ />
150+ ) : undefined
124151 }
125- } }
126- onFocus = { ( ) => setIsFocused ( true ) }
127- onBlur = { ( ) => {
128- // Only blur if the text is empty or we're not loading
129- if ( text . length === 0 || ! isLoading ) {
130- setIsFocused ( false ) ;
131- }
132- } }
133- icon = { < AISparkleIcon className = "size-4" /> }
134- accessory = {
135- isLoading ? (
136- < Spinner
137- color = { {
138- background : "rgba(99, 102, 241, 1)" ,
139- foreground : "rgba(217, 70, 239, 1)" ,
140- } }
141- className = "size-4"
142- />
143- ) : text . length > 0 ? (
144- < ShortcutKey
145- shortcut = { { key : "enter" } }
146- variant = "small"
147- className = { cn ( "transition-opacity" , text . length === 0 && "opacity-0" ) }
148- />
149- ) : undefined
150- }
151- />
152+ />
153+ </ div >
152154 </ motion . div >
153155 </ ErrorPopover >
154156 </ fetcher . Form >
0 commit comments