{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://glass.spboucher.ai/registry/schema/theme.schema.json",
  "title": "SP GlassKit theme",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      "maxLength": 64
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "summary": {
      "type": "string",
      "maxLength": 500
    },
    "appearance": {
      "enum": [
        "system",
        "light",
        "dark"
      ]
    },
    "light": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "primary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "secondary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "accent": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "destructive": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "success": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "warning": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "background": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "surface": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "textPrimary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "textSecondary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "separator": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "focusRing": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        }
      },
      "description": "A role without a value follows the system colour."
    },
    "dark": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "primary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "secondary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "accent": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "destructive": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "success": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "warning": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "background": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "surface": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "textPrimary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "textSecondary": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "separator": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        },
        "focusRing": {
          "type": "string",
          "pattern": "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
        }
      },
      "description": "A role without a value follows the system colour."
    },
    "typography": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "design": {
          "enum": [
            "default",
            "rounded",
            "serif",
            "monospaced"
          ]
        },
        "headingWeight": {
          "enum": [
            "regular",
            "medium",
            "semibold",
            "bold"
          ]
        },
        "bodyWeight": {
          "enum": [
            "regular",
            "medium",
            "semibold",
            "bold"
          ]
        }
      }
    },
    "spacing": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "xxs": {
          "type": "number",
          "minimum": 0,
          "maximum": 128
        },
        "xs": {
          "type": "number",
          "minimum": 0,
          "maximum": 128
        },
        "sm": {
          "type": "number",
          "minimum": 0,
          "maximum": 128
        },
        "md": {
          "type": "number",
          "minimum": 0,
          "maximum": 128
        },
        "lg": {
          "type": "number",
          "minimum": 0,
          "maximum": 128
        },
        "xl": {
          "type": "number",
          "minimum": 0,
          "maximum": 128
        },
        "xxl": {
          "type": "number",
          "minimum": 0,
          "maximum": 128
        }
      }
    },
    "radii": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "small": {
          "type": "number",
          "minimum": 0,
          "maximum": 64
        },
        "medium": {
          "type": "number",
          "minimum": 0,
          "maximum": 64
        },
        "large": {
          "type": "number",
          "minimum": 0,
          "maximum": 64
        },
        "extraLarge": {
          "type": "number",
          "minimum": 0,
          "maximum": 64
        }
      }
    },
    "motion": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "style": {
          "enum": [
            "smooth",
            "snappy",
            "bouncy"
          ]
        },
        "fast": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        },
        "standard": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        },
        "slow": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        }
      }
    },
    "density": {
      "enum": [
        "compact",
        "regular",
        "comfortable"
      ]
    },
    "glass": {
      "type": "object",
      "additionalProperties": false,
      "description": "Only what the Liquid Glass API exposes: the variant and an optional tint role. Blur, refraction and opacity belong to the system.",
      "properties": {
        "variant": {
          "enum": [
            "regular",
            "clear"
          ]
        },
        "tint": {
          "enum": [
            "primary",
            "secondary",
            "accent",
            "destructive",
            "success",
            "warning",
            "background",
            "surface",
            "textPrimary",
            "textSecondary",
            "separator",
            "focusRing"
          ]
        }
      }
    },
    "hapticsEnabled": {
      "type": "boolean"
    }
  }
}
