2023-10-02 07:20:55 +07:00
|
|
|
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
2023-06-20 10:37:45 +07:00
|
|
|
import style from "./styles/search.scss"
|
|
|
|
// @ts-ignore
|
|
|
|
import script from "./scripts/search.inline"
|
2024-01-30 12:51:13 +07:00
|
|
|
import { classNames } from "../util/lang"
|
2023-06-20 10:37:45 +07:00
|
|
|
|
|
|
|
export default (() => {
|
2023-10-02 07:20:55 +07:00
|
|
|
function Search({ displayClass }: QuartzComponentProps) {
|
2023-07-23 07:27:41 +07:00
|
|
|
return (
|
2024-01-30 12:51:13 +07:00
|
|
|
<div class={classNames(displayClass, "search")}>
|
2023-07-23 07:27:41 +07:00
|
|
|
<div id="search-icon">
|
|
|
|
<p>Search</p>
|
|
|
|
<div></div>
|
|
|
|
<svg
|
|
|
|
tabIndex={0}
|
|
|
|
aria-labelledby="title desc"
|
|
|
|
role="img"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
viewBox="0 0 19.9 19.7"
|
|
|
|
>
|
|
|
|
<title id="title">Search</title>
|
|
|
|
<desc id="desc">Search</desc>
|
|
|
|
<g class="search-path" fill="none">
|
|
|
|
<path stroke-linecap="square" d="M18.5 18.3l-5.4-5.4" />
|
|
|
|
<circle cx="8" cy="8" r="7" />
|
|
|
|
</g>
|
|
|
|
</svg>
|
|
|
|
</div>
|
|
|
|
<div id="search-container">
|
|
|
|
<div id="search-space">
|
|
|
|
<input
|
|
|
|
autocomplete="off"
|
|
|
|
id="search-bar"
|
|
|
|
name="search"
|
|
|
|
type="text"
|
|
|
|
aria-label="Search for something"
|
|
|
|
placeholder="Search for something"
|
|
|
|
/>
|
|
|
|
<div id="results-container"></div>
|
2023-06-20 10:37:45 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-07-23 07:27:41 +07:00
|
|
|
)
|
2023-06-20 10:37:45 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
Search.afterDOMLoaded = script
|
|
|
|
Search.css = style
|
|
|
|
|
|
|
|
return Search
|
|
|
|
}) satisfies QuartzComponentConstructor
|