Skip to content

Commit 6f78a71

Browse files
committed
feat: add hideIcon and class options to List search, customize search modal input
1 parent f8f1f46 commit 6f78a71

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/app/src/components/dialog-select-file.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function DialogSelectFile() {
136136
return (
137137
<Dialog title="Search">
138138
<List
139-
search={{ placeholder: "Search files and commands", autofocus: true }}
139+
search={{ placeholder: "Search files and commands", autofocus: true, hideIcon: true, class: "px-3" }}
140140
emptyMessage="No results found"
141141
items={items}
142142
key={(item) => item.id}

packages/ui/src/components/list.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { TextField } from "./text-field"
88
export interface ListSearchProps {
99
placeholder?: string
1010
autofocus?: boolean
11+
hideIcon?: boolean
12+
class?: string
1113
}
1214

1315
export interface ListProps<T> extends FilteredListProps<T> {
@@ -146,9 +148,11 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
146148
return (
147149
<div data-component="list" classList={{ [props.class ?? ""]: !!props.class }}>
148150
<Show when={!!props.search}>
149-
<div data-slot="list-search">
151+
<div data-slot="list-search" classList={{ [searchProps().class ?? ""]: !!searchProps().class }}>
150152
<div data-slot="list-search-container">
151-
<Icon name="magnifying-glass" />
153+
<Show when={!searchProps().hideIcon}>
154+
<Icon name="magnifying-glass" />
155+
</Show>
152156
<TextField
153157
autofocus={searchProps().autofocus}
154158
variant="ghost"

0 commit comments

Comments
 (0)