{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "sidebar-search-form", "title": "Sidebar Search Form", "description": "Search form for the sidebar with themed input and button.", "registryDependencies": [ "https://raw.githubusercontent.com/dnachavez/adminlte-next/master/public/r/adminlte-theme.json", "https://raw.githubusercontent.com/dnachavez/adminlte-next/master/public/r/adminlte-form-control.json" ], "files": [ { "path": "registry/new-york/sidebar-search-form/components/sidebar-search-form.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useState, useCallback } from \"react\"\nimport { cn } from \"@/registry/new-york/adminlte-theme/lib/cn\"\n\ninterface SidebarSearchFormProps extends React.HTMLAttributes {\n placeholder?: string\n onSearch?: (value: string) => void\n}\n\nconst SidebarSearchForm = React.forwardRef(\n ({ className, placeholder = \"Search...\", onSearch, ...props }, ref) => {\n const [value, setValue] = useState(\"\")\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault()\n if (onSearch) {\n onSearch(value)\n }\n },\n [onSearch, value]\n )\n\n const handleChange = useCallback(\n (e: React.ChangeEvent) => {\n setValue(e.target.value)\n },\n []\n )\n\n return (\n \n
\n \n \n \n \n \n \n \n
\n \n )\n }\n)\nSidebarSearchForm.displayName = \"SidebarSearchForm\"\n\nexport { SidebarSearchForm }\nexport type { SidebarSearchFormProps }\n", "type": "registry:component" } ], "type": "registry:component" }