{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "field",
  "title": "field",
  "description": "field",
  "dependencies": [
    "react-aria-components",
    "cn",
    "tailwind-variants"
  ],
  "registryDependencies": [
    "https://intentui.com/r/primitive"
  ],
  "files": [
    {
      "path": "src/components/ui/field.tsx",
      "content": "\"use client\"\n\nimport {\n  FieldError as FieldErrorPrimitive,\n  type FieldErrorProps,\n} from \"react-aria-components/FieldError\"\nimport { LabelContext, Label as LabelPrimitive, type LabelProps } from \"react-aria-components/Label\"\nimport { Text, type TextProps } from \"react-aria-components/Text\"\nimport { cn } from \"cn\"\nimport { tv } from \"tailwind-variants\"\nimport { cx } from \"@/lib/primitive\"\n\nexport const labelStyles = tv({\n  base: [\n    \"select-none text-base/6 text-foreground in-data-required:not-data-[slot='control-label']:after:ml-1.5 sm:text-sm/6\",\n    \"in-data-required:not-data-[slot='control-label']:after:text-danger-subtle-foreground in-data-required:not-data-[slot='control-label']:after:content-['*']\",\n    \"in-disabled:pointer-events-none in-disabled:opacity-50 group-disabled:opacity-50\",\n  ],\n})\n\nexport const descriptionStyles = tv({\n  base: \"block text-muted-foreground text-sm/6 in-disabled:opacity-50 group-disabled:opacity-50\",\n})\n\nexport const fieldErrorStyles = tv({\n  base: \"block text-danger-subtle-foreground text-sm/6 in-disabled:opacity-50 group-disabled:opacity-50 forced-colors:text-[Mark]\",\n})\n\nexport const fieldStyles = tv({\n  base: [\n    \"w-full\",\n    \"[&>[data-slot=control]+[data-slot=control]]:mt-2\",\n    \"[&>[data-slot=label]+[data-slot=control]]:mt-2\",\n    \"[&>[data-slot=label]+[slot='description']]:mt-1\",\n    \"[&>[slot=description]+[data-slot=control]]:mt-2\",\n    \"[&>[data-slot=control]+[slot=description]]:mt-2\",\n    \"[&>[data-slot=control]+[slot=errorMessage]]:mt-2\",\n    \"*:data-[slot=label]:font-medium\",\n    \"in-disabled:opacity-50 disabled:opacity-50\",\n  ],\n})\n\nexport function Label({ className, htmlFor, slot, ...props }: LabelProps) {\n  const label = (\n    <LabelPrimitive\n      data-slot=\"label\"\n      htmlFor={htmlFor}\n      slot={slot}\n      {...props}\n      className={labelStyles({ className })}\n    />\n  )\n\n  if (htmlFor && slot === undefined) {\n    return <LabelContext.Provider value={null}>{label}</LabelContext.Provider>\n  }\n\n  return label\n}\n\nexport function Description({ className, ...props }: TextProps) {\n  return <Text {...props} slot=\"description\" className={descriptionStyles({ className })} />\n}\n\nexport function Fieldset({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n  return (\n    <fieldset\n      className={cn(\"*:data-[slot=text]:mt-1 [&>*+[data-slot=control]]:mt-6\", className)}\n      {...props}\n    />\n  )\n}\n\nexport function FieldGroup({ className, ...props }: React.ComponentPropsWithoutRef<\"div\">) {\n  return <div data-slot=\"control\" className={cn(\"space-y-6\", className)} {...props} />\n}\n\nexport function FieldError({ className, ...props }: FieldErrorProps) {\n  return <FieldErrorPrimitive {...props} className={cx(fieldErrorStyles(), className)} />\n}\n\nexport function Legend({ className, ...props }: React.ComponentProps<\"legend\">) {\n  return (\n    <legend\n      data-slot=\"legend\"\n      {...props}\n      className={cn(\"font-semibold text-base/6 data-disabled:opacity-50\", className)}\n    />\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "cssVars": {
    "theme": {
      "color-danger-subtle-foreground": "var(--danger-subtle-foreground)"
    },
    "light": {
      "danger-subtle-foreground": "oklch(0.505 0.213 27.518)"
    },
    "dark": {
      "danger-subtle-foreground": "oklch(0.704 0.191 22.216)"
    }
  },
  "type": "registry:ui"
}