diff --git a/packages/junior-dashboard/src/client/components/SearchInput.tsx b/packages/junior-dashboard/src/client/components/SearchInput.tsx index e8c9d96573..a30e92c933 100644 --- a/packages/junior-dashboard/src/client/components/SearchInput.tsx +++ b/packages/junior-dashboard/src/client/components/SearchInput.tsx @@ -1,5 +1,5 @@ import type { Ref } from "react"; -import { Search } from "lucide-react"; +import { Search, X } from "lucide-react"; import { cn } from "../styles"; @@ -30,7 +30,7 @@ export function SearchInput(props: { props.onChange(event.currentTarget.value)} @@ -39,6 +39,23 @@ export function SearchInput(props: { type="search" value={props.value} /> + {props.value ? ( + + ) : null} ); } @@ -48,9 +65,14 @@ const searchIconClass: Record = { default: "left-3", }; +const clearButtonClass: Record = { + compact: "right-1.5", + default: "right-2", +}; + const searchInputClass: Record = { compact: - "h-9 bg-dashboard-overlay-soft pr-3 pl-8 focus:ring-1 focus:ring-dashboard-focus/25", + "h-9 bg-dashboard-overlay-soft pr-8 pl-8 focus:ring-1 focus:ring-dashboard-focus/25", default: - "h-10 bg-dashboard-overlay-soft pr-3 pl-9 focus:ring-1 focus:ring-dashboard-focus/25", + "h-10 bg-dashboard-overlay-soft pr-9 pl-9 focus:ring-1 focus:ring-dashboard-focus/25", }; diff --git a/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx b/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx index eaf8d69a19..12405cc91f 100644 --- a/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx +++ b/packages/junior-dashboard/src/client/pages/dev/ComponentsPage.tsx @@ -1,4 +1,5 @@ import { FormNotice } from "../../components/FormNotice"; +import { SearchInput } from "../../components/SearchInput"; import { Select } from "../../components/Select"; import { ObjectFixtures } from "./ObjectFixtures"; import { ChartFixtures } from "./ChartFixtures"; @@ -191,6 +192,7 @@ function FoundationsGalleryPage() { const [navigationOpen, setNavigationOpen] = useState(false); const [drawerOpen, setDrawerOpen] = useState(false); const [nestedDrawerOpen, setNestedDrawerOpen] = useState(false); + const [searchQuery, setSearchQuery] = useState("deploy failure"); return ( +