@@ -70,97 +70,93 @@ export default function ChatInput({openWhiteboard, showAnim}: props) {
7070
7171 return (
7272 < div
73- className = "relative "
73+ className = "flex flex-col py-[12vh] my-12 justify-center items-center "
7474 >
75+ { /* animate-wiggle */ }
7576 < div
76- className = "absolute bottom-0 z-10 flex flex-col w-full"
77+ className = { classNames (
78+ "sm:max-w-lg m-auto shadow-lg divide-zinc-600 min-h-12 bg-gray-900 shadow-black/40 rounded-[24px] overflow-hidden max-w-[90%] flex items-center flex-1 min-w-0 px-3 md:pl-4 bg-gray-900 absolute z-10 bottom-0" ,
79+ {
80+ "animate-wiggle" : showAnim ,
81+ }
82+ ) }
7783 >
78- { /* animate-wiggle */ }
79- < div
80- className = { classNames (
81- "sm:max-w-lg m-auto shadow-lg divide-zinc-600 min-h-12 bg-gray-900 shadow-black/40 rounded-[24px] overflow-hidden max-w-[90%] flex items-center flex-1 min-w-0 px-3 md:pl-4 bg-gray-900 relative z-10" ,
82- {
83- "animate-wiggle" : showAnim ,
84- }
85- ) }
86- >
87- < div
88- className = "relative w-full flex items-center transition-all duration-300 min-h-full h-fit" >
89- < label htmlFor = "textarea-input" className = "sr-only" > Prompt</ label >
90- < div className = "relative flex flex-1 min-w-0 self-start" >
91- < div className = "flex-[1_0_50%] min-w-[50%] overflow-x-visible -ml-[100%] opacity-0 invisible pointer-events-none" >
92- < div className = "[&_textarea]:px-0 opacity-0 invisible pointer-events-none" > A "report an issue" modal</ div >
93- </ div >
94- < textarea
95- id = "home-prompt"
96- maxLength = { 1000 }
97- ref = { inputRef }
98- className = "flex-[1_0_50%] min-w-[50%] disabled:opacity-80 text-white text-sm bg-transparent border-0 shadow-none resize-none outline-none ring-0 disabled:bg-transparent selection:bg-indigo-300 selection:text-black placeholder:text-zinc-400 [scroll-padding-block:0.75rem] pr-2 leading-relaxed py-3 pl-1 [&_textarea]:px-0"
99- spellCheck = "false"
100- rows = { 1 }
101- placeholder = "enter demand ideas"
102- style = { {
103- resize : 'none' ,
104- colorScheme : 'dark' ,
105- overflow : 'auto'
106- } }
107- value = { initCreateText }
108- onChange = { ( e ) => {
109- setInitCreateText ( e . target . value ) ;
110- } }
111- > </ textarea >
84+ < div
85+ className = "relative w-full flex items-center transition-all duration-300 min-h-full h-fit" >
86+ < label htmlFor = "textarea-input" className = "sr-only" > Prompt</ label >
87+ < div className = "relative flex flex-1 min-w-0 self-start" >
88+ < div className = "flex-[1_0_50%] min-w-[50%] overflow-x-visible -ml-[100%] opacity-0 invisible pointer-events-none" >
89+ < div className = "[&_textarea]:px-0 opacity-0 invisible pointer-events-none" > A "report an issue" modal</ div >
11290 </ div >
113- < div className = "flex items-center" >
91+ < textarea
92+ id = "home-prompt"
93+ maxLength = { 1000 }
94+ ref = { inputRef }
95+ className = "flex-[1_0_50%] min-w-[50%] disabled:opacity-80 text-white text-sm bg-transparent border-0 shadow-none resize-none outline-none ring-0 disabled:bg-transparent selection:bg-indigo-300 selection:text-black placeholder:text-zinc-400 [scroll-padding-block:0.75rem] pr-2 leading-relaxed py-3 pl-1 [&_textarea]:px-0"
96+ spellCheck = "false"
97+ rows = { 1 }
98+ placeholder = "enter demand ideas"
99+ style = { {
100+ resize : 'none' ,
101+ colorScheme : 'dark' ,
102+ overflow : 'auto'
103+ } }
104+ value = { initCreateText }
105+ onChange = { ( e ) => {
106+ setInitCreateText ( e . target . value ) ;
107+ } }
108+ > </ textarea >
109+ </ div >
110+ < div className = "flex items-center" >
111+ < button
112+ className = "shrink-0 text-m font-medium transition-colors focus-visible:outline-none focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-transparent text-white hover:bg-gray-800 flex items-center justify-center focus-visible:ring-0 focus-visible:bg-gray-800 rounded-full w-[28px] h-[28px] text-[19px]"
113+ id = "send-button"
114+ onClick = { openWhiteboard }
115+ >
116+ < span className = "sr-only" > Send</ span >
117+ < LiaPencilRulerSolid />
118+ </ button >
119+
120+ < label data-id = "prompt-form-image-upload" htmlFor = "fileUpload" className = "shrink-0 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-transparent text-white hover:bg-gray-800 flex items-center justify-center focus-visible:ring-0 focus-visible:bg-gray-800 rounded-full w-[28px] h-[28px] cursor-pointer focus-within:bg-gray-800" data-state = "closed" >
121+ < input { ...getInputProps ( ) } />
122+ < svg onClick = { open } viewBox = "0 0 16 16" fill = "none" xmlns = "http://www.w3.org/2000/svg" className = "w-4 h-4" > < g clipPath = "url(#a)" > < path fill = "currentColor" fillRule = "evenodd" d = "M14.5 2.5h-13v6.69l1.47-1.47.22-.22h3.75l.03-.03 3.5-3.5h1.06l2.97 2.97V2.5ZM8 8.56l1.53 1.53.53.53L9 11.68l-.53-.53L6.32 9H3.81l-2.28 2.28-.03.03v1.19a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V9.06L11 5.56 8.03 8.53 8 8.56Zm-8 2.25v1.69A2.5 2.5 0 0 0 2.5 15h11a2.5 2.5 0 0 0 2.5-2.5V9.56l.56-.56-.53-.53-.03-.03V1H0v9.69l-.06.06.06.06Z" clipRule = "evenodd" > </ path > </ g > < defs > < clipPath id = "a" > < path fill = "currentColor" d = "M0 0h16v16H0z" > </ path > </ clipPath > </ defs > </ svg >
123+ < span className = "sr-only" > Upload image</ span >
124+ </ label >
125+ { loading ? (
126+ < button className = 'w-[28px] h-[28px] scale-75' >
127+ < Spinner />
128+ </ button >
129+ ) : (
114130 < button
115- className = "shrink-0 text-m font-medium transition-colors focus-visible:outline-none focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-transparent text-white hover:bg-gray-800 flex items-center justify-center focus-visible:ring-0 focus-visible:bg-gray-800 rounded-full w-[28px] h-[28px] text-[19px ]"
131+ className = "shrink-0 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-transparent text-white hover:bg-gray-800 flex items-center justify-center focus-visible:ring-0 focus-visible:bg-gray-800 rounded-full w-[28px] h-[28px]"
116132 id = "send-button"
117- onClick = { openWhiteboard }
133+ onClick = { clickHandler }
118134 >
119135 < span className = "sr-only" > Send</ span >
120- < LiaPencilRulerSolid />
136+ < svg width = "16" height = "16" viewBox = "0 0 16 16" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
137+ < path fillRule = "evenodd" clipRule = "evenodd" d = "M13.5 3V2.25H15V3V10C15 10.5523 14.5522 11 14 11H3.56062L5.53029 12.9697L6.06062 13.5L4.99996 14.5607L4.46963 14.0303L1.39641 10.9571C1.00588 10.5666 1.00588 9.93342 1.39641 9.54289L4.46963 6.46967L4.99996 5.93934L6.06062 7L5.53029 7.53033L3.56062 9.5H13.5V3Z" fill = "currentColor" > </ path >
138+ </ svg >
121139 </ button >
122-
123- < label data-id = "prompt-form-image-upload" htmlFor = "fileUpload" className = "shrink-0 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-transparent text-white hover:bg-gray-800 flex items-center justify-center focus-visible:ring-0 focus-visible:bg-gray-800 rounded-full w-[28px] h-[28px] cursor-pointer focus-within:bg-gray-800" data-state = "closed" >
124- < input { ...getInputProps ( ) } />
125- < svg onClick = { open } viewBox = "0 0 16 16" fill = "none" xmlns = "http://www.w3.org/2000/svg" className = "w-4 h-4" > < g clipPath = "url(#a)" > < path fill = "currentColor" fillRule = "evenodd" d = "M14.5 2.5h-13v6.69l1.47-1.47.22-.22h3.75l.03-.03 3.5-3.5h1.06l2.97 2.97V2.5ZM8 8.56l1.53 1.53.53.53L9 11.68l-.53-.53L6.32 9H3.81l-2.28 2.28-.03.03v1.19a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V9.06L11 5.56 8.03 8.53 8 8.56Zm-8 2.25v1.69A2.5 2.5 0 0 0 2.5 15h11a2.5 2.5 0 0 0 2.5-2.5V9.56l.56-.56-.53-.53-.03-.03V1H0v9.69l-.06.06.06.06Z" clipRule = "evenodd" > </ path > </ g > < defs > < clipPath id = "a" > < path fill = "currentColor" d = "M0 0h16v16H0z" > </ path > </ clipPath > </ defs > </ svg >
126- < span className = "sr-only" > Upload image</ span >
127- </ label >
128- { loading ? (
129- < button className = 'w-[28px] h-[28px] scale-75' >
130- < Spinner />
131- </ button >
132- ) : (
133- < button
134- className = "shrink-0 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 bg-transparent text-white hover:bg-gray-800 flex items-center justify-center focus-visible:ring-0 focus-visible:bg-gray-800 rounded-full w-[28px] h-[28px]"
135- id = "send-button"
136- onClick = { clickHandler }
137- >
138- < span className = "sr-only" > Send</ span >
139- < svg width = "16" height = "16" viewBox = "0 0 16 16" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
140- < path fillRule = "evenodd" clipRule = "evenodd" d = "M13.5 3V2.25H15V3V10C15 10.5523 14.5522 11 14 11H3.56062L5.53029 12.9697L6.06062 13.5L4.99996 14.5607L4.46963 14.0303L1.39641 10.9571C1.00588 10.5666 1.00588 9.93342 1.39641 9.54289L4.46963 6.46967L4.99996 5.93934L6.06062 7L5.53029 7.53033L3.56062 9.5H13.5V3Z" fill = "currentColor" > </ path >
141- </ svg >
142- </ button >
143- ) }
144- </ div >
140+ ) }
145141 </ div >
146- </ div >
147- < div className = 'flex w-full mt-4 item-center justify-center gap-2' >
148- {
149- shortcutIdeas . map ( ( shortcut ) => {
150- return (
151- < button
152- key = { shortcut . id }
153- className = 'text-slate-400 text-sm rounded-full border border-zinc-200 px-2 py-0.5 inline-flex gap-1 items-center whitespace-nowrap select-none hover:border-zinc-800 transition-colors'
154- onClick = { ( ) => {
155- setInitCreateText ( shortcut . value ) ;
156- } }
157- >
158- { shortcut . label }
159- < GoArrowUpRight />
160- </ button > )
161- } )
162- }
163- </ div >
142+ </ div >
143+ </ div >
144+ < div className = 'absolute flex flex-wrap items-center justify-center max-w-full gap-2 px-4 mx-auto mt-6 text-sm top-full whitespace-nowrap' >
145+ {
146+ shortcutIdeas . map ( ( shortcut ) => {
147+ return (
148+ < button
149+ key = { shortcut . id }
150+ className = 'text-slate-400 text-sm rounded-full border border-zinc-200 px-2 py-0.5 inline-flex gap-1 items-center whitespace-nowrap select-none hover:border-zinc-800 transition-colors'
151+ onClick = { ( ) => {
152+ setInitCreateText ( shortcut . value ) ;
153+ } }
154+ >
155+ { shortcut . label }
156+ < GoArrowUpRight />
157+ </ button > )
158+ } )
159+ }
164160 </ div >
165161 </ div >
166162 ) ;
0 commit comments