{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Xerobi registry",
  "type": "object",
  "required": [
    "name",
    "version",
    "platforms",
    "components",
    "blocks"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "platforms": {
      "type": "array",
      "items": {
        "enum": [
          "web",
          "reactNative",
          "flutter"
        ]
      }
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "title",
          "category",
          "description",
          "platforms"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "platforms": {
            "type": "object",
            "properties": {
              "web": {
                "type": "object",
                "required": [
                  "package",
                  "import",
                  "exports",
                  "variants",
                  "slots",
                  "examples"
                ],
                "properties": {
                  "package": {
                    "type": "string"
                  },
                  "import": {
                    "type": "string"
                  },
                  "barrel": {
                    "type": "string"
                  },
                  "client": {
                    "type": "boolean"
                  },
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "variants": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "exports": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "kind"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "kind": {
                          "enum": [
                            "component",
                            "hook",
                            "function"
                          ]
                        },
                        "description": {
                          "type": "string"
                        },
                        "extends": {
                          "type": "string"
                        },
                        "props": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "type",
                              "required"
                            ],
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "required": {
                                "type": "boolean"
                              },
                              "description": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "examples": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "title",
                        "code"
                      ],
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              "reactNative": {
                "type": "object"
              },
              "flutter": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "title",
          "description",
          "platforms"
        ]
      }
    }
  }
}
