{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://schema.mydesignsystem.com/cms/search.schema.json",
  "title": "Search",
  "type": "object",
  "properties": {
    "headline": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "http://schema.mydesignsystem.com/headline.schema.json",
      "title": "Headline",
      "description": "Component used for headlines",
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "title": "Text",
          "description": "Text content of headline",
          "format": "markdown"
        },
        "sub": {
          "type": "string",
          "title": "Sub",
          "description": "Subheadline content",
          "format": "markdown"
        },
        "switchOrder": {
          "type": "boolean",
          "title": "Switch order?",
          "description": "Switch order of headline and subheadline",
          "default": false
        },
        "align": {
          "type": "string",
          "title": "Section alignment",
          "enum": [
            "left",
            "center",
            "right"
          ]
        },
        "level": {
          "type": "string",
          "title": "Level",
          "description": "Level of headline to use",
          "enum": [
            "h1",
            "h2",
            "h3",
            "h4",
            "p"
          ],
          "default": "h2"
        },
        "style": {
          "type": "string",
          "title": "Style",
          "description": "Style of headline to show",
          "enum": [
            "h1",
            "h2",
            "h3",
            "h4",
            "p"
          ],
          "default": "h2"
        },
        "spaceAfter": {
          "type": "string",
          "title": "Space after?",
          "description": "Whether to display space after headline",
          "enum": [
            "minimum",
            "small",
            "large"
          ],
          "default": "small"
        },
        "className": {
          "type": "string",
          "title": "Class Name",
          "description": "Set a custom class name"
        },
        "id": {
          "type": "string",
          "title": "ID",
          "description": "Set a custom id attribute"
        }
      },
      "additionalProperties": false,
      "required": [
        "level",
        "text"
      ]
    },
    "searchBar": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "http://schema.mydesignsystem.com/search-bar.schema.json",
      "title": "Search Bar",
      "description": "Search bar component for user input and search functionality.",
      "type": "object",
      "properties": {
        "placeholder": {
          "title": "Placeholder",
          "type": "string",
          "description": "Placeholder text for the search input field.",
          "examples": [
            "Search..."
          ]
        },
        "buttonText": {
          "type": "string",
          "description": "Text displayed on the search button.",
          "examples": [
            "Search"
          ]
        },
        "hint": {
          "type": "string",
          "description": "Additional information or instructions related to the search functionality.",
          "examples": [
            "Press <kbd>Enter</kbd> to search"
          ]
        },
        "alternativeText": {
          "type": "string",
          "description": "Text to display when offering alternative results.",
          "examples": [
            "Did you mean"
          ]
        },
        "alternativeResult": {
          "type": "string",
          "description": "The alternative result to display when offering suggestions.",
          "examples": [
            "AI Conference"
          ]
        }
      },
      "additionalProperties": false
    },
    "searchFilter": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "http://schema.mydesignsystem.com/search-filter.schema.json",
      "title": "Search Filter",
      "description": "Search filter component for filtering search results by categories.",
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "The title of the search filter.",
          "examples": [
            "Search by category"
          ]
        },
        "categories": {
          "type": "array",
          "description": "The categories to filter by.",
          "examples": [
            [
              {
                "title": "Pages",
                "amount": "10"
              },
              {
                "title": "News",
                "amount": "5"
              },
              {
                "title": "Blog Posts",
                "amount": "8"
              }
            ]
          ],
          "items": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "The name of the category.",
                "examples": [
                  "Pages",
                  "News"
                ]
              },
              "amount": {
                "type": "string",
                "description": "The number of items in the category.",
                "examples": [
                  "10",
                  "5"
                ]
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "The URL to filter by this category.",
                "examples": [
                  "#"
                ]
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "searchResults": {
      "type": "array",
      "items": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "$id": "http://schema.mydesignsystem.com/search-result.schema.json",
        "title": "Search Result",
        "description": "Search result component for displaying individual search results.",
        "type": "object",
        "properties": {
          "url": {
            "title": "URL",
            "type": "string",
            "description": "A URL linking to the search result or more information.",
            "examples": [
              "https://www.example.com/ai-conference-2023"
            ]
          },
          "title": {
            "title": "Title",
            "type": "string",
            "description": "The title of the search result.",
            "examples": [
              "AI Conference 2023"
            ]
          },
          "imageColSize": {
            "title": "Image Row Size",
            "type": "string",
            "description": "The reserved space of the image row.",
            "default": "small",
            "enum": [
              "none",
              "small",
              "large"
            ]
          },
          "previewImage": {
            "title": "Preview Image",
            "type": "string",
            "description": "A URL to an image preview for the search result."
          },
          "initialMatch": {
            "title": "Initial Match",
            "type": "string",
            "description": "The initial search match or summary of the search result."
          },
          "matches": {
            "title": "Matches",
            "type": "array",
            "description": "An array of search matches.",
            "items": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "$id": "http://schema.mydesignsystem.com/search-result-match.schema.json",
              "title": "Search Result Match",
              "type": "object",
              "properties": {
                "title": {
                  "title": "Title",
                  "type": "string",
                  "description": "The title of the match.",
                  "examples": [
                    "Panel Discussion: Ethics in AI"
                  ]
                },
                "snippet": {
                  "title": "Text",
                  "type": "string",
                  "description": "The main content or description of the search result.",
                  "examples": [
                    "Experts debate the ethical challenges and responsibilities of deploying AI technologies."
                  ]
                },
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "A URL linking to the specific match or more information.",
                  "examples": [
                    "https://www.example.com/ai-conference-2023/panel-discussion"
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "showLink": {
            "title": "Show Link",
            "type": "boolean",
            "description": "Whether to display the link to the search result.",
            "default": true
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}