{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command-menu-04",
  "type": "registry:block",
  "title": "Command Menu with Global Search",
  "description": "Command Menu with Global Search. Keyboard-friendly command palettes for navigation, search, and quick actions.",
  "author": "Ephraim Duncan",
  "registryDependencies": [],
  "dependencies": [
    "@base-ui/react@1.9.0",
    "@tabler/icons-react@3.50.0",
    "class-variance-authority@0.7.1",
    "cmdk@1.1.1",
    "cn@0.2.6",
    "lucide-react@0.577.0"
  ],
  "files": [
    {
      "path": "content/components/command-menu/command-menu-04.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/command-menu-04.tsx",
      "content": "'use client';\n\nimport {\n  IconFileText,\n  IconFileTypeDocx,\n  IconFileTypePdf,\n  IconFileTypeXls,\n  IconFileZip,\n  IconFolder,\n  IconMessageCircle,\n  IconPhoto,\n  IconX,\n} from '@tabler/icons-react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { type ComponentType, useState } from 'react';\nimport { Button } from \"./shared/components/ui/button\";\nimport {\n  Command,\n  CommandDialog,\n  CommandEmpty,\n  CommandGroup,\n  CommandItem,\n  CommandList,\n} from \"./shared/components/ui/command\";\nimport { cn } from \"./shared/lib/utils\";\n\nexport type SearchResultKind = 'chat' | 'image' | 'document' | 'project';\n\nexport type SearchResult = {\n  id: string;\n  kind: SearchResultKind;\n  title: string;\n  /** Shown under the title while searching. Chats use a text excerpt; files use their type. */\n  snippet: string;\n  date: string;\n  /** Images only: CSS background for the thumbnail. */\n  thumbnail?: string;\n};\n\ntype Filter = 'all' | SearchResultKind;\n\nconst filters: { value: Filter; label: string }[] = [\n  { value: 'all', label: 'All' },\n  { value: 'chat', label: 'Chats' },\n  { value: 'image', label: 'Images' },\n  { value: 'document', label: 'Documents' },\n  { value: 'project', label: 'Projects' },\n];\n\nconst fileIcons: Record<string, ComponentType<{ className?: string }>> = {\n  pdf: IconFileTypePdf,\n  docx: IconFileTypeDocx,\n  xlsx: IconFileTypeXls,\n  zip: IconFileZip,\n};\n\nconst kindIcons: Record<\n  SearchResultKind,\n  ComponentType<{ className?: string }>\n> = {\n  chat: IconMessageCircle,\n  image: IconPhoto,\n  document: IconFileText,\n  project: IconFolder,\n};\n\nconst lastOpenedChats: SearchResult[] = [\n  {\n    id: 'c1',\n    kind: 'chat',\n    title: 'Q3 launch checklist',\n    snippet: 'Pin the launch date once legal signs off on the new terms.',\n    date: 'Today',\n  },\n  {\n    id: 'c2',\n    kind: 'chat',\n    title: 'Draft onboarding email sequence',\n    snippet:\n      'Three emails over five days, starting the morning after launch, each with one clear action.',\n    date: 'Today',\n  },\n];\n\nconst recentChats: SearchResult[] = [\n  {\n    id: 'c3',\n    kind: 'chat',\n    title: 'Compare pricing page layouts',\n    snippet:\n      'Three-column pricing works when the middle tier is the one most people should pick. Ship it with the launch.',\n    date: 'Yesterday',\n  },\n  {\n    id: 'c4',\n    kind: 'chat',\n    title: 'Summarize customer interviews',\n    snippet:\n      'Eight of twelve customers mentioned invoice export first. Nobody brought up the dashboard redesign.',\n    date: 'Yesterday',\n  },\n  {\n    id: 'c5',\n    kind: 'chat',\n    title: 'Fix flaky checkout test',\n    snippet:\n      'The test races the payment webhook. Wait for the order status instead of a fixed delay.',\n    date: 'Sep 4',\n  },\n  {\n    id: 'c6',\n    kind: 'chat',\n    title: 'Write release notes for v2.4',\n    snippet:\n      'Lead with the two launch features people asked for most, then list fixes in one short block.',\n    date: 'Sep 2',\n  },\n  {\n    id: 'c7',\n    kind: 'chat',\n    title: 'Plan database index cleanup',\n    snippet:\n      'Drop the four unused indexes on orders first; they cost the most on writes.',\n    date: 'Aug 30',\n  },\n  {\n    id: 'c8',\n    kind: 'chat',\n    title: 'Brainstorm team offsite agenda',\n    snippet:\n      'Half a day on the roadmap, half a day on the launch retro, evening free.',\n    date: 'Aug 28',\n  },\n  {\n    id: 'c9',\n    kind: 'chat',\n    title: 'Review API rate limit options',\n    snippet:\n      'Token bucket per API key, 600 requests a minute. Raise the ceiling for launch week.',\n    date: 'Aug 26',\n  },\n];\n\nconst images: SearchResult[] = [\n  {\n    id: 'i1',\n    kind: 'image',\n    title: 'launch-hero-banner.png',\n    snippet: 'Image',\n    date: 'Sep 3',\n    thumbnail: 'linear-gradient(135deg, #f97316, #db2777)',\n  },\n  {\n    id: 'i2',\n    kind: 'image',\n    title: 'launch-pricing-table.png',\n    snippet: 'Image',\n    date: 'Aug 20',\n    thumbnail: 'linear-gradient(135deg, #0ea5e9, #6366f1)',\n  },\n  {\n    id: 'i3',\n    kind: 'image',\n    title: 'launch-onboarding-flow.png',\n    snippet: 'Image',\n    date: 'Aug 27',\n    thumbnail: 'linear-gradient(135deg, #22c55e, #0d9488)',\n  },\n  {\n    id: 'i4',\n    kind: 'image',\n    title: 'dashboard-dark-mode.png',\n    snippet: 'Image',\n    date: 'Aug 15',\n    thumbnail: 'linear-gradient(135deg, #1e293b, #475569)',\n  },\n  {\n    id: 'i5',\n    kind: 'image',\n    title: 'launch-social-card.jpg',\n    snippet: 'Image',\n    date: 'Aug 12',\n    thumbnail: 'linear-gradient(135deg, #a855f7, #f43f5e)',\n  },\n  {\n    id: 'i6',\n    kind: 'image',\n    title: 'checkout-error-states.png',\n    snippet: 'Image',\n    date: 'Jul 30',\n    thumbnail: 'linear-gradient(135deg, #eab308, #f97316)',\n  },\n];\n\nconst documents: SearchResult[] = [\n  {\n    id: 'd1',\n    kind: 'document',\n    title: 'Q3_launch_plan.pdf',\n    snippet: 'PDF',\n    date: 'Sep 1',\n  },\n  {\n    id: 'd2',\n    kind: 'document',\n    title: 'launch-pricing-proposal.docx',\n    snippet: 'Document',\n    date: 'Aug 22',\n  },\n  {\n    id: 'd3',\n    kind: 'document',\n    title: 'pre-launch-interview-notes.md',\n    snippet: 'Document',\n    date: 'Aug 19',\n  },\n  {\n    id: 'd4',\n    kind: 'document',\n    title: 'launch-assets-final.zip',\n    snippet: 'File',\n    date: 'Aug 11',\n  },\n  {\n    id: 'd5',\n    kind: 'document',\n    title: 'pricing-experiments.xlsx',\n    snippet: 'Spreadsheet',\n    date: 'Aug 14',\n  },\n];\n\nconst projects: SearchResult[] = [\n  {\n    id: 'p1',\n    kind: 'project',\n    title: 'Q3 product launch',\n    snippet: 'Project',\n    date: 'Sep 5',\n  },\n  {\n    id: 'p2',\n    kind: 'project',\n    title: 'Launch pricing and packaging',\n    snippet: 'Project',\n    date: 'Aug 30',\n  },\n  {\n    id: 'p3',\n    kind: 'project',\n    title: 'Post-launch onboarding redesign',\n    snippet: 'Project',\n    date: 'Aug 21',\n  },\n  {\n    id: 'p4',\n    kind: 'project',\n    title: 'Checkout reliability',\n    snippet: 'Project',\n    date: 'Jul 28',\n  },\n];\n\nconst searchResults: SearchResult[] = [\n  ...lastOpenedChats,\n  ...recentChats,\n  ...images,\n  ...documents,\n  ...projects,\n];\n\nexport function CommandMenu04() {\n  const [open, setOpen] = useState(true);\n\n  return (\n    <>\n      <Button onClick={() => setOpen(true)} variant=\"outline\">\n        Search\n      </Button>\n\n      <GlobalSearch\n        lastOpened={lastOpenedChats}\n        onOpenChange={setOpen}\n        onSelect={() => setOpen(false)}\n        open={open}\n        recent={recentChats}\n        results={searchResults}\n      />\n    </>\n  );\n}\n\nexport function GlobalSearch({\n  open,\n  onOpenChange,\n  onSelect,\n  lastOpened,\n  recent,\n  results,\n}: {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  onSelect: (result: SearchResult) => void;\n  lastOpened: SearchResult[];\n  recent: SearchResult[];\n  results: SearchResult[];\n}) {\n  const [query, setQuery] = useState('');\n  const [filter, setFilter] = useState<Filter>('all');\n  const needle = query.trim().toLowerCase();\n\n  const matches = results.filter(\n    (result) =>\n      (filter === 'all' || result.kind === filter) &&\n      `${result.title} ${result.snippet}`.toLowerCase().includes(needle)\n  );\n\n  const reset = () => {\n    setQuery('');\n    setFilter('all');\n  };\n\n  return (\n    <CommandDialog\n      className=\"-translate-y-1/2 top-1/2 rounded-2xl! sm:max-w-[720px]\"\n      description=\"Search chats, images, documents, and projects\"\n      onOpenChange={(next) => {\n        if (!next) {\n          reset();\n        }\n        onOpenChange(next);\n      }}\n      open={open}\n      title=\"Global search\"\n    >\n      <Command shouldFilter={false}>\n        <div className=\"flex h-16 shrink-0 items-center py-5 pr-4 pl-6\">\n          <CommandPrimitive.Input\n            className=\"min-w-0 flex-1 bg-transparent text-base tracking-[-0.02em] outline-hidden placeholder:text-muted-foreground\"\n            onValueChange={setQuery}\n            placeholder=\"Search...\"\n            value={query}\n          />\n          <div className=\"flex shrink-0 items-center gap-1\">\n            {query && (\n              <>\n                <button\n                  className=\"px-2 text-muted-foreground text-sm hover:text-foreground\"\n                  onClick={reset}\n                  type=\"button\"\n                >\n                  Clear\n                </button>\n                <span aria-hidden className=\"mx-1 h-5 w-px bg-border\" />\n              </>\n            )}\n            <button\n              aria-label=\"Close search\"\n              className=\"flex size-9 items-center justify-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground\"\n              onClick={() => onOpenChange(false)}\n              type=\"button\"\n            >\n              <IconX className=\"size-5\" />\n            </button>\n          </div>\n        </div>\n\n        <CommandList className=\"h-[396px] max-h-[396px] pb-3\">\n          {needle ? (\n            <>\n              <div\n                aria-label=\"Result type filters\"\n                className=\"sticky top-0 z-10 flex gap-1 bg-popover px-6 pb-3\"\n                role=\"tablist\"\n              >\n                {filters.map((option) => {\n                  const selected = option.value === filter;\n                  return (\n                    <button\n                      aria-selected={selected}\n                      className={cn(\n                        'rounded-full px-3.5 py-1.5 text-sm transition-colors',\n                        selected\n                          ? 'bg-muted text-foreground'\n                          : 'text-muted-foreground hover:text-foreground'\n                      )}\n                      key={option.value}\n                      onClick={() => setFilter(option.value)}\n                      role=\"tab\"\n                      type=\"button\"\n                    >\n                      {option.label}\n                    </button>\n                  );\n                })}\n              </div>\n              <CommandEmpty>No results for “{query}”.</CommandEmpty>\n              {filter === 'image' ? (\n                <div className=\"grid grid-cols-4 gap-3 px-6\">\n                  {matches.map((result) => (\n                    <CommandItem\n                      className=\"block aspect-square rounded-xl! bg-transparent! p-0 [&_svg]:hidden\"\n                      key={result.id}\n                      onSelect={() => onSelect(result)}\n                      value={result.id}\n                    >\n                      <span\n                        aria-label={result.title}\n                        className=\"block size-full rounded-xl ring-1 ring-foreground/10 ring-offset-2 ring-offset-popover group-data-selected/command-item:ring-foreground/40\"\n                        role=\"img\"\n                        style={{ background: result.thumbnail }}\n                      />\n                    </CommandItem>\n                  ))}\n                </div>\n              ) : (\n                matches.map((result) => (\n                  <ResultRow\n                    key={result.id}\n                    needle={needle}\n                    onSelect={onSelect}\n                    result={result}\n                  />\n                ))\n              )}\n            </>\n          ) : (\n            <>\n              <CommandGroup\n                className=\"p-0 **:[[cmdk-group-heading]]:px-6 **:[[cmdk-group-heading]]:py-2 **:[[cmdk-group-heading]]:font-normal! **:[[cmdk-group-heading]]:text-sm!\"\n                heading=\"Last opened\"\n              >\n                {lastOpened.map((result) => (\n                  <ResultRow\n                    key={result.id}\n                    onSelect={onSelect}\n                    result={result}\n                  />\n                ))}\n              </CommandGroup>\n              <CommandGroup\n                className=\"mt-5 p-0 **:[[cmdk-group-heading]]:px-6 **:[[cmdk-group-heading]]:py-2 **:[[cmdk-group-heading]]:font-normal! **:[[cmdk-group-heading]]:text-sm!\"\n                heading=\"Recent chats\"\n              >\n                {recent.map((result) => (\n                  <ResultRow\n                    key={result.id}\n                    onSelect={onSelect}\n                    result={result}\n                  />\n                ))}\n              </CommandGroup>\n            </>\n          )}\n        </CommandList>\n      </Command>\n    </CommandDialog>\n  );\n}\n\nfunction ResultRow({\n  result,\n  needle,\n  onSelect,\n}: {\n  result: SearchResult;\n  needle?: string;\n  onSelect: (result: SearchResult) => void;\n}) {\n  const extension = result.title.split('.').pop() ?? '';\n  const Icon =\n    result.kind === 'document'\n      ? (fileIcons[extension] ?? IconFileText)\n      : kindIcons[result.kind];\n\n  return (\n    <CommandItem\n      className=\"mx-3 min-h-12 gap-3 rounded-xl! px-3 py-2 text-sm\"\n      onSelect={() => onSelect(result)}\n      value={result.id}\n    >\n      <span className=\"flex size-8 shrink-0 items-center justify-center\">\n        <Icon\n          className={cn('size-5!', extension === 'pdf' && 'text-red-500')}\n        />\n      </span>\n      <span className=\"min-w-0 flex-1\">\n        <span className=\"block truncate leading-5\">\n          <Highlight needle={needle} text={result.title} />\n        </span>\n        {needle && (\n          <span className=\"block truncate pt-0.5 text-muted-foreground leading-5\">\n            <Highlight needle={needle} text={result.snippet} />\n          </span>\n        )}\n      </span>\n      {needle && (\n        <span className=\"shrink-0 pl-4 text-muted-foreground text-sm\">\n          {result.date}\n        </span>\n      )}\n    </CommandItem>\n  );\n}\n\nfunction Highlight({ text, needle }: { text: string; needle?: string }) {\n  const start = needle ? text.toLowerCase().indexOf(needle) : -1;\n  if (!needle || start === -1) {\n    return text;\n  }\n  const end = start + needle.length;\n  return (\n    <>\n      {text.slice(0, start)}\n      <mark className=\"bg-transparent font-semibold text-foreground\">\n        {text.slice(start, end)}\n      </mark>\n      {text.slice(end)}\n    </>\n  );\n}\n"
    },
    {
      "path": "licenses/command-menu-04/LICENSE.txt",
      "type": "registry:file",
      "target": "@components/uiblocks/command-menu-04/LICENSE.txt",
      "content": "Includes source from Blocks.so and its bundled primitives.\nSource: https://github.com/ephraimduncan/blocks\nRevision: 3f759d5171c2391253ec4c772e9e5b3db2bc7c7f\n\nMIT License\n\nCopyright (c) 2025 Ephraim Duncan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
    },
    {
      "path": "components/ui/button.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/shared/components/ui/button.tsx",
      "content": "import { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariants = cva(\n  \"group/button inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-lg border border-transparent bg-clip-padding font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n  {\n    variants: {\n      variant: {\n        default: 'bg-primary text-primary-foreground hover:bg-primary/80',\n        outline:\n          'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',\n        secondary:\n          'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',\n        ghost:\n          'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',\n        destructive:\n          'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 dark:hover:bg-destructive/30',\n        link: 'text-primary underline-offset-4 hover:underline',\n      },\n      size: {\n        default:\n          'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n        xs: \"h-6 gap-1 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),10px)] px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n        sm: \"h-7 gap-1 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n        lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n        icon: 'size-8',\n        'icon-xs':\n          \"size-6 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),10px)] [&_svg:not([class*='size-'])]:size-3\",\n        'icon-sm':\n          'size-7 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),12px)]',\n        'icon-lg': 'size-9',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n      size: 'default',\n    },\n  }\n);\n\nfunction Button({\n  className,\n  variant = 'default',\n  size = 'default',\n  ...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {\n  return (\n    <ButtonPrimitive\n      className={cn(buttonVariants({ variant, size, className }))}\n      data-slot=\"button\"\n      {...props}\n    />\n  );\n}\n\nexport { Button, buttonVariants };\n"
    },
    {
      "path": "components/ui/command.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/shared/components/ui/command.tsx",
      "content": "'use client';\n\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { CheckIcon, SearchIcon } from 'lucide-react';\nimport type * as React from 'react';\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogHeader,\n  DialogTitle,\n} from \"./dialog\";\nimport { InputGroup, InputGroupAddon } from \"./input-group\";\nimport { cn } from \"../../lib/utils\";\n\nfunction Command({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n  return (\n    <CommandPrimitive\n      className={cn(\n        'flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground',\n        className\n      )}\n      data-slot=\"command\"\n      {...props}\n    />\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=\"sr-only\">\n        <DialogTitle>{title}</DialogTitle>\n        <DialogDescription>{description}</DialogDescription>\n      </DialogHeader>\n      <DialogContent\n        className={cn(\n          'top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0',\n          className\n        )}\n        showCloseButton={showCloseButton}\n      >\n        {children}\n      </DialogContent>\n    </Dialog>\n  );\n}\n\nfunction CommandInput({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n  return (\n    <div className=\"p-1 pb-0\" data-slot=\"command-input-wrapper\">\n      <InputGroup className=\"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!\">\n        <CommandPrimitive.Input\n          className={cn(\n            'w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n            className\n          )}\n          data-slot=\"command-input\"\n          {...props}\n        />\n        <InputGroupAddon>\n          <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n        </InputGroupAddon>\n      </InputGroup>\n    </div>\n  );\n}\n\nfunction CommandList({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n  return (\n    <CommandPrimitive.List\n      className={cn(\n        'no-scrollbar max-h-72 scroll-py-1 overflow-y-auto overflow-x-hidden outline-none',\n        className\n      )}\n      data-slot=\"command-list\"\n      {...props}\n    />\n  );\n}\n\nfunction CommandEmpty({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n  return (\n    <CommandPrimitive.Empty\n      className={cn('py-6 text-center text-sm', className)}\n      data-slot=\"command-empty\"\n      {...props}\n    />\n  );\n}\n\nfunction CommandGroup({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n  return (\n    <CommandPrimitive.Group\n      className={cn(\n        'overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground **:[[cmdk-group-heading]]:text-xs',\n        className\n      )}\n      data-slot=\"command-group\"\n      {...props}\n    />\n  );\n}\n\nfunction CommandSeparator({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n  return (\n    <CommandPrimitive.Separator\n      className={cn('-mx-1 h-px bg-border', className)}\n      data-slot=\"command-separator\"\n      {...props}\n    />\n  );\n}\n\nfunction CommandItem({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n  return (\n    <CommandPrimitive.Item\n      className={cn(\n        \"group/command-item relative flex cursor-default select-none items-center gap-2 in-data-[slot=dialog-content]:rounded-lg! rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-selected:bg-muted data-selected:text-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-selected:*:[svg]:text-foreground\",\n        className\n      )}\n      data-slot=\"command-item\"\n      {...props}\n    >\n      {children}\n      <CheckIcon className=\"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100\" />\n    </CommandPrimitive.Item>\n  );\n}\n\nfunction CommandShortcut({\n  className,\n  ...props\n}: React.ComponentProps<'span'>) {\n  return (\n    <span\n      className={cn(\n        'ml-auto text-muted-foreground text-xs tracking-widest group-data-selected/command-item:text-foreground',\n        className\n      )}\n      data-slot=\"command-shortcut\"\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"
    },
    {
      "path": "components/ui/dialog.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/shared/components/ui/dialog.tsx",
      "content": "'use client';\n\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { XIcon } from 'lucide-react';\nimport type * as React from 'react';\nimport { Button } from \"./button\";\nimport { cn } from \"../../lib/utils\";\n\nfunction Dialog({ ...props }: DialogPrimitive.Root.Props) {\n  return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {\n  return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {\n  return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({ ...props }: DialogPrimitive.Close.Props) {\n  return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n  className,\n  ...props\n}: DialogPrimitive.Backdrop.Props) {\n  return (\n    <DialogPrimitive.Backdrop\n      className={cn(\n        'data-open:fade-in-0 data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 data-closed:animate-out data-open:animate-in supports-backdrop-filter:backdrop-blur-xs',\n        className\n      )}\n      data-slot=\"dialog-overlay\"\n      {...props}\n    />\n  );\n}\n\nfunction DialogContent({\n  className,\n  children,\n  showCloseButton = true,\n  ...props\n}: DialogPrimitive.Popup.Props & {\n  showCloseButton?: boolean;\n}) {\n  return (\n    <DialogPortal>\n      <DialogOverlay />\n      <DialogPrimitive.Popup\n        className={cn(\n          '-translate-x-1/2 -translate-y-1/2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-xl bg-popover p-4 text-popover-foreground text-sm outline-none ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in sm:max-w-sm',\n          className\n        )}\n        data-slot=\"dialog-content\"\n        {...props}\n      >\n        {children}\n        {showCloseButton && (\n          <DialogPrimitive.Close\n            data-slot=\"dialog-close\"\n            render={\n              <Button\n                className=\"absolute top-2 right-2\"\n                size=\"icon-sm\"\n                variant=\"ghost\"\n              />\n            }\n          >\n            <XIcon />\n            <span className=\"sr-only\">Close</span>\n          </DialogPrimitive.Close>\n        )}\n      </DialogPrimitive.Popup>\n    </DialogPortal>\n  );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n  return (\n    <div\n      className={cn('flex flex-col gap-2', className)}\n      data-slot=\"dialog-header\"\n      {...props}\n    />\n  );\n}\n\nfunction DialogFooter({\n  className,\n  showCloseButton = false,\n  children,\n  ...props\n}: React.ComponentProps<'div'> & {\n  showCloseButton?: boolean;\n}) {\n  return (\n    <div\n      className={cn(\n        '-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end',\n        className\n      )}\n      data-slot=\"dialog-footer\"\n      {...props}\n    >\n      {children}\n      {showCloseButton && (\n        <DialogPrimitive.Close render={<Button variant=\"outline\" />}>\n          Close\n        </DialogPrimitive.Close>\n      )}\n    </div>\n  );\n}\n\nfunction DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {\n  return (\n    <DialogPrimitive.Title\n      className={cn('font-medium text-base leading-none', className)}\n      data-slot=\"dialog-title\"\n      {...props}\n    />\n  );\n}\n\nfunction DialogDescription({\n  className,\n  ...props\n}: DialogPrimitive.Description.Props) {\n  return (\n    <DialogPrimitive.Description\n      className={cn(\n        'text-muted-foreground text-sm *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n        className\n      )}\n      data-slot=\"dialog-description\"\n      {...props}\n    />\n  );\n}\n\nexport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogOverlay,\n  DialogPortal,\n  DialogTitle,\n  DialogTrigger,\n};\n"
    },
    {
      "path": "components/ui/input-group.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/shared/components/ui/input-group.tsx",
      "content": "'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Textarea } from \"./textarea\";\nimport { cn } from \"../../lib/utils\";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<'div'>) {\n  return (\n    <div\n      className={cn(\n        'group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input outline-none transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-start]]:h-auto has-[>textarea]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:flex-col has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-start]]:[&>input]:pl-1.5',\n        className\n      )}\n      data-slot=\"input-group\"\n      role=\"group\"\n      {...props}\n    />\n  );\n}\n\nconst inputGroupAddonVariants = cva(\n  \"flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 font-medium text-muted-foreground text-sm group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      align: {\n        'inline-start':\n          'order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]',\n        'inline-end':\n          'order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]',\n        'block-start':\n          'order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2',\n        'block-end':\n          'order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2',\n      },\n    },\n    defaultVariants: {\n      align: 'inline-start',\n    },\n  }\n);\n\nfunction InputGroupAddon({\n  className,\n  align = 'inline-start',\n  ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {\n  return (\n    <div\n      className={cn(inputGroupAddonVariants({ align }), className)}\n      data-align={align}\n      data-slot=\"input-group-addon\"\n      onClick={(e) => {\n        if ((e.target as HTMLElement).closest('button')) {\n          return;\n        }\n        e.currentTarget.parentElement?.querySelector('input')?.focus();\n      }}\n      role=\"group\"\n      {...props}\n    />\n  );\n}\n\nconst inputGroupButtonVariants = cva(\n  'flex items-center gap-2 text-sm shadow-none',\n  {\n    variants: {\n      size: {\n        xs: \"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5\",\n        sm: '',\n        'icon-xs':\n          'size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0',\n        'icon-sm': 'size-8 p-0 has-[>svg]:p-0',\n      },\n    },\n    defaultVariants: {\n      size: 'xs',\n    },\n  }\n);\n\nfunction InputGroupButton({\n  className,\n  type = 'button',\n  variant = 'ghost',\n  size = 'xs',\n  ...props\n}: Omit<React.ComponentProps<typeof Button>, 'size' | 'type'> &\n  VariantProps<typeof inputGroupButtonVariants> & {\n    type?: 'button' | 'submit' | 'reset';\n  }) {\n  return (\n    <Button\n      className={cn(inputGroupButtonVariants({ size }), className)}\n      data-size={size}\n      type={type}\n      variant={variant}\n      {...props}\n    />\n  );\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {\n  return (\n    <span\n      className={cn(\n        \"flex items-center gap-2 text-muted-foreground text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none\",\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction InputGroupInput({\n  className,\n  ...props\n}: React.ComponentProps<'input'>) {\n  return (\n    <Input\n      className={cn(\n        'flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',\n        className\n      )}\n      data-slot=\"input-group-control\"\n      {...props}\n    />\n  );\n}\n\nfunction InputGroupTextarea({\n  className,\n  ...props\n}: React.ComponentProps<'textarea'>) {\n  return (\n    <Textarea\n      className={cn(\n        'flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',\n        className\n      )}\n      data-slot=\"input-group-control\"\n      {...props}\n    />\n  );\n}\n\nexport {\n  InputGroup,\n  InputGroupAddon,\n  InputGroupButton,\n  InputGroupText,\n  InputGroupInput,\n  InputGroupTextarea,\n};\n"
    },
    {
      "path": "components/ui/input.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/shared/components/ui/input.tsx",
      "content": "import { Input as InputPrimitive } from '@base-ui/react/input';\nimport type * as React from 'react';\n\nimport { cn } from \"../../lib/utils\";\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n  return (\n    <InputPrimitive\n      className={cn(\n        'h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base outline-none transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:disabled:bg-input/80',\n        className\n      )}\n      data-slot=\"input\"\n      type={type}\n      {...props}\n    />\n  );\n}\n\nexport { Input };\n"
    },
    {
      "path": "components/ui/textarea.tsx",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/shared/components/ui/textarea.tsx",
      "content": "import type * as React from 'react';\n\nimport { cn } from \"../../lib/utils\";\n\nfunction Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {\n  return (\n    <textarea\n      className={cn(\n        'field-sizing-content flex min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:disabled:bg-input/80',\n        className\n      )}\n      data-slot=\"textarea\"\n      {...props}\n    />\n  );\n}\n\nexport { Textarea };\n"
    },
    {
      "path": "lib/utils.ts",
      "type": "registry:component",
      "target": "@components/uiblocks/command-menu-04/shared/lib/utils.ts",
      "content": "export { cn } from \"cn\";\n"
    }
  ],
  "categories": [
    "command-menu",
    "application",
    "clean-saas"
  ],
  "docs": "Import the named export CommandMenu04 from @components/uiblocks/command-menu-04/command-menu-04.tsx. React 19, Tailwind CSS 4, and the standard shadcn CSS theme variables are required. This block is framework-independent React and works in TanStack Start, Vite, and Next.js projects. Connect links or navigation callbacks to your host application. Demo avatars use public image URLs; replace them with your own assets. Demo handlers must be connected to your product. See https://uiblocks.org/command-menu/command-menu-04 for content guidelines and source attribution.",
  "meta": {
    "kind": "block",
    "version": "0.1.0",
    "source": {
      "name": "Blocks.so",
      "url": "https://github.com/ephraimduncan/blocks",
      "license": "MIT",
      "author": "Ephraim Duncan",
      "revision": "3f759d5171c2391253ec4c772e9e5b3db2bc7c7f"
    },
    "license": "MIT",
    "style": "clean-saas",
    "pageType": "application",
    "featured": false,
    "tags": [
      "command",
      "search",
      "palette",
      "keyboard",
      "命令",
      "搜索",
      "快捷键"
    ],
    "contentGuidelines": [
      "Give each command a clear label and an actual destination or action.",
      "Verify shortcuts do not conflict with browser or form behavior."
    ],
    "recommendedWith": [],
    "entry": "@components/uiblocks/command-menu-04/command-menu-04.tsx",
    "exportName": "CommandMenu04",
    "frameworkIndependent": true,
    "frameworkDependencies": [],
    "compatibleHosts": [
      "react",
      "vite",
      "tanstack-start",
      "nextjs"
    ],
    "requirements": {
      "react": ">=19",
      "tailwind": ">=4"
    },
    "previewUrl": "https://uiblocks.org/preview/command-menu-04"
  }
}
