{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "adminlte-form-control", "title": "AdminLTE Form Controls", "description": "Form elements including input, textarea, select with AdminLTE styling, validation states, and form groups.", "registryDependencies": [ "https://raw.githubusercontent.com/dnachavez/adminlte-next/master/public/r/adminlte-theme.json" ], "files": [ { "path": "registry/new-york/adminlte-form-control/ui/adminlte-form-control.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/registry/new-york/adminlte-theme/lib/cn\"\n\ntype ValidationState = \"success\" | \"warning\" | \"error\" | null\n\nconst validationBorderStyles: Record = {\n success: \"border-[#00a65a] focus:border-[#00a65a] focus:shadow-[inset_0_1px_1px_rgba(0,0,0,0.075),0_0_6px_#00c97a]\",\n warning: \"border-[#f39c12] focus:border-[#f39c12] focus:shadow-[inset_0_1px_1px_rgba(0,0,0,0.075),0_0_6px_#f5b043]\",\n error: \"border-[#dd4b39] focus:border-[#dd4b39] focus:shadow-[inset_0_1px_1px_rgba(0,0,0,0.075),0_0_6px_#e47365]\",\n}\n\nconst validationTextStyles: Record = {\n success: \"text-[#00a65a]\",\n warning: \"text-[#f39c12]\",\n error: \"text-[#dd4b39]\",\n}\n\n// Form Group\ninterface FormGroupProps extends React.HTMLAttributes {\n validation?: ValidationState\n hasFeedback?: boolean\n label?: string\n htmlFor?: string\n helpText?: string\n}\n\nconst FormGroup = React.forwardRef(\n (\n { className, validation, hasFeedback, label, htmlFor, helpText, children, ...props },\n ref\n ) => {\n return (\n \n {label && (\n \n {label}\n \n )}\n {children}\n {helpText && (\n \n {helpText}\n

\n )}\n \n )\n }\n)\nFormGroup.displayName = \"FormGroup\"\n\n// Input\ninterface AdminLTEInputProps\n extends React.InputHTMLAttributes {\n validation?: ValidationState\n inputSize?: \"sm\" | \"lg\"\n}\n\nconst AdminLTEInput = React.forwardRef(\n ({ className, validation, inputSize, ...props }, ref) => {\n return (\n \n )\n }\n)\nAdminLTEInput.displayName = \"AdminLTEInput\"\n\n// Textarea\ninterface AdminLTETextareaProps\n extends React.TextareaHTMLAttributes {\n validation?: ValidationState\n}\n\nconst AdminLTETextarea = React.forwardRef<\n HTMLTextAreaElement,\n AdminLTETextareaProps\n>(({ className, validation, ...props }, ref) => {\n return (\n \n )\n})\nAdminLTETextarea.displayName = \"AdminLTETextarea\"\n\n// Select\ninterface AdminLTESelectProps\n extends React.SelectHTMLAttributes {\n validation?: ValidationState\n inputSize?: \"sm\" | \"lg\"\n}\n\nconst AdminLTESelect = React.forwardRef(\n ({ className, validation, inputSize, children, ...props }, ref) => {\n return (\n \n {children}\n \n )\n }\n)\nAdminLTESelect.displayName = \"AdminLTESelect\"\n\nexport {\n FormGroup,\n AdminLTEInput,\n AdminLTETextarea,\n AdminLTESelect,\n}\nexport type {\n FormGroupProps,\n AdminLTEInputProps,\n AdminLTETextareaProps,\n AdminLTESelectProps,\n ValidationState,\n}\n", "type": "registry:ui" } ], "type": "registry:ui" }