{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "search-trigger",
  "title": "Search trigger",
  "description": "SearchTrigger (icon button) and FullSearchTrigger (search field with hotkey hint) that open the search dialog.",
  "dependencies": [
    "@base-ui/react",
    "class-variance-authority",
    "cn",
    "@fuma-translate/react@^1.0.2",
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "kbd",
    "@docscn/search-context"
  ],
  "files": [
    {
      "path": "registry/base/docs/layouts/shared/slots/search-trigger.tsx",
      "content": "// Adapted from Fumadocs UI (https://github.com/fuma-nama/fumadocs)\n// Copyright (c) 2023 Fuma, MIT License\n\"use client\";\n\nimport { useTranslations } from \"@fuma-translate/react\";\nimport { Dialog } from \"@base-ui/react/dialog\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cn } from \"cn\";\nimport { Search } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { Button, buttonVariants } from \"@/components/ui/button\";\nimport { Kbd, KbdGroup } from \"@/components/ui/kbd\";\nimport { useSearchContext } from \"../../../contexts/search\";\n\nexport interface SearchTriggerProps\n  extends ComponentProps<\"button\">, VariantProps<typeof buttonVariants> {\n  hideIfDisabled?: boolean;\n}\n\nexport function SearchTrigger({\n  hideIfDisabled,\n  size = \"icon-sm\",\n  variant = \"ghost\",\n  ...props\n}: SearchTriggerProps) {\n  const { enabled, dialogHandle } = useSearchContext();\n  const t = useTranslations({ note: \"search trigger\" });\n  if (hideIfDisabled && !enabled) return null;\n\n  return (\n    <Dialog.Trigger\n      handle={dialogHandle}\n      render={<Button size={size} variant={variant} />}\n      data-search=\"\"\n      aria-label={t(\"Open Search\", { note: \"aria-label\" })}\n      {...props}\n    >\n      <Search />\n    </Dialog.Trigger>\n  );\n}\n\nexport interface FullSearchTriggerProps extends ComponentProps<\"button\"> {\n  hideIfDisabled?: boolean;\n}\n\nexport function FullSearchTrigger({\n  hideIfDisabled,\n  className,\n  ...props\n}: FullSearchTriggerProps) {\n  const { enabled, hotKey, dialogHandle } = useSearchContext();\n  const t = useTranslations({ note: \"search trigger\" });\n  if (hideIfDisabled && !enabled) return null;\n\n  return (\n    <Dialog.Trigger\n      handle={dialogHandle}\n      render={<Button variant=\"outline\" />}\n      data-search-full=\"\"\n      {...props}\n      // ps-1.75 plus the 1px border lines the icon up with sidebar item text\n      className={cn(\n        \"justify-start gap-2 bg-muted/50 ps-1.75 pe-2 font-normal text-muted-foreground shadow-none dark:bg-input/30\",\n        className,\n      )}\n    >\n      <Search />\n      {t(\"Search\")}\n      <KbdGroup className=\"ms-auto\">\n        {hotKey.map((k, i) => (\n          <Kbd key={i}>{k.display}</Kbd>\n        ))}\n      </KbdGroup>\n    </Dialog.Trigger>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/docs/layouts/shared/slots/search-trigger.tsx"
    }
  ],
  "type": "registry:component"
}