{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "form",
  "status": "alpha",
  "import": "@senvenli/react/form",
  "name": "field",
  "title": "Field",
  "exports": [
    "Field",
    "FieldLabel",
    "FieldDescription",
    "FieldError"
  ],
  "description": "A label, hint and error row around any control, wired for screen readers; plus the label, description and error parts.",
  "keywords": [
    "field",
    "label",
    "hint",
    "error",
    "wrapper"
  ],
  "usage": {
    "when": [
      "Wrapping a control the library does not provide, so it matches the other fields."
    ],
    "instead": [
      {
        "use": "input",
        "when": "A text input is enough; it has the field row built in."
      }
    ]
  },
  "a11y": {
    "builtIn": [
      "Label, hint and error are linked to the control with htmlFor, aria-describedby and aria-invalid."
    ],
    "youProvide": [
      "A control with a matching `id`, or a single child Field can give one to."
    ]
  },
  "related": [
    "input",
    "form"
  ],
  "genui": {
    "expose": false
  },
  "source": [
    "src/form/field-parts.tsx",
    "src/form/field.tsx"
  ],
  "props": {
    "Field": [
      {
        "name": "label",
        "type": "ReactNode",
        "required": false,
        "origin": "own"
      },
      {
        "name": "htmlFor",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Control id for the label. Optional: when omitted, Field generates one and\ninjects it onto a single-element child. Field is for a control the library does not\nprovide (a native input, a third-party widget) and for `InputGroup` with `InputGroupInput`,\nwhich forwards it to its input. The library's own fields (TextField, Select…) carry their\nown label, hint and error, so they do not go inside a Field.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "errorMessage",
        "type": "ReactNode",
        "required": false,
        "origin": "own",
        "description": "What went wrong and what to do; shown under the control and announced."
      },
      {
        "name": "description",
        "type": "ReactNode",
        "required": false,
        "origin": "own",
        "description": "A line of help under the control (hidden while there is an error)."
      },
      {
        "name": "isRequired",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "requiredClassName",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Class for the required \"*\" asterisk. Defaults to the danger text token; a brand\nmarketing form can override it without forking this component.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "children",
        "type": "ReactNode",
        "required": true,
        "origin": "own"
      },
      {
        "name": "className",
        "type": "string",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      }
    ],
    "FieldLabel": [
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own"
      },
      {
        "name": "isRequired",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "description": "Shows `*` in `ds-text-danger` (hidden from screen readers: the control is `aria-required`).",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "isOptional",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "description": "Shows \"(optional)\" in the provider locale; use it when most fields of the form are required.",
        "schema": {
          "type": "boolean"
        }
      }
    ],
    "FieldDescription": [
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own"
      }
    ],
    "FieldError": [
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own"
      }
    ]
  },
  "tokens": [
    "ds-background-disabled",
    "ds-background-input",
    "ds-background-input-hovered",
    "ds-background-neutral-pressed",
    "ds-background-neutral-subtle-hovered",
    "ds-border",
    "ds-border-bold",
    "ds-border-danger",
    "ds-border-focused",
    "ds-easing-standard",
    "ds-icon-subtle",
    "ds-radius-control-medium",
    "ds-radius-medium",
    "ds-radius-small",
    "ds-size-control",
    "ds-size-control-compact",
    "ds-size-control-large",
    "ds-size-icon",
    "ds-space-050",
    "ds-space-075",
    "ds-space-100",
    "ds-space-150",
    "ds-space-200",
    "ds-surface-sunken",
    "ds-text",
    "ds-text-danger",
    "ds-text-disabled",
    "ds-text-subtle",
    "ds-text-subtlest"
  ],
  "strings": [
    "optional"
  ],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
