{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "row",
  "title": "RowField",
  "description": "Row layout field for BuzzForm v2.",
  "registryDependencies": [
    "@buzzform/init"
  ],
  "files": [
    {
      "path": "registry/shadcn/fields/row.tsx",
      "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport type { RowField as RowFieldDef } from \"@buildnbuzz/form-react\";\nimport { useLayoutField } from \"@buildnbuzz/form-react\";\nimport { cn } from \"@/lib/utils\";\n\n/** Typed UI options for the row layout field (opaque in form-core). */\ninterface RowUi {\n  gap?: number | string;\n  align?: \"start\" | \"center\" | \"end\" | \"stretch\";\n  justify?: \"start\" | \"center\" | \"end\" | \"between\";\n  responsive?: boolean;\n  wrap?: boolean;\n}\n\nfunction getGapClass(gap: number | string | undefined): string {\n  if (gap === undefined) return \"gap-4\";\n  if (typeof gap === \"number\") {\n    const gapMap: Record<number, string> = {\n      0: \"gap-0\",\n      1: \"gap-1\",\n      2: \"gap-2\",\n      3: \"gap-3\",\n      4: \"gap-4\",\n      5: \"gap-5\",\n      6: \"gap-6\",\n      8: \"gap-8\",\n      10: \"gap-10\",\n      12: \"gap-12\",\n    };\n    return gapMap[gap] || \"gap-4\";\n  }\n  return \"\";\n}\n\nfunction getAlignClass(ui: RowUi | undefined): string {\n  switch (ui?.align) {\n    case \"start\":\n      return \"items-start\";\n    case \"center\":\n      return \"items-center\";\n    case \"end\":\n      return \"items-end\";\n    case \"stretch\":\n      return \"items-stretch\";\n    default:\n      return \"items-start\";\n  }\n}\n\nfunction getJustifyClass(ui: RowUi | undefined): string {\n  switch (ui?.justify) {\n    case \"start\":\n      return \"justify-start\";\n    case \"center\":\n      return \"justify-center\";\n    case \"end\":\n      return \"justify-end\";\n    case \"between\":\n      return \"justify-between\";\n    default:\n      return \"justify-start\";\n  }\n}\n\n/**\n * Shadcn row layout field.\n *\n * Nested child fields are pre-rendered by `FieldRenderer` / `RenderFields`\n * and passed in as `children`. This component only provides the flex wrapper.\n */\nexport function RowField({ children }: { children?: ReactNode }) {\n  const { field } = useLayoutField<RowFieldDef>();\n\n  const ui = field.ui as RowUi | undefined;\n  const responsive = ui?.responsive ?? true;\n  const wrap = ui?.wrap ?? false;\n\n  const gapClass = getGapClass(ui?.gap);\n  const alignClass = getAlignClass(ui);\n  const justifyClass = getJustifyClass(ui);\n\n  const gapStyle =\n    typeof ui?.gap === \"string\"\n      ? ({ \"--row-gap\": ui.gap } as CSSProperties)\n      : undefined;\n\n  return (\n    <div\n      className={cn(\n        \"flex w-full\",\n        responsive ? \"flex-col md:flex-row\" : \"flex-row\",\n        gapStyle ? \"gap-(--row-gap)\" : gapClass,\n        alignClass,\n        justifyClass,\n        wrap && \"flex-wrap\",\n        // Each direct DOM child (FieldGroup div) becomes a flex item\n        \"*:min-w-0\",\n        responsive ? \"*:w-full md:*:flex-1\" : \"*:flex-1\",\n      )}\n      style={gapStyle}\n    >\n      {children}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/buzzform/fields/row.tsx"
    }
  ],
  "type": "registry:ui"
}