{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:web-component-contract:example:status-card",
  "profile": "web-component-contract/schema",
  "profileVersion": 1,
  "title": "Contract status card",
  "description": "A parameterized status card from the maintained example design system.",
  "type": "object",
  "tagName": "contract-status-card",
  "properties": {
    "attributes": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": ["ready", "watch", "blocked"],
          "default": "ready"
        },
        "compact": {
          "type": "boolean",
          "default": false
        }
      },
      "required": ["status"],
      "additionalProperties": false
    },
    "properties": {
      "type": "object",
      "properties": {
        "metric": {
          "type": "object",
          "properties": {
            "label": { "type": "string" },
            "value": { "type": "number" }
          },
          "required": ["label", "value"],
          "additionalProperties": false,
          "default": { "label": "Requests", "value": 42 }
        }
      },
      "required": ["metric"],
      "additionalProperties": false
    },
    "events": {
      "type": "object",
      "properties": {
        "activate": {
          "type": "object",
          "description": "Emitted when the slotted action activates.",
          "properties": {},
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "slots": {
      "type": "object",
      "properties": {
        "default": {
          "type": "string",
          "default": "The service is operating within its declared limits."
        },
        "action": {
          "$ref": "#/$defs/slotNode",
          "default": {
            "tag": "button",
            "text": "Inspect",
            "attrs": { "type": "button" }
          }
        }
      },
      "required": ["default"],
      "additionalProperties": false
    },
    "cssProperties": {
      "type": "object",
      "properties": {
        "--accent": {
          "type": "string",
          "enum": ["#58d6c7", "#f0b35a", "#df6f76"],
          "default": "#58d6c7"
        }
      },
      "additionalProperties": false
    },
    "cssParts": {
      "type": "object",
      "properties": {
        "card": {
          "type": "string",
          "description": "The complete card surface."
        }
      },
      "additionalProperties": false
    }
  },
  "$defs": {
    "slotNode": {
      "type": "object",
      "properties": {
        "tag": { "type": "string" },
        "text": { "type": "string" },
        "attrs": {
          "type": "object",
          "additionalProperties": {
            "type": ["string", "number", "boolean", "null"]
          }
        },
        "children": {
          "type": "array",
          "items": {
            "oneOf": [
              { "type": "string" },
              { "$ref": "#/$defs/slotNode" }
            ]
          }
        }
      },
      "required": ["tag"],
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
