{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command",
  "type": "registry:ui",
  "title": "Command",
  "dependencies": [
    "@base-ui-next/react"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/dialog.json",
    "https://hamur.dev/r/react/input-group.json"
  ],
  "files": [
    {
      "path": "react/command.tsx",
      "content": "'use client'\n\nimport * as React from 'react' // base-ui-next/ui command@0.1.1\nimport { Autocomplete as AutocompletePrimitive } from '@base-ui-next/react/autocomplete'\nimport { cn } from '@/lib/utils'\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'\nimport { InputGroup, InputGroupAddon } from '@/components/ui/input-group'\n\n/** The element `Command` renders inside the Base UI root, which renders none. */\nconst commandClassName =\n  'flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground'\n\n/** `CommandDialog`'s `DialogContent`. */\nconst commandDialogContentClassName = 'top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0'\n\n/** `CommandDialog`'s `DialogHeader`, holding the title and description for assistive technology. */\nconst commandDialogHeaderClassName = 'sr-only'\n\nconst commandInputWrapperClassName = 'p-1 pb-0'\n\n/** The Input Group around the input. */\nconst commandInputGroupClassName =\n  'h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!'\n\nconst commandInputClassName =\n  'w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50'\n\n/** The search icon in the input's addon. */\nconst commandInputIconClassName = 'size-4 shrink-0 opacity-50'\n\nconst commandListClassName =\n  'max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden'\n\nconst commandEmptyClassName = 'py-6 text-center text-sm empty:py-0'\n\nconst commandGroupClassName = 'overflow-hidden p-1 text-foreground'\n\n/** The group's `heading` (cmdk's `[cmdk-group-heading]`). */\nconst commandGroupHeadingClassName = 'px-2 py-1.5 text-xs font-medium text-muted-foreground'\n\nconst commandSeparatorClassName = '-mx-1 h-px w-auto bg-border'\n\nconst commandItemClassName =\n  \"group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-muted data-highlighted:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-highlighted:**:[svg]:text-foreground\"\n\n/** The check icon after an item's children, shown when the item has `data-checked=\"true\"`. */\nconst commandItemIconClassName =\n  'ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100'\n\nconst commandShortcutClassName =\n  'ml-auto text-xs tracking-widest text-muted-foreground group-data-highlighted/command-item:text-foreground'\n\n// shadcn's names over Base UI's Autocomplete with its list inline (`inline` and `open`), in place\n// of cmdk. Filtering and the keyboard are the Autocomplete's: pass the items to `Command` and\n// render them with a function child of `CommandList` (a group's items with `group.items.map`).\n// `autoHighlight=\"always\"` keeps an item highlighted, as cmdk keeps one selected.\n\n// lucide's icons, inline and hidden from assistive technology (10 · As built, BN-309).\nfunction SvgIcon({ children, ...props }: React.ComponentProps<'svg'>) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      {children}\n    </svg>\n  )\n}\n\nfunction SearchIcon(props: React.ComponentProps<'svg'>) {\n  return (\n    <SvgIcon {...props}>\n      <path d=\"m21 21-4.34-4.34\" />\n      <circle cx=\"11\" cy=\"11\" r=\"8\" />\n    </SvgIcon>\n  )\n}\n\nfunction CheckIcon(props: React.ComponentProps<'svg'>) {\n  return (\n    <SvgIcon {...props}>\n      <path d=\"M20 6 9 17l-5-5\" />\n    </SvgIcon>\n  )\n}\n\nfunction Command<ItemValue>({\n  className,\n  children,\n  ...props\n}: Omit<AutocompletePrimitive.Root.Props<ItemValue>, 'items'> & {\n  /** The items, or groups of items (`{ value, items }`), that the input filters. */\n  items?: readonly ItemValue[]\n  className?: string\n}) {\n  return (\n    <AutocompletePrimitive.Root inline open autoHighlight=\"always\" {...props}>\n      <div data-slot=\"command\" className={cn(commandClassName, className)}>\n        {children}\n      </div>\n    </AutocompletePrimitive.Root>\n  )\n}\n\nfunction CommandDialog({\n  title = 'Command Palette',\n  description = 'Search for a command to run...',\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  showCloseButton?: boolean\n  children: React.ReactNode\n}) {\n  return (\n    <Dialog {...props}>\n      <DialogHeader className={commandDialogHeaderClassName}>\n        <DialogTitle>{title}</DialogTitle>\n        <DialogDescription>{description}</DialogDescription>\n      </DialogHeader>\n      <DialogContent\n        className={cn(commandDialogContentClassName, className)}\n        showCloseButton={showCloseButton}\n      >\n        {children}\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nfunction CommandInput({ className, ...props }: AutocompletePrimitive.Input.Props) {\n  return (\n    <div data-slot=\"command-input-wrapper\" className={commandInputWrapperClassName}>\n      <InputGroup className={commandInputGroupClassName}>\n        <AutocompletePrimitive.Input\n          data-slot=\"command-input\"\n          className={cn(commandInputClassName, className)}\n          {...props}\n        />\n        <InputGroupAddon>\n          <SearchIcon className={commandInputIconClassName} />\n        </InputGroupAddon>\n      </InputGroup>\n    </div>\n  )\n}\n\nfunction CommandList({ className, ...props }: AutocompletePrimitive.List.Props) {\n  return (\n    <AutocompletePrimitive.List\n      data-slot=\"command-list\"\n      className={cn(commandListClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction CommandEmpty({ className, ...props }: AutocompletePrimitive.Empty.Props) {\n  return (\n    <AutocompletePrimitive.Empty\n      data-slot=\"command-empty\"\n      className={cn(commandEmptyClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction CommandGroup({\n  className,\n  heading,\n  children,\n  ...props\n}: AutocompletePrimitive.Group.Props & {\n  heading?: React.ReactNode\n}) {\n  return (\n    <AutocompletePrimitive.Group\n      data-slot=\"command-group\"\n      className={cn(commandGroupClassName, className)}\n      {...props}\n    >\n      {heading != null && (\n        <AutocompletePrimitive.GroupLabel\n          data-slot=\"command-group-heading\"\n          className={commandGroupHeadingClassName}\n        >\n          {heading}\n        </AutocompletePrimitive.GroupLabel>\n      )}\n      {children}\n    </AutocompletePrimitive.Group>\n  )\n}\n\nfunction CommandSeparator({ className, ...props }: AutocompletePrimitive.Separator.Props) {\n  return (\n    <AutocompletePrimitive.Separator\n      data-slot=\"command-separator\"\n      className={cn(commandSeparatorClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction CommandItem({ className, children, ...props }: AutocompletePrimitive.Item.Props) {\n  return (\n    <AutocompletePrimitive.Item\n      data-slot=\"command-item\"\n      className={cn(commandItemClassName, className)}\n      {...props}\n    >\n      {children}\n      <CheckIcon className={commandItemIconClassName} />\n    </AutocompletePrimitive.Item>\n  )\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n  return (\n    <span\n      data-slot=\"command-shortcut\"\n      className={cn(commandShortcutClassName, 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",
      "target": "@ui/command.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.1",
      "hash": "5d61fa6c49a8ba84af3dea74dc9a9afa5361df9758e5473ad2f8af0351d80422",
      "files": {
        "@ui/command.tsx": "30b7d9c7d639125771da50f15cfb9845526f16601e7c6ebc00ce21bbfdcb295f"
      }
    }
  }
}
