@@ -28,10 +28,7 @@ import {
28
28
PromptInputModelSelectTrigger ,
29
29
PromptInputModelSelectContent ,
30
30
} from './elements/prompt-input' ;
31
- import {
32
- SelectItem ,
33
- SelectValue ,
34
- } from '@/components/ui/select' ;
31
+ import { SelectItem , SelectValue } from '@/components/ui/select' ;
35
32
import equal from 'fast-deep-equal' ;
36
33
import type { UseChatHelpers } from '@ai-sdk/react' ;
37
34
import { AnimatePresence , motion } from 'framer-motion' ;
@@ -83,15 +80,13 @@ function PureMultimodalInput({
83
80
84
81
const adjustHeight = ( ) => {
85
82
if ( textareaRef . current ) {
86
- textareaRef . current . style . height = 'auto' ;
87
- textareaRef . current . style . height = `${ textareaRef . current . scrollHeight + 2 } px` ;
83
+ textareaRef . current . style . height = '72px' ;
88
84
}
89
85
} ;
90
86
91
87
const resetHeight = ( ) => {
92
88
if ( textareaRef . current ) {
93
- textareaRef . current . style . height = 'auto' ;
94
- textareaRef . current . style . height = '98px' ;
89
+ textareaRef . current . style . height = '72px' ;
95
90
}
96
91
} ;
97
92
@@ -269,7 +264,7 @@ function PureMultimodalInput({
269
264
/>
270
265
271
266
< PromptInput
272
- className = "border border-transparent shadow-lg transition-all duration-200 shadow-black/10 hover :border-primary/20 focus-within:border -primary/30 focus-within:shadow-xl focus-within:shadow -primary/20 "
267
+ className = "bg-gray-50 rounded-3xl border border-gray-300 shadow-none transition-all duration-200 dark:bg-sidebar dark :border-sidebar-border hover:ring-1 hover:ring -primary/30 focus-within:ring-1 focus-within:ring -primary/50 "
273
268
onSubmit = { ( event ) => {
274
269
event . preventDefault ( ) ;
275
270
if ( status !== 'ready' ) {
@@ -319,15 +314,14 @@ function PureMultimodalInput({
319
314
placeholder = "Send a message..."
320
315
value = { input }
321
316
onChange = { handleInput }
322
- minHeight = { 48 }
323
- maxHeight = { 48 }
317
+ minHeight = { 72 }
318
+ maxHeight = { 200 }
324
319
disableAutoResize = { true }
325
- style = { { height : '48px' , minHeight : '48px' , maxHeight : '48px' } }
326
- className = "text-sm resize-none py-1 px-3 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]"
320
+ className = "text-base resize-none py-4 px-4 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] bg-transparent !border-0 !border-none outline-none ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none"
327
321
rows = { 1 }
328
322
autoFocus
329
323
/>
330
- < PromptInputToolbar className = "px-2 py-1 " >
324
+ < PromptInputToolbar className = "px-4 py-2 !border-t-0 !border-top-0 shadow-none dark:!border-transparent dark:border-0 " >
331
325
< PromptInputTools className = "gap-2" >
332
326
< AttachmentsButton fileInputRef = { fileInputRef } status = { status } />
333
327
< ModelSelectorCompact selectedModelId = { selectedModelId } />
@@ -338,9 +332,10 @@ function PureMultimodalInput({
338
332
< PromptInputSubmit
339
333
status = { status }
340
334
disabled = { ! input . trim ( ) || uploadQueue . length > 0 }
341
- className = "bg-primary hover:bg-primary/90 text-primary-foreground size-8"
342
- size = "sm"
343
- />
335
+ className = "rounded-full bg-gray-200 hover:bg-gray-300 dark:bg-sidebar-accent dark:hover:bg-sidebar-accent/80 p-3 text-gray-700 dark:text-gray-300"
336
+ >
337
+ < ArrowUpIcon size = { 20 } />
338
+ </ PromptInputSubmit >
344
339
) }
345
340
</ PromptInputToolbar >
346
341
</ PromptInput >
@@ -394,13 +389,15 @@ function PureModelSelectorCompact({
394
389
} ) {
395
390
const [ optimisticModelId , setOptimisticModelId ] = useState ( selectedModelId ) ;
396
391
397
- const selectedModel = chatModels . find ( model => model . id === optimisticModelId ) ;
392
+ const selectedModel = chatModels . find (
393
+ ( model ) => model . id === optimisticModelId ,
394
+ ) ;
398
395
399
396
return (
400
397
< PromptInputModelSelect
401
398
value = { selectedModel ?. name }
402
399
onValueChange = { ( modelName ) => {
403
- const model = chatModels . find ( m => m . name === modelName ) ;
400
+ const model = chatModels . find ( ( m ) => m . name === modelName ) ;
404
401
if ( model ) {
405
402
setOptimisticModelId ( model . id ) ;
406
403
startTransition ( ( ) => {
@@ -409,18 +406,20 @@ function PureModelSelectorCompact({
409
406
}
410
407
} }
411
408
>
412
- < PromptInputModelSelectTrigger
409
+ < PromptInputModelSelectTrigger
413
410
type = "button"
414
411
className = "text-xs focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 data-[state=open]:ring-0 data-[state=closed]:ring-0"
415
412
>
416
- { selectedModel ?. name || " Select model" }
413
+ { selectedModel ?. name || ' Select model' }
417
414
</ PromptInputModelSelectTrigger >
418
415
< PromptInputModelSelectContent >
419
416
{ chatModels . map ( ( model ) => (
420
417
< SelectItem key = { model . id } value = { model . name } >
421
- < div className = "flex flex-col items-start gap-1 py-1" >
418
+ < div className = "flex flex-col gap-1 items-start py-1" >
422
419
< div className = "font-medium" > { model . name } </ div >
423
- < div className = "text-xs text-muted-foreground" > { model . description } </ div >
420
+ < div className = "text-xs text-muted-foreground" >
421
+ { model . description }
422
+ </ div >
424
423
</ div >
425
424
</ SelectItem >
426
425
) ) }
0 commit comments