Skip to content

Commit 3c2374f

Browse files
committed
Move search to the sidebar
1 parent f5d2b37 commit 3c2374f

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

src/components/tools-and-libraries.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
GlobeIcon,
44
NPMIcon,
55
StarIcon,
6-
MagnifyingGlassIcon,
76
RubyGemsIcon,
87
ChevronLeftIcon,
98
} from "@/icons"
@@ -33,6 +32,7 @@ import { getComponents } from "nextra-theme-docs"
3332
import { RadioGroup, Radio } from "@/components/radio"
3433
import { Button } from "@/app/conf/_design-system/button"
3534
import { Tag } from "@/app/conf/_design-system/tag"
35+
import SearchIcon from "@/app/conf/_design-system/pixelarticons/search.svg?svgr"
3636

3737
type PackageInfo = {
3838
name: string
@@ -280,21 +280,17 @@ export function CodePage({ allTags, data }: CodePageProps) {
280280
</p>
281281
<div className="mt-8 md:grid md:grid-cols-[minmax(240px,300px)_1fr] md:gap-8">
282282
<aside>
283-
<div>
283+
<label className="focus-within:gql-focus-outline flex items-center gap-1 border border-neu-300 bg-neu-0 p-2">
284+
<SearchIcon className="size-5 text-neu-800" />
284285
<input
285286
// TODO: This should also do a fuzzy full text search, not just search on tags.
286287
value={search}
287288
onChange={e => setSearch(e.target.value)}
288289
onKeyDown={handleKeyDown}
289-
placeholder="Search..."
290-
className={clsx(
291-
"block grow bg-transparent",
292-
"focus-visible:ring-0 focus-visible:ring-offset-0",
293-
"focus-visible:border-b-primary",
294-
)}
290+
placeholder="Filter tags..."
291+
className="bg-transparent focus:outline-none"
295292
/>
296-
<MagnifyingGlassIcon className="shrink-0" />
297-
</div>
293+
</label>
298294
<CheckboxTree
299295
items={filterTreeItems}
300296
selectedValues={selectedTags}
@@ -320,7 +316,6 @@ export function CodePage({ allTags, data }: CodePageProps) {
320316
<span>Alphabetical</span>
321317
</label>
322318
</RadioGroup>
323-
{/* COMENTED OUT TO MAKE DEVELOPMENT FASTER
324319
<div className="grid gap-2 py-8 md:grid-cols-2 md:gap-4">
325320
{(sort === "alphabetical"
326321
? [...newData].sort((a, b) =>
@@ -418,7 +413,7 @@ export function CodePage({ allTags, data }: CodePageProps) {
418413
)
419414
},
420415
)}
421-
</div> */}
416+
</div>
422417
</div>
423418
</div>
424419
</div>

src/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ div[id^="headlessui-menu-items"] {
347347

348348
.gql-focus-visible,
349349
.gql-all-anchors-focusable a {
350-
@apply focus-visible:outline focus-visible:outline-[3px] focus-visible:outline-offset-[5px] focus-visible:outline-neu-900;
350+
@apply focus-visible:gql-focus-outline;
351351
}
352352

353353
.gql-container {

tailwind.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ const config: Config = {
204204
},
205205
},
206206
})
207+
208+
addBase({
209+
".gql-focus-outline": {
210+
"outline-style": "solid",
211+
"outline-width": "3px",
212+
"outline-offset": "5px",
213+
"outline-color": "hsl(var(--color-neu-900))",
214+
},
215+
})
207216
}),
208217
tailwindMediaHover(),
209218
scrollStartPlugin(),

0 commit comments

Comments
 (0)