{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "field", "type": "registry:ui", "title": "Field", "description": "Labeled input with optional leading icon and mono hint, lit by the indigo focus halo. Drop-in over a native input.", "registryDependencies": [ "@delego/delego-theme" ], "files": [ { "path": "registry/delego/ui/field.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n// Field — a labeled input with an optional leading icon and a mono hint, lit by the\n// indigo focus halo on focus-within. Ports the design-system form field; wraps a\n// native so it stays a drop-in.\ntype FieldProps = React.ComponentProps<\"input\"> & {\n label?: string\n hint?: string\n icon?: React.ReactNode\n trailing?: React.ReactNode\n containerClassName?: string\n}\n\nfunction Field({\n label,\n hint,\n icon,\n trailing,\n className,\n containerClassName,\n id,\n ...props\n}: FieldProps) {\n const reactId = React.useId()\n const inputId = id ?? reactId\n return (\n
\n {label && (\n \n )}\n
svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-muted-foreground\">\n {icon}\n \n {trailing}\n
\n {hint && {hint}}\n
\n )\n}\n\nexport { Field, type FieldProps }\n", "type": "registry:ui", "target": "components/ui/field.tsx" } ] }