@@ -6,48 +6,48 @@ import { classNames } from "../util/lang"
66import { i18n } from "../i18n"
77
88export interface SearchOptions {
9- enablePreview : boolean
9+ enablePreview : boolean
1010}
1111
1212const defaultOptions : SearchOptions = {
13- enablePreview : true ,
13+ enablePreview : true ,
1414}
1515
1616export default ( ( userOpts ?: Partial < SearchOptions > ) => {
17- const Search : QuartzComponent = ( { displayClass, cfg } : QuartzComponentProps ) => {
18- const opts = { ...defaultOptions , ...userOpts }
19- const searchPlaceholder = i18n ( cfg . locale ) . components . search . searchBarPlaceholder
20- return (
21- < div class = { classNames ( displayClass , "search" ) } >
22- < button class = "search-button" >
23- < p > { i18n ( cfg . locale ) . components . search . title } </ p >
24- < svg role = "img" xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 19.9 19.7" >
25- < title > Search</ title >
26- < g class = "search-path" fill = "none" >
27- < path stroke-linecap = "square" d = "M18.5 18.3l-5.4-5.4" />
28- < circle cx = "8" cy = "8" r = "7" />
29- </ g >
30- </ svg >
31- </ button >
32- < div class = "search-container" >
33- < div class = "search-space" >
34- < input
35- autocomplete = "off"
36- class = "search-bar"
37- name = "search"
38- type = "text"
39- aria-label = { searchPlaceholder }
40- placeholder = { searchPlaceholder }
41- />
42- < div class = "search-layout" data-preview = { opts . enablePreview } > </ div >
43- </ div >
44- </ div >
45- </ div >
46- )
47- }
17+ const Search : QuartzComponent = ( { displayClass, cfg } : QuartzComponentProps ) => {
18+ const opts = { ...defaultOptions , ...userOpts }
19+ const searchPlaceholder = i18n ( cfg . locale ) . components . search . searchBarPlaceholder
20+ return (
21+ < div class = { classNames ( displayClass , "search" ) } >
22+ < button class = "search-button" >
23+ < p class = "search-label" > { i18n ( cfg . locale ) . components . search . title } </ p >
24+ < svg role = "img" xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 19.9 19.7" >
25+ < title > Search</ title >
26+ < g class = "search-path" fill = "none" >
27+ < path stroke-linecap = "square" d = "M18.5 18.3l-5.4-5.4" />
28+ < circle cx = "8" cy = "8" r = "7" />
29+ </ g >
30+ </ svg >
31+ </ button >
32+ < div class = "search-container" >
33+ < div class = "search-space" >
34+ < input
35+ autocomplete = "off"
36+ class = "search-bar"
37+ name = "search"
38+ type = "text"
39+ aria-label = { searchPlaceholder }
40+ placeholder = { searchPlaceholder }
41+ />
42+ < div class = "search-layout" data-preview = { opts . enablePreview } > </ div >
43+ </ div >
44+ </ div >
45+ </ div >
46+ )
47+ }
4848
49- Search . afterDOMLoaded = script
50- Search . css = style
49+ Search . afterDOMLoaded = script
50+ Search . css = style
5151
52- return Search
52+ return Search
5353} ) satisfies QuartzComponentConstructor
0 commit comments