{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command",
  "title": "Command",
  "author": "AniBT <https://anibt.net>",
  "description": "AniBT command list and ⌘K palette on cmdk: a 44px stitched search row, 32px rows with the pink wash, stitched groups, and CommandDialog on @anibt/dialog.",
  "dependencies": [
    "cmdk",
    "lucide-react"
  ],
  "registryDependencies": [
    "@anibt/theme",
    "@anibt/dialog"
  ],
  "files": [
    {
      "path": "registry/anibt/ui/command.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { SearchIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"@/registry/anibt/ui/dialog\"\n\n/**\n * Command — AniBT 「贴纸手账」 command list and ⌘K palette (cmdk).\n *\n * The list is *content*, not a tier of its own: it fills a `DialogContent`\n * (`CommandDialog`) or a `PopoverContent`, which own the floating edge and\n * shadow, so it paints the popover paper and no second border. The search row\n * is 44px over the dashed stitch with a muted glass; anything passed as\n * `CommandInput`'s children sits at its right end (an `esc` key cap). Rows are\n * 32px on radius 10; the row under the cursor takes the pink wash, pink ink\n * and a pink icon. Group heads are 12/600 muted, groups part on the stitch.\n *\n * Export names and props are shadcn's, so this file can replace\n * `components/ui/command.tsx`.\n */\n\nfunction Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {\n  return (\n    <CommandPrimitive\n      data-slot=\"command\"\n      className={cn(\n        \"flex h-full w-full min-h-0 flex-col overflow-hidden rounded-[14px] bg-popover text-[13px] text-popover-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CommandDialog({\n  title = \"命令面板\",\n  description = \"搜索要执行的命令或要去的页面\",\n  children,\n  className,\n  showCloseButton = false,\n  ...props\n}: Omit<React.ComponentProps<typeof Dialog>, \"children\"> & {\n  title?: string\n  description?: string\n  className?: string\n  /** The dialog's ✕ square. Off by default: Esc closes a palette. */\n  showCloseButton?: boolean\n  children?: React.ReactNode\n}) {\n  return (\n    <Dialog {...props}>\n      <DialogContent\n        className={cn(\"top-[12vh] translate-y-0 gap-0 overflow-hidden p-0 sm:top-[18vh] sm:max-w-xl\", className)}\n        showCloseButton={showCloseButton}\n      >\n        {/* Radix reads the accessible name from inside the content. */}\n        <DialogHeader className=\"sr-only\">\n          <DialogTitle>{title}</DialogTitle>\n          <DialogDescription>{description}</DialogDescription>\n        </DialogHeader>\n        <Command className=\"rounded-none **:data-[slot=command-input-wrapper]:h-12 **:data-[slot=command-list]:max-h-[min(360px,60dvh)] **:data-[slot=command-item]:min-h-10 [&_[cmdk-group]]:px-1.5\">\n          {children}\n        </Command>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nfunction CommandInput({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {\n  return (\n    <div\n      data-slot=\"command-input-wrapper\"\n      className=\"anibt-stitch-under flex h-11 shrink-0 items-center gap-2 px-3 text-muted-foreground focus-within:text-accent-foreground\"\n    >\n      <SearchIcon className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n      <CommandPrimitive.Input\n        data-slot=\"command-input\"\n        className={cn(\n          \"flex h-full w-full min-w-0 bg-transparent text-[16px] text-foreground outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-muted-foreground sm:text-[13px]\",\n          className\n        )}\n        {...props}\n      />\n      {children}\n    </div>\n  )\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {\n  return (\n    <CommandPrimitive.List\n      data-slot=\"command-list\"\n      className={cn(\n        \"max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto overscroll-contain py-1\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n  return (\n    <CommandPrimitive.Empty\n      data-slot=\"command-empty\"\n      className={cn(\"py-8 text-center text-[13px] text-muted-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {\n  return (\n    <CommandPrimitive.Group\n      data-slot=\"command-group\"\n      className={cn(\n        \"overflow-hidden px-1 py-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pt-1.5 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n  return (\n    <CommandPrimitive.Separator\n      data-slot=\"command-separator\"\n      className={cn(\"anibt-stitch mx-3 my-1\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {\n  return (\n    <CommandPrimitive.Item\n      data-slot=\"command-item\"\n      className={cn(\n        \"relative flex min-h-8 cursor-default items-center gap-2 rounded-[10px] px-2 py-1 text-[13px] outline-hidden transition-colors duration-150 select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[selected=true]:[&_svg:not([class*='text-'])]:text-anibt-mark\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/** A key or a hint at the row's right end, in the round face. */\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"command-shortcut\"\n      className={cn(\"anibt-num ml-auto pl-3 text-[12px] font-medium text-muted-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Command,\n  CommandDialog,\n  CommandInput,\n  CommandList,\n  CommandEmpty,\n  CommandGroup,\n  CommandItem,\n  CommandShortcut,\n  CommandSeparator,\n}\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "overlay"
  ],
  "type": "registry:ui"
}