{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Blora Component Contract",
  "description": "Machine-readable contract for Blora Design 2.0 components",
  "type": "object",
  "required": ["name", "status", "kind", "since", "category"],
  "properties": {
    "name": {
      "type": "string",
      "description": "Component name in kebab-case"
    },
    "category": {
      "type": "string",
      "enum": [
        "actions",
        "data-display",
        "navigation",
        "feedback",
        "data-input",
        "layout",
        "mockup"
      ],
      "description": "Catalog category aligned with industry (daisyUI-style) grouping"
    },
    "status": {
      "type": "string",
      "enum": ["experimental", "beta", "stable", "deprecated"]
    },
    "kind": {
      "type": "string",
      "enum": ["native", "custom-element", "css-only", "headless", "service"]
    },
    "tagName": {
      "type": "string",
      "pattern": "^blora-[a-z0-9-]+$"
    },
    "since": {
      "type": "string",
      "description": "Version when this API was introduced"
    },
    "requiresJavaScript": {
      "type": "boolean"
    },
    "formAssociated": {
      "type": "boolean"
    },
    "accessibilityNotes": {
      "type": "string"
    },
    "attributes": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "type": { "type": "string" },
          "default": {},
          "reflects": { "type": "boolean" }
        },
        "required": ["type"]
      }
    },
    "properties": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "type": { "type": "string" },
          "readonly": { "type": "boolean" }
        },
        "required": ["type"]
      }
    },
    "methods": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "parameters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "type": { "type": "string" }
              },
              "required": ["name", "type"]
            }
          },
          "returns": { "type": "string" }
        },
        "required": ["returns"]
      }
    },
    "events": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "detail": { "type": "string" },
          "bubbles": { "type": "boolean" },
          "composed": { "type": "boolean" },
          "cancelable": { "type": "boolean" },
          "native": { "type": "boolean" }
        }
      }
    },
    "slots": {
      "type": "object",
      "additionalProperties": { "type": "string" }
    },
    "parts": {
      "type": "array",
      "items": { "type": "string" }
    },
    "cssProperties": {
      "type": "array",
      "items": { "type": "string" }
    },
    "accessibilityPattern": {
      "type": "string",
      "description": "WAI-ARIA APG pattern name"
    }
  }
}
