{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command",
  "title": "Command",
  "description": "Searchable Astro command lists for navigation and page actions.",
  "dependencies": [
    "@data-slot/command",
    "@lucide/astro",
    "cn"
  ],
  "registryDependencies": [
    "@gnostic/dialog"
  ],
  "files": [
    {
      "path": "packages/ui/src/components/ui/command/command-dialog.astro",
      "content": "---\nimport type { ComponentProps } from \"astro/types\"\n\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogTitle,\n} from \"../dialog/index.ts\"\n\ntype Props = ComponentProps<typeof Dialog> & {\n  title?: string\n  description?: string\n  contentClass?: string\n  showCloseButton?: boolean\n}\n\nconst {\n  title = \"Command Palette\",\n  description = \"Search for a command to run...\",\n  contentClass,\n  showCloseButton = false,\n  ...props\n} = Astro.props\n---\n\n<Dialog {...props}>\n  <DialogContent\n    data-command-dialog\n    class:list={[\"top-1/3 translate-y-0 overflow-hidden p-0 gap-0 **:data-[slot=command]:border-0 **:data-[slot=command]:bg-transparent **:data-[slot=command-input-wrapper]:h-12 [&_[data-slot=command-input-wrapper]_svg]:size-5 **:data-[slot=command-input]:h-12 **:data-[slot=command-group-heading]:text-muted-foreground **:data-[slot=command-group-heading]:px-2 **:data-[slot=command-group-heading]:font-medium [&_[data-slot=command-group]:not([hidden])_~[data-slot=command-group]]:pt-0\", contentClass]}\n    showCloseButton={showCloseButton}\n  >\n    <div class=\"sr-only\">\n      <DialogTitle>{title}</DialogTitle>\n      <DialogDescription>{description}</DialogDescription>\n    </div>\n    <slot />\n  </DialogContent>\n</Dialog>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-dialog.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command-empty.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\n\nconst { class: className, hidden = true, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"command-empty\"\n  hidden={hidden}\n  class={cn(\"not-empty:py-6 text-center text-sm\", className)}\n  {...props}\n>\n  <slot>No results found.</slot>\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-empty.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command-group.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n  heading?: string\n  value?: string\n  forceMount?: boolean\n}\n\nconst { class: className, heading, value, forceMount, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"command-group\"\n  data-value={value}\n  data-force-mount={forceMount ? \"true\" : undefined}\n  class={cn(\"text-foreground [&_[data-slot=command-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[data-slot=command-group-heading]]:px-2 [&_[data-slot=command-group-heading]]:py-1.5 [&_[data-slot=command-group-heading]]:text-xs [&_[data-slot=command-group-heading]]:font-medium\", className)}\n  {...props}\n>\n  {heading && <div data-slot=\"command-group-heading\">{heading}</div>}\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-group.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command-input.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport SearchIcon from \"@lucide/astro/icons/search\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"input\"> & {\n  wrapperClass?: string\n}\n\nconst { class: className, wrapperClass, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"command-input-wrapper\"\n  class={cn(\"px-3 pt-2 pb-0\", wrapperClass)}\n>\n  <div data-slot=\"command-input-group\" class=\"flex h-12 items-center border-b border-border bg-transparent\">\n    <div class=\"flex items-center pl-2\">\n      <SearchIcon\n        data-slot=\"command-input-icon\"\n        class=\"size-4.5 shrink-0 opacity-80 sm:size-4\"\n      />\n    </div>\n    <input\n      type=\"text\"\n      data-slot=\"command-input\"\n      class={cn(\"placeholder:text-muted-foreground h-full min-w-0 flex-1 bg-transparent px-2.5 text-base outline-none sm:text-sm disabled:cursor-not-allowed disabled:opacity-64\", className)}\n      {...props}\n    />\n  </div>\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-input.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command-item.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport CheckIcon from \"@lucide/astro/icons/check\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"a\"> & {\n  disabled?: boolean\n  href?: string\n  value?: string\n  label?: string\n  keywords?: string | string[]\n  forceMount?: boolean\n}\n\nconst {\n  class: className,\n  disabled,\n  href,\n  value,\n  label,\n  keywords,\n  forceMount,\n  ...props\n} = Astro.props\n\nconst Tag = href ? \"a\" : \"div\"\nconst keywordsValue = Array.isArray(keywords) ? keywords.join(\", \") : keywords\n---\n\n<Tag\n  data-slot=\"command-item\"\n  data-disabled={disabled ? \"true\" : undefined}\n  data-value={value}\n  data-label={label}\n  data-keywords={keywordsValue}\n  data-force-mount={forceMount ? \"true\" : undefined}\n  href={href}\n  class={cn(\"flex min-h-8 cursor-default select-none items-center gap-2 rounded-sm px-2 text-base text-foreground outline-none data-disabled:pointer-events-none data-selected:bg-accent data-inset:ps-8 data-[variant=destructive]:text-destructive-foreground data-selected:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg:not([class*='size-'])]:size-4.5 sm:[&>svg:not([class*='size-'])]:size-4 [&>svg]:pointer-events-none [&>svg]:-mx-0.5 [&>svg]:shrink-0 relative py-1.5 [&[href]]:cursor-pointer [&[href]]:no-underline group/command-item\", className)}\n  {...props}\n>\n  <slot />\n  <CheckIcon class=\"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-selected/command-item:opacity-100\" />\n</Tag>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-item.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command-list.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"command-list\"\n  class={cn(\"not-empty:scroll-py-2 not-empty:p-2 max-h-72 overflow-x-hidden overflow-y-auto\", className)}\n  {...props}\n>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-list.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command-separator.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"command-separator\"\n  class={cn(\"my-2 h-px bg-border\", className)}\n  {...props}\n></div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-separator.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command-shortcut.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n  data-slot=\"command-shortcut\"\n  class={cn(\"ms-auto font-medium font-sans text-muted-foreground/72 text-xs tracking-widest\", className)}\n  {...props}\n>\n  <slot />\n</span>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command-shortcut.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/command.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\nimport type { CommandProps } from \"./types.ts\"\n\ntype Props = HTMLAttributes<\"div\"> & CommandProps\n\nconst {\n  class: className,\n  label,\n  defaultValue,\n  defaultSearch,\n  shouldFilter,\n  loop,\n  disablePointerSelection,\n  vimBindings,\n  ...props\n} = Astro.props\n---\n\n<div\n  data-slot=\"command\"\n  data-label={label}\n  data-default-value={defaultValue}\n  data-default-search={defaultSearch}\n  data-should-filter={shouldFilter}\n  data-loop={loop}\n  data-disable-pointer-selection={disablePointerSelection}\n  data-vim-bindings={vimBindings}\n  class={cn(\"relative flex size-full flex-col overflow-hidden rounded-2xl bg-popover text-popover-foreground\", className)}\n  {...props}\n>\n  <slot />\n</div>\n\n<script>\n  import { create } from \"@data-slot/command\"\n\n  const initCommand = () => {\n    create()\n\n    document.querySelectorAll(\"[data-slot=command]\").forEach((command) => {\n      if (!(command instanceof HTMLElement)) return\n      if (command.dataset.linkNavigation === \"true\") return\n\n      command.dataset.linkNavigation = \"true\"\n      command.addEventListener(\"command:select\", (event) => {\n        const { detail } = event as CustomEvent<{ value?: unknown }>\n        const value = detail?.value\n        if (typeof value !== \"string\") return\n\n        const item = Array.from(\n          command.querySelectorAll(\"[data-slot=command-item][href]\"),\n        ).find((item) => item.getAttribute(\"data-value\") === value)\n        const href = item?.getAttribute(\"href\")\n\n        if (href) window.location.href = href\n      })\n    })\n  }\n\n  initCommand()\n\n  document.addEventListener(\"astro:page-load\", initCommand)\n</script>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/command.astro"
    },
    {
      "path": "packages/ui/src/components/ui/command/index.ts",
      "content": "export { default as Command } from './command.astro'\nexport { default as CommandDialog } from './command-dialog.astro'\nexport { default as CommandInput } from './command-input.astro'\nexport { default as CommandList } from './command-list.astro'\nexport { default as CommandEmpty } from './command-empty.astro'\nexport { default as CommandGroup } from './command-group.astro'\nexport { default as CommandItem } from './command-item.astro'\nexport { default as CommandSeparator } from './command-separator.astro'\nexport { default as CommandShortcut } from './command-shortcut.astro'\nexport type { CommandProps } from './types.ts'\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/index.ts"
    },
    {
      "path": "packages/ui/src/components/ui/command/types.ts",
      "content": "import type { CommandOptions } from '@data-slot/command'\n\n/**\n * Command configuration rendered as data attributes.\n */\nexport type CommandProps = Pick<\n    CommandOptions,\n    | 'label'\n    | 'defaultValue'\n    | 'defaultSearch'\n    | 'shouldFilter'\n    | 'loop'\n    | 'disablePointerSelection'\n    | 'vimBindings'\n>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/command/types.ts"
    }
  ],
  "meta": {
    "framework": "astro",
    "source": "@gnostic/ui",
    "testedDependencies": {
      "@data-slot/command": "^1.1.2",
      "@lucide/astro": "^1.68.0",
      "cn": "0.5.2"
    }
  },
  "docs": "https://ui.gnosticai.com/components/command",
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}
