{
  "format": "ui-contract-component-draft",
  "id": "shadcn:InputOtp",
  "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": {
    "container": "Actual OTPInput containerClassName receives source cn-input-otp class; not six real inputs.",
    "input": "Single actual native input owns value, name, focus, paste and completion.",
    "group": "Decorative connected slots; group is aria-hidden in this usage.",
    "slot": "Actual context slot char/isActive, no per-slot textbox role.",
    "separator": "Actual source separator; caller aria-hidden because visual grouping is redundant.",
    "caret": "Actual private optional fake caret wrapper.",
    "caret-line": "Actual private optional fake caret line."
  },
  "stories": "stories.json",
  "ux": "ux.json",
  "convention": "semantic-component/1",
  "partBindings": {
    "container": {
      "kind": "element",
      "declaration": "InputOTP",
      "selector": ".cn-input-otp",
      "description": "Actual OTPInput containerClassName receives source cn-input-otp class; not six real inputs.",
      "ownership": "actual source wrapper"
    },
    "input": {
      "kind": "element",
      "declaration": "InputOTP",
      "selector": "input[data-slot=\"input-otp\"]",
      "description": "Single actual native input owns value, name, focus, paste and completion.",
      "ownership": "actual source wrapper"
    },
    "group": {
      "kind": "element",
      "declaration": "InputOTPGroup",
      "selector": "[data-slot=\"input-otp-group\"]",
      "description": "Decorative connected slots; group is aria-hidden in this usage.",
      "ownership": "actual source wrapper"
    },
    "slot": {
      "kind": "element",
      "declaration": "InputOTPSlot",
      "selector": "[data-slot=\"input-otp-slot\"]",
      "description": "Actual context slot char/isActive, no per-slot textbox role.",
      "ownership": "actual source wrapper"
    },
    "separator": {
      "kind": "element",
      "declaration": "InputOTPSeparator",
      "selector": "[data-slot=\"input-otp-separator\"]",
      "description": "Actual source separator; caller aria-hidden because visual grouping is redundant.",
      "ownership": "actual source wrapper"
    },
    "caret": {
      "kind": "element",
      "declaration": "InputOTPSlot",
      "selector": ".cn-input-otp-caret",
      "description": "Actual private optional fake caret wrapper.",
      "ownership": "actual source wrapper"
    },
    "caret-line": {
      "kind": "element",
      "declaration": "InputOTPSlot",
      "selector": ".cn-input-otp-caret-line",
      "description": "Actual private optional fake caret line.",
      "ownership": "actual source wrapper"
    }
  },
  "visualContract": {
    "tokens": {
      "border-width": "semantic.border.width",
      "color-background": "semantic.color.background",
      "color-border": "semantic.color.border",
      "color-destructive": "semantic.color.destructive",
      "color-foreground": "semantic.color.foreground",
      "color-ring": "semantic.color.ring",
      "focus-shadow": "semantic.focus.shadow",
      "focus-spread": "semantic.focus.spread",
      "font-fallback": "semantic.typography.fallbackFamily",
      "font-family": "semantic.typography.fontFamily",
      "font-size-body": "semantic.typography.bodySize",
      "input-otp-caret-height": "components.input-otp.caretHeight",
      "input-otp-caret-width": "components.input-otp.caretWidth",
      "input-otp-gap": "components.input-otp.gap",
      "input-otp-radius": "components.input-otp.radius",
      "input-otp-separator-width": "components.input-otp.separatorWidth",
      "input-otp-slot-size": "components.input-otp.slotSize",
      "line-height-body": "semantic.typography.bodyLineHeight"
    },
    "runtimeProperties": {},
    "layoutPolicy": "The native connected six-slot specimen supplies 36px square slots,10px external group corners,1px joined borders and 8px group gaps; separator 24px makes the three-plus-three composition 256px wide. Value text is a single real input-otp input, with decorative groups aria-hidden and redundant separator hidden. The source library owns its input overlay, selection/paste/caret logic; CSS keeps transparent native input above the visual slots without replacing it with six inputs. LTR code order is an explicit reference choice inside RTL hosts. Digit-only pattern, maxLength 6, pasteTransformer stripping spaces/hyphens, one-time-code completion and help/error wording are caller choices. Target sets documented pushPasswordManagerStrategy=none to avoid width expansion for this fixed six-slot recipe; no claim about external password manager support. The source optional caret uses a static visible line in this no-motion reference, rather than inventing focus state or animation from Figma. Disabled opacity and real native disabled/cursor behavior remain source-specific. Readable error text accompanies invalid slot borders; native label/help/error relationships remain on the one input.",
    "variants": {
      "codePolicy": {
        "callerProps": [
          "maxLength",
          "pattern",
          "pasteTransformer",
          "pushPasswordManagerStrategy"
        ]
      },
      "active": {
        "source": "InputOTPContext.slots[index].isActive",
        "attribute": "data-active"
      },
      "disabled": {
        "prop": "disabled"
      },
      "invalid": {
        "nativeAttribute": "aria-invalid"
      }
    },
    "sourceTraceability": "figma/traceability.json"
  }
}
