From d8d7e3d6efaaf15ddefb126f1812c50ddb3370eb Mon Sep 17 00:00:00 2001 From: Carlos Costa Date: Sat, 14 Nov 2026 22:59:59 -0300 Subject: [PATCH] refactor(docs): use Dashkit Input and IconButton for sidebar filter --- src/partials/Sidebar.tsx | 45 +++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/partials/Sidebar.tsx b/src/partials/Sidebar.tsx index ea986236..58bc4625 100644 --- a/src/partials/Sidebar.tsx +++ b/src/partials/Sidebar.tsx @@ -2,6 +2,8 @@ import * as React from 'react'; import { Link } from 'react-router-dom'; import { FiSearch, FiX } from 'react-icons/fi'; import clsx from 'clsx'; +import { Input } from '../dashkit/Input'; +import { IconButton } from '../dashkit/IconButton'; export interface SidebarLink { to: string; @@ -53,27 +55,28 @@ export function Sidebar({ <> {searchable && (
-
- - setQuery(e.target.value)} - placeholder="Filter components..." - aria-label="Filter documentation links" - className="w-full h-8 pl-8 pr-7 text-xs bg-input-bg text-input-fg border border-input-border ds-rounded-sm outline-none transition-colors focus:border-input-focus focus:ring-2 focus:ring-input-focus/20 placeholder:text-muted-foreground" - /> - {query && ( - - )} -
+ setQuery(e.target.value)} + placeholder="Filter components..." + aria-label="Filter documentation links" + leftIcon={} + rightIcon={ + query ? ( + setQuery('')} + aria-label="Clear filter" + className="pointer-events-auto size-5 -mr-1" + icon={} + /> + ) : undefined + } + />
)}