{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "prompt",
  "title": "Prompt",
  "description": "A shell line. Sigil, field and caret share one row with no border between them.",
  "registryDependencies": [
    "@afterglow/caret"
  ],
  "files": [
    {
      "path": "registry/terminal/components/prompt.tsx",
      "content": "\"use client\";\n\nimport { useCallback, useId, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Caret } from \"@/registry/terminal/components/caret\";\n\nfunction Prompt({\n  className,\n  sigil = \">\",\n  label = \"Command\",\n  placeholder,\n  onSubmit,\n  ...props\n}: Omit<React.ComponentProps<\"form\">, \"onSubmit\"> & {\n  sigil?: string;\n  label?: string;\n  placeholder?: string;\n  onSubmit?: (value: string) => void;\n}) {\n  const id = useId();\n  const [value, setValue] = useState(\"\");\n\n  const submit = useCallback(\n    (event: React.FormEvent<HTMLFormElement>) => {\n      event.preventDefault();\n      const trimmed = value.trim();\n      if (trimmed) {\n        onSubmit?.(trimmed);\n        setValue(\"\");\n      }\n    },\n    [value, onSubmit]\n  );\n\n  const change = useCallback(\n    (event: React.ChangeEvent<HTMLInputElement>) =>\n      setValue(event.target.value),\n    []\n  );\n\n  return (\n    <form\n      className={cn(\n        \"flex items-center gap-2 border border-line bg-panel-sunken px-3 py-2 font-mono text-base transition duration-150 ease-terminal focus-within:border-line-strong focus-within:shadow-glow md:text-sm\",\n        className\n      )}\n      data-slot=\"prompt\"\n      onSubmit={submit}\n      {...props}\n    >\n      <label className=\"sr-only\" htmlFor={id}>\n        {label}\n      </label>\n      <span aria-hidden=\"true\" className=\"select-none text-signal\">\n        {sigil}\n      </span>\n      <input\n        autoComplete=\"off\"\n        className=\"min-w-0 flex-1 border-0 bg-transparent p-0 text-phosphor-bright caret-phosphor-bright outline-none placeholder:text-phosphor-dim selection:bg-signal selection:text-white focus-visible:outline-0\"\n        id={id}\n        onChange={change}\n        placeholder={placeholder}\n        spellCheck={false}\n        value={value}\n      />\n      <Caret />\n    </form>\n  );\n}\n\nexport { Prompt };\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}