{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "form",
  "type": "registry:ui",
  "title": "Form",
  "dependencies": [
    "@base-ui-next/react"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/label.json"
  ],
  "files": [
    {
      "path": "react/form.tsx",
      "content": "'use client'\n\nimport { Field as FieldPrimitive } from '@base-ui-next/react/field' // base-ui-next/ui form@0.1.0\nimport { Form as FormPrimitive } from '@base-ui-next/react/form'\nimport type * as React from 'react'\nimport { cn } from '@/lib/utils'\nimport { Label } from '@/components/ui/label'\n\nconst formItemClassName = 'grid gap-2'\n\nconst formLabelClassName = 'data-invalid:text-destructive'\n\nconst formDescriptionClassName = 'text-sm text-muted-foreground'\n\nconst formMessageClassName = 'text-sm text-destructive'\n\n// shadcn's form wraps a form library; here the parts are Base UI's Form and Field, so there is\n// none. Validation (`validate`, the constraint attributes) and the server's errors\n// (`Form`'s `errors`, by field name) both reach `FormMessage` through the field (10 · As built,\n// BN-324).\n\n// Base UI's form: a `<form>` with `errors`, `onFormSubmit` and `validationMode`.\nfunction Form<FormValues extends Record<string, any> = Record<string, any>>({\n  className,\n  ...props\n}: FormPrimitive.Props<FormValues>) {\n  return <FormPrimitive data-slot=\"form\" className={className} {...props} />\n}\n\n// Base UI's field root: takes the field's `name`, `validate` and `validationMode`. shadcn's\n// `render={({ field }) => <FormItem>…</FormItem>}` is `render={<FormItem />}` here, so the item is\n// the field's element.\nfunction FormField({ ...props }: FieldPrimitive.Root.Props) {\n  return <FieldPrimitive.Root data-slot=\"form-field\" {...props} />\n}\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n  return <div data-slot=\"form-item\" className={cn(formItemClassName, className)} {...props} />\n}\n\n// The Label item renders the Base UI field label, as in the field item.\nfunction FormLabel({ className, ...props }: FieldPrimitive.Label.Props) {\n  return (\n    <FieldPrimitive.Label\n      render={<Label />}\n      data-slot=\"form-label\"\n      className={cn(formLabelClassName, className)}\n      {...props}\n    />\n  )\n}\n\n// Base UI's field control (an `<input>`, or the element `render` gives). The Input, Textarea,\n// Select, Checkbox and other items are field controls already and need no FormControl.\nfunction FormControl({ ...props }: FieldPrimitive.Control.Props) {\n  return <FieldPrimitive.Control data-slot=\"form-control\" {...props} />\n}\n\nfunction FormDescription({ className, ...props }: FieldPrimitive.Description.Props) {\n  return (\n    <FieldPrimitive.Description\n      data-slot=\"form-description\"\n      className={cn(formDescriptionClassName, className)}\n      {...props}\n    />\n  )\n}\n\n// Base UI's field error: the validation message or the server's error for the field's name, shown\n// while the field is invalid.\nfunction FormMessage({ className, ...props }: FieldPrimitive.Error.Props) {\n  return (\n    <FieldPrimitive.Error\n      data-slot=\"form-message\"\n      className={cn(formMessageClassName, className)}\n      {...props}\n    />\n  )\n}\n\nexport { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField }\n",
      "type": "registry:ui",
      "target": "@ui/form.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.0",
      "hash": "2fcb651ddb82c664bb71be98bfba1338f0b8e8e1ba6dc0f93d57ab486d5df191",
      "files": {
        "@ui/form.tsx": "be006477354dabae0cd21da493013cbbf725ccf0552204f4b1a0070e4e4eaa54"
      }
    }
  }
}
