{
  "format": "ui-contract-component-draft",
  "id": "shadcn:Field",
  "version": "0.4.1",
  "status": "complete",
  "domains": {
    "interface": "interface.json",
    "visual": {
      "tokens": "../../tokens.json",
      "css": "layout.css"
    },
    "behavior": "behavior.scxml",
    "accessibility": {
      "html": "accessibility.html",
      "rules": "accessibility.rules.json"
    }
  },
  "anatomy": {
    "set": "Native fieldset grouping.",
    "legend": "Native legend; source legend/label visual variants keep native semantics.",
    "group": "Actual named container-query layout scope.",
    "field": "Actual role=group and orientation-controlled layout.",
    "content": "Flexible control/help/error stack.",
    "description": "Native supporting paragraph.",
    "separator": "Relative separator/text composition.",
    "separator-text": "Actual conditional explanatory separator span.",
    "error": "Actual conditional role=alert; caller supplies readable content/IDs.",
    "label": "Actual native Label composition; htmlFor belongs to caller.",
    "title": "Actual div shares field-label slot; stable source class distinguishes it from the real Label.",
    "divider": "Actual composed Separator child with selected runtime data-orientation."
  },
  "stories": "stories.json",
  "ux": "ux.json",
  "composition": {
    "input": {
      "component": "../input/component.json"
    },
    "label": {
      "component": "../label/component.json"
    },
    "separator": {
      "component": "../separator/component.json"
    }
  },
  "convention": "semantic-component/1",
  "partBindings": {
    "set": {
      "kind": "element",
      "declaration": "FieldSet",
      "selector": "[data-slot=\"field-set\"]",
      "description": "Native fieldset grouping.",
      "ownership": "actual wrapper"
    },
    "legend": {
      "kind": "element",
      "declaration": "FieldLegend",
      "selector": "[data-slot=\"field-legend\"]",
      "description": "Native legend; source legend/label visual variants keep native semantics.",
      "ownership": "actual wrapper"
    },
    "group": {
      "kind": "element",
      "declaration": "FieldGroup",
      "selector": "[data-slot=\"field-group\"]",
      "description": "Actual named container-query layout scope.",
      "ownership": "actual wrapper"
    },
    "field": {
      "kind": "element",
      "declaration": "Field",
      "selector": "[data-slot=\"field\"]",
      "description": "Actual role=group and orientation-controlled layout.",
      "ownership": "actual wrapper"
    },
    "content": {
      "kind": "element",
      "declaration": "FieldContent",
      "selector": "[data-slot=\"field-content\"]",
      "description": "Flexible control/help/error stack.",
      "ownership": "actual wrapper"
    },
    "description": {
      "kind": "element",
      "declaration": "FieldDescription",
      "selector": "[data-slot=\"field-description\"]",
      "description": "Native supporting paragraph.",
      "ownership": "actual wrapper"
    },
    "separator": {
      "kind": "element",
      "declaration": "FieldSeparator",
      "selector": "[data-slot=\"field-separator\"]",
      "description": "Relative separator/text composition.",
      "ownership": "actual wrapper"
    },
    "separator-text": {
      "kind": "element",
      "declaration": "FieldSeparator",
      "selector": "[data-slot=\"field-separator-content\"]",
      "description": "Actual conditional explanatory separator span.",
      "ownership": "actual wrapper"
    },
    "error": {
      "kind": "element",
      "declaration": "FieldError",
      "selector": "[data-slot=\"field-error\"]",
      "description": "Actual conditional role=alert; caller supplies readable content/IDs.",
      "ownership": "actual wrapper"
    },
    "label": {
      "kind": "element",
      "declaration": "FieldLabel",
      "selector": "[data-slot=\"field-label\"].cn-field-label",
      "description": "Actual native Label composition; htmlFor belongs to caller."
    },
    "title": {
      "kind": "element",
      "declaration": "FieldTitle",
      "selector": "[data-slot=\"field-label\"].cn-field-title",
      "description": "Actual div shares field-label slot; stable source class distinguishes it from the real Label."
    },
    "divider": {
      "kind": "element",
      "declaration": "FieldSeparator",
      "selector": "[data-slot=\"field-separator\"] > [data-slot=\"separator\"]",
      "description": "Actual composed Separator child with selected runtime data-orientation.",
      "ownership": "composed Separator dependency"
    }
  },
  "visualContract": {
    "tokens": {
      "color-background": "semantic.color.background",
      "color-destructive": "semantic.color.destructive",
      "color-foreground": "semantic.color.foreground",
      "color-muted-foreground": "semantic.color.mutedForeground",
      "field-error-gap": "components.field.errorGap",
      "field-error-inset": "components.field.errorInset",
      "field-gap": "components.field.gap",
      "field-group-gap": "components.field.groupGap",
      "field-legend-line": "components.field.legendLine",
      "field-legend-size": "components.field.legendSize",
      "field-set-gap": "components.field.setGap",
      "font-fallback": "semantic.typography.fallbackFamily",
      "font-family": "semantic.typography.fontFamily",
      "font-size-body": "semantic.typography.bodySize",
      "font-weight-medium": "semantic.typography.mediumWeight",
      "font-weight-normal": "semantic.typography.normalWeight",
      "line-height-body": "semantic.typography.bodyLineHeight"
    },
    "runtimeProperties": {},
    "layoutPolicy": "Field maps the actual twelve semantic parts without conflating FieldTitle with FieldLabel: both emit data-slot=field-label, but only FieldLabel is a native label and their actual cn-field-title/cn-field-label classes distinguish identity. FieldSet/Legend retain native grouping. Browser evidence shows the native legend sits outside the fieldset anonymous flex content, so its native16px separation is applied explicitly as margin rather than relying on an ineffective container gap. Native field gap 8px, normal group gap 20px and set gap 16px remain independent semantic roles. Responsive layout follows source orientation classes and named container scope; 28rem is an explicit reference container threshold, not a static Figma measurement. Legend 16/24px, label 14/20px and readable error-list spacing are explicit reference typography/layout decisions where native instances are not expanded. FieldSeparator composes the actual Separator runtime data-orientation attribute. The caller owns native label/description/error IDs, input invalid/disabled state and validation. Source FieldError renders only meaningful children/errors, gives children precedence and deduplicates error messages; it does not create validation or IDs.",
    "variants": {
      "orientation": {
        "prop": "orientation",
        "attribute": "data-orientation",
        "values": [
          "vertical",
          "horizontal",
          "responsive"
        ]
      },
      "legend": {
        "declaration": "FieldLegend",
        "prop": "variant",
        "attribute": "data-variant",
        "values": [
          "legend",
          "label"
        ]
      }
    },
    "sourceTraceability": "figma/traceability.json"
  }
}
