{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "inline-input",
  "type": "registry:component",
  "title": "Inline Input",
  "description": "Inline text input with keyboard commit and cancel support.",
  "dependencies": [
    "@vllnt/ui@^0.2.1"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/inline-input/inline-input.tsx",
      "content": "\"use client\";\n\nimport type { KeyboardEvent } from \"react\";\n\nimport { cn } from \"@vllnt/ui\";\nimport { Input } from \"@vllnt/ui\";\n\nexport type InlineInputProps = {\n  className?: string;\n  /** Called when user presses Escape or blurs without changes. */\n  onCancel?: () => void;\n  /** Called when the input value changes. */\n  onChange: (value: string) => void;\n  /** Called when user presses Enter or blurs with changes. */\n  onCommit: (value: string) => void;\n  /** Current input value. */\n  value: string;\n};\n\n/**\n * Inline input for editing text with keyboard support.\n * - Enter: commits the value\n * - Escape: cancels editing\n * - Blur: commits the value\n */\nexport function InlineInput({\n  className,\n  onCancel,\n  onChange,\n  onCommit,\n  value,\n}: InlineInputProps) {\n  const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n    if (event.key === \"Enter\") {\n      event.preventDefault();\n      onCommit(value);\n    } else if (event.key === \"Escape\") {\n      event.preventDefault();\n      onCancel?.();\n    }\n  };\n\n  return (\n    <Input\n      autoFocus // eslint-disable-line jsx-a11y/no-autofocus\n      className={cn(\"flex-1 h-7 text-sm\", className)}\n      onBlur={() => {\n        onCommit(value);\n      }}\n      onChange={(event) => {\n        onChange(event.target.value);\n      }}\n      onClick={(event) => {\n        event.stopPropagation();\n      }}\n      onKeyDown={handleKeyDown}\n      value={value}\n    />\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "version": "0.2.1",
  "stability": "stable"
}
