{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A form field: label, control (children), hint and error text. `htmlFor` ties the label to the id of the control.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/parts/field.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/label\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// FieldProps are the props of Field; the values are the JSON shapes of the TypeScript props.\ntype FieldProps struct {\n\tLabel any `json:\"label\"`\n\tHtmlFor any `json:\"htmlFor\"`\n\tHint any `json:\"hint\"`\n\tError any `json:\"error\"`\n\tClass string `json:\"className\"`\n}\n\n// A form field: label, control (children), hint and error text. `htmlFor` ties the label to the id of the control.\ntempl Field(p FieldProps) {\n\t{{ vLabel := p.Label }}\n\t{{ vHtmlFor := p.HtmlFor }}\n\t{{ vHint := p.Hint }}\n\t{{ vError := p.Error }}\n\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"flex min-w-0 flex-col gap-2\", p.Class))}}) {\n\t\t@compose.Label(compose.LabelProps{LabelProps: label.LabelProps{Class: \"text-xs font-bold text-foreground\", For: uiutils.S(vHtmlFor)}}) {\n\t\t\t{ uiutils.Text(vLabel) }\n\t\t}\n\t\t{ children... }\n\t\tif uiutils.T(vError) {\n\t\t\t@compose.Text(compose.TextProps{TextProps: text.TextProps{Class: \"m-0 text-xs font-semibold text-destructive\", Attrs: uiutils.Attrs(\"role\", \"alert\")}}) {\n\t\t\t\t{ uiutils.Text(vError) }\n\t\t\t}\n\t\t} else if uiutils.T(vHint) {\n\t\t\t@compose.Text(compose.TextProps{TextProps: text.TextProps{Class: \"m-0 text-xs font-medium text-muted-foreground\"}}) {\n\t\t\t\t{ uiutils.Text(vHint) }\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/field.templ",
      "target": "blocks/field.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "field",
  "registryDependencies": [
    "box",
    "kit-box",
    "kit-label",
    "kit-text",
    "label",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Field",
  "type": "registry:component"
}
