8
8
Dialog ,
9
9
DialogCloseButton ,
10
10
DialogContent ,
11
+ DialogFooter ,
11
12
DialogHeader ,
12
13
DialogModal ,
13
14
DialogModalOverlay ,
@@ -20,6 +21,7 @@ import {
20
21
SearchField ,
21
22
SearchFieldClearButton ,
22
23
Text ,
24
+ TextLink ,
23
25
} from "@stacklok/ui-kit" ;
24
26
import {
25
27
Dispatch ,
@@ -48,11 +50,7 @@ import { useQueryGetWorkspaceCustomInstructions } from "../hooks/use-query-get-w
48
50
import { useMutationSetWorkspaceCustomInstructions } from "../hooks/use-mutation-set-workspace-custom-instructions" ;
49
51
import Fuse from "fuse.js" ;
50
52
import systemPrompts from "../constants/built-in-system-prompts.json" ;
51
- import {
52
- Download01 ,
53
- MessageTextSquare02 ,
54
- SearchMd ,
55
- } from "@untitled-ui/icons-react" ;
53
+ import { MessageTextSquare02 , SearchMd } from "@untitled-ui/icons-react" ;
56
54
57
55
type DarkModeContextValue = {
58
56
preference : "dark" | "light" | null ;
@@ -170,17 +168,20 @@ function PromptPresetPicker({ onActivate }: PromptPresetPickerProps) {
170
168
return (
171
169
< >
172
170
< DialogHeader >
173
- < div className = "w-1/3" >
174
- < DialogTitle > Choose a prompt template</ DialogTitle >
175
- </ div >
176
- < div className = "w-1/3" >
177
- < SearchField
178
- className = "w-full max-w-96"
179
- value = { query }
180
- onChange = { setQuery }
181
- >
171
+ < DialogTitle > Choose a prompt template</ DialogTitle >
172
+ < DialogCloseButton />
173
+ </ DialogHeader >
174
+ < DialogContent className = "p-0 relative" >
175
+ < div
176
+ className = "bg-base pt-4 px-4 pb-2 mb-2 sticky top-0 z-10"
177
+ style = { {
178
+ boxShadow : "0px 4px 4px 4px var(--bg-base)" ,
179
+ } }
180
+ >
181
+ < SearchField className = "w-full" value = { query } onChange = { setQuery } >
182
182
< FieldGroup >
183
183
< Input
184
+ isBorderless
184
185
icon = { < SearchMd /> }
185
186
placeholder = "Type to search"
186
187
autoFocus
@@ -189,15 +190,11 @@ function PromptPresetPicker({ onActivate }: PromptPresetPickerProps) {
189
190
</ FieldGroup >
190
191
</ SearchField >
191
192
</ div >
192
- < div className = "w-1/3 flex justify-end" >
193
- < DialogCloseButton />
194
- </ div >
195
- </ DialogHeader >
196
- < DialogContent >
197
- < div className = "grid grid-flow-row grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4 overflow-auto justify-around " >
193
+
194
+ < div className = "grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4 px-4 pb-4" >
198
195
{ fuse . search ( query . length > 0 ? query : " " ) . map ( ( { item } ) => {
199
196
return (
200
- < Card className = " flex flex-col " >
197
+ < Card className = "min-h-96 " >
201
198
< h2 className = "font-bold p-2 flex gap-2 items-center" >
202
199
< MessageTextSquare02 className = "size-4" />
203
200
< div className = "truncate" > { item . name } </ div >
@@ -224,21 +221,31 @@ function PromptPresetPicker({ onActivate }: PromptPresetPickerProps) {
224
221
</ div >
225
222
</ div >
226
223
< Button
227
- isIcon
228
224
slot = "close"
229
225
variant = "secondary"
230
226
onPress = { ( ) => {
231
227
handleActivate ( item . text ) ;
232
228
} }
233
229
>
234
- < Download01 />
230
+ Use prompt
235
231
</ Button >
236
232
</ div >
237
233
</ Card >
238
234
) ;
239
235
} ) }
240
236
</ div >
241
237
</ DialogContent >
238
+ < DialogFooter >
239
+ < span className = "ml-auto" >
240
+ Prompt templates sourced from{ " " }
241
+ < TextLink
242
+ className = "text-primary"
243
+ href = "https://github.com/PatrickJS/awesome-cursorrules"
244
+ >
245
+ PatrickJS/awesome-cursorrules
246
+ </ TextLink >
247
+ </ span >
248
+ </ DialogFooter >
242
249
</ >
243
250
) ;
244
251
}
@@ -324,12 +331,12 @@ export function WorkspaceCustomInstructions({
324
331
</ CardBody >
325
332
< CardFooter className = "justify-end gap-2" >
326
333
< DialogTrigger >
327
- < Button > Use a preset</ Button >
334
+ < Button variant = "secondary" > Use a preset</ Button >
328
335
< DialogModalOverlay isDismissable >
329
336
< DialogModal isDismissable >
330
337
< Dialog
331
338
width = "lg"
332
- className = "flex flex-col p-4 gap-4 "
339
+ className = "min-h-[44rem] "
333
340
style = { { maxWidth : "min(calc(100vw - 64px), 1200px)" } }
334
341
>
335
342
< PromptPresetPicker
0 commit comments