22
33import type React from 'react'
44import { useCallback , useLayoutEffect , useRef , useState } from 'react'
5- import { Badge , cn , handleKeyboardActivation , Tooltip } from '@sim/emcn'
5+ import { Badge , Button , cn , handleKeyboardActivation , Tooltip } from '@sim/emcn'
66import { createLogger } from '@sim/logger'
77import { generateId } from '@sim/utils/id'
88import { ArrowUp , Mic , Paperclip , X } from 'lucide-react'
@@ -168,7 +168,7 @@ export const ChatInput: React.FC<{
168168
169169 return (
170170 < Tooltip . Provider >
171- < div className = 'fixed right-0 bottom-0 left-0 flex w-full items-center justify-center bg-gradient-to-t from-[var(--landing- bg)] to-transparent px-4 pb-4 md:px-0 md:pb-4' >
171+ < div className = 'fixed right-0 bottom-0 left-0 flex w-full items-center justify-center bg-gradient-to-t from-[var(--bg)] to-transparent px-4 pb-4 md:px-0 md:pb-4' >
172172 < div className = 'w-full max-w-3xl md:max-w-[748px]' >
173173 { /* Error Messages */ }
174174 { uploadErrors . length > 0 && (
@@ -191,7 +191,7 @@ export const ChatInput: React.FC<{
191191 handleKeyboardActivation ( event , focusTextarea )
192192 } }
193193 className = { cn (
194- 'relative z-10 cursor-text rounded-2xl border border-[var(--border-1)] bg-[var(--landing-bg-elevated )] px-2.5 py-2' ,
194+ 'relative z-10 cursor-text rounded-2xl border border-[var(--border-1)] bg-[var(--surface-2 )] px-2.5 py-2' ,
195195 isDragOver && 'border-purple-500'
196196 ) }
197197 onDragEnter = { ( e ) => {
@@ -222,31 +222,31 @@ export const ChatInput: React.FC<{
222222 { attachedFiles . map ( ( file ) => (
223223 < Tooltip . Root key = { file . id } >
224224 < Tooltip . Trigger asChild >
225- < div className = 'group relative size-[56px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--landing-bg )]' >
225+ < div className = 'group relative size-[56px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--surface-3 )]' >
226226 { file . dataUrl ? (
227227 < img
228228 src = { file . dataUrl }
229229 alt = { file . name }
230230 className = 'h-full w-full object-cover'
231231 />
232232 ) : (
233- < div className = 'flex h-full w-full flex-col items-center justify-center gap-0.5 text-[var(--landing- text-muted)]' >
233+ < div className = 'flex h-full w-full flex-col items-center justify-center gap-0.5 text-[var(--text-muted)]' >
234234 < Paperclip className = 'size-[18px]' />
235235 < span className = 'max-w-[48px] truncate px-[2px] text-[9px]' >
236236 { file . name . split ( '.' ) . pop ( ) }
237237 </ span >
238238 </ div >
239239 ) }
240- < button
241- type = 'button '
240+ < Button
241+ variant = 'primary '
242242 onClick = { ( e ) => {
243243 e . stopPropagation ( )
244244 handleRemoveFile ( file . id )
245245 } }
246- className = 'absolute top-[2px] right-[2px] flex size-[16px] items-center justify-center rounded-full bg-black/60 opacity-0 group-hover:opacity-100'
246+ className = 'absolute top-[2px] right-[2px] size-[16px] rounded-full p-0 opacity-0 group-hover:opacity-100'
247247 >
248- < X className = 'size-[10px] text-white ' />
249- </ button >
248+ < X className = 'size-[10px]' />
249+ </ Button >
250250 </ div >
251251 </ Tooltip . Trigger >
252252 < Tooltip . Content side = 'top' >
@@ -265,7 +265,7 @@ export const ChatInput: React.FC<{
265265 onKeyDown = { handleKeyDown }
266266 placeholder = { isDragOver ? 'Drop files here...' : 'Enter a message...' }
267267 rows = { 1 }
268- className = 'm-0 h-auto min-h-[24px] w-full resize-none overflow-y-auto overflow-x-hidden border-0 bg-transparent p-1 text-[15px] text-[var(--landing- text)] leading-[24px] caret-[var(--landing- text)] outline-none [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-[var(--landing -text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden'
268+ className = 'm-0 h-auto min-h-[24px] w-full resize-none overflow-y-auto overflow-x-hidden border-0 bg-transparent p-1 text-[15px] text-[var(--text-primary )] leading-[24px] caret-[var(--text-primary )] outline-none [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-[var(--text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden'
269269 />
270270
271271 { /* Bottom row */ }
@@ -274,14 +274,14 @@ export const ChatInput: React.FC<{
274274 < div >
275275 < Tooltip . Root >
276276 < Tooltip . Trigger asChild >
277- < button
278- type = 'button '
277+ < Button
278+ variant = 'quiet '
279279 onClick = { ( ) => fileInputRef . current ?. click ( ) }
280280 disabled = { isStreaming || attachedFiles . length >= 15 }
281- className = 'flex size-[28px] items-center justify-center rounded-full text-[var(--landing-text-muted)] transition-colors hover:bg-[#F7F7F7] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-[#303030] '
281+ className = 'size-[28px] rounded-full p-0 '
282282 >
283283 < Paperclip className = 'size-[16px]' strokeWidth = { 2 } />
284- </ button >
284+ </ Button >
285285 </ Tooltip . Trigger >
286286 < Tooltip . Content side = 'top' >
287287 < p > Attach files</ p >
@@ -307,14 +307,14 @@ export const ChatInput: React.FC<{
307307 { sttAvailable && (
308308 < Tooltip . Root >
309309 < Tooltip . Trigger asChild >
310- < button
311- type = 'button '
310+ < Button
311+ variant = 'quiet '
312312 onClick = { onVoiceStart }
313313 disabled = { isStreaming }
314- className = 'flex size-[28px] items-center justify-center rounded-full text-[var(--landing-text-muted)] transition-colors hover:bg-[#F7F7F7] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-[#303030] '
314+ className = 'size-[28px] rounded-full p-0 '
315315 >
316316 < Mic className = 'size-[16px]' strokeWidth = { 2 } />
317- </ button >
317+ </ Button >
318318 </ Tooltip . Trigger >
319319 < Tooltip . Content side = 'top' >
320320 < p > Start voice conversation</ p >
@@ -323,37 +323,29 @@ export const ChatInput: React.FC<{
323323 ) }
324324
325325 { isStreaming ? (
326- < button
327- type = 'button '
326+ < Button
327+ variant = 'primary '
328328 onClick = { onStopStreaming }
329- className = 'flex size-[28px] items-center justify-center rounded-full border-0 bg-[#383838] p-0 transition-colors hover:bg-[#575757] dark:bg-[#E0E0E0] dark:hover:bg-[#CFCFCF] '
329+ className = 'size-[28px] rounded-full p-0'
330330 title = 'Stop generation'
331331 >
332332 < svg
333- className = 'block size-[14px] fill-white dark:fill-black '
333+ className = 'block size-[14px] fill-current '
334334 viewBox = '0 0 24 24'
335335 xmlns = 'http://www.w3.org/2000/svg'
336336 >
337337 < rect x = '4' y = '4' width = '16' height = '16' rx = '3' ry = '3' />
338338 </ svg >
339- </ button >
339+ </ Button >
340340 ) : (
341- < button
342- type = 'button '
341+ < Button
342+ variant = 'primary '
343343 onClick = { handleSubmit }
344344 disabled = { ! canSubmit }
345- className = { cn (
346- 'flex h-[28px] w-[28px] items-center justify-center rounded-full border-0 p-0 transition-colors' ,
347- canSubmit
348- ? 'bg-[#383838] hover:bg-[#575757] dark:bg-[#E0E0E0] dark:hover:bg-[#CFCFCF]'
349- : 'bg-[#808080] dark:bg-[#808080]'
350- ) }
345+ className = 'size-[28px] rounded-full p-0'
351346 >
352- < ArrowUp
353- className = 'block size-[16px] text-white dark:text-black'
354- strokeWidth = { 2.25 }
355- />
356- </ button >
347+ < ArrowUp className = 'block size-[16px]' strokeWidth = { 2.25 } />
348+ </ Button >
357349 ) }
358350 </ div >
359351 </ div >
0 commit comments