@@ -86,7 +86,7 @@ export function AIFilterInput() {
86
86
stiffness : 300 ,
87
87
damping : 30 ,
88
88
} }
89
- className = "relative"
89
+ className = "relative h-6 min-w-44 "
90
90
>
91
91
< AnimatePresence >
92
92
{ isFocused && (
@@ -95,60 +95,62 @@ export function AIFilterInput() {
95
95
animate = { { opacity : 1 } }
96
96
exit = { { opacity : 0 } }
97
97
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 "
99
99
/>
100
100
) }
101
101
</ 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
+ }
123
125
}
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
124
151
}
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 >
152
154
</ motion . div >
153
155
</ ErrorPopover >
154
156
</ fetcher . Form >
0 commit comments