{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "number-input", "description": "An input that returns a number value and automatically handles invalid inputs.", "registryDependencies": ["input"], "files": [ { "path": "src/registry/new-york/items/number-input/components/number-input.tsx", "content": "import { Input } from \"@/components/ui/input\"\nimport { cn } from \"@/lib/utils\"\nimport { type ComponentProps } from \"react\"\n\nexport function NumberInput({\n onChange,\n value,\n ...props\n}: Omit, \"type\" | \"onChange\" | \"value\"> & {\n onChange: (value: number | null) => void\n value: undefined | null | number\n}) {\n return (\n {\n const number = e.target.valueAsNumber\n onChange(isNaN(number) ? null : number)\n }}\n value={value ?? \"\"}\n type=\"number\"\n />\n )\n}\n\nexport function InputGroupNumberInput({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n )\n}\n", "type": "registry:ui" } ], "type": "registry:component" }