{
  "$schema": "https://schemas.wp.org/trunk/block.json",
  "apiVersion": 3,
  "name": "formello/select",
  "title": "Select",
  "ancestor": [
    "formello/form"
  ],
  "usesContext": [
    "formello/requiredText"
  ],
  "description": "Dropdown select.",
  "category": "formello",
  "textdomain": "formello",
  "attributes": {
    "id": {
      "type": "string",
      "source": "attribute",
      "selector": "select",
      "attribute": "id"
    },
    "name": {
      "type": "string",
      "source": "attribute",
      "selector": "select",
      "attribute": "name",
      "default": ""
    },
    "label": {
      "type": "string",
      "source": "html",
      "selector": "label span:not(.required)",
      "default": "My input"
    },
    "hideLabel": {
      "type": "boolean",
      "selector": "label.hide",
      "default": false
    },
    "options": {
      "type": "array",
      "source": "query",
      "selector": "option",
      "query": {
        "value": {
          "type": "string",
          "source": "attribute",
          "attribute": "value"
        },
        "label": {
          "type": "string",
          "source": "text"
        },
        "selected": {
          "type": "boolean",
          "source": "attribute",
          "attribute": "selected"
        }
      },
      "default": [
        {
          "value": "",
          "label": "Select an option"
        },
        {
          "value": "1",
          "label": "One"
        },
        {
          "value": "2",
          "label": "Two"
        },
        {
          "value": "3",
          "label": "Three"
        }
      ]
    },
    "multiple": {
      "type": "boolean",
      "source": "attribute",
      "selector": "select",
      "attribute": "multiple"
    },
    "required": {
      "type": "boolean",
      "source": "attribute",
      "selector": "select",
      "attribute": "required"
    },
    "requiredText": {
      "type": "string",
      "source": "text",
      "selector": "label span.required",
      "default": "*"
    },
    "disabled": {
      "type": "boolean",
      "source": "attribute",
      "selector": "select",
      "attribute": "disabled"
    },
    "readonly": {
      "type": "boolean",
      "source": "attribute",
      "selector": "select",
      "attribute": "readonly"
    },
    "showHelp": {
      "type": "boolean",
      "default": false
    },
    "help": {
      "type": "string",
      "source": "html",
      "selector": "small",
      "default": ""
    },
    "advanced": {
      "type": "boolean"
    }
  },
  "supports": {
    "html": false,
    "reusable": false,
    "color": {
      "background": true,
      "text": true,
      "__experimentalSkipSerialization": true
    },
    "spacing": {
      "padding": true,
      "__experimentalSkipSerialization": true
    },
    "__experimentalBorder": {
      "color": true,
      "radius": true,
      "style": true,
      "width": true,
      "__experimentalSkipSerialization": true,
      "__experimentalDefaultControls": {
        "color": true,
        "radius": true,
        "style": true,
        "width": true
      }
    }
  },
  "selectors": {
    "root": ".wp-block-formello-select",
    "color": {
      "background": ".wp-block-formello-select > select",
      "text": ".wp-block-formello-select"
    },
    "spacing": {
      "root": ".wp-block-formello-select",
      "padding": ".wp-block-formello-select > select"
    },
    "border": {
      "root": ".wp-block-formello-select > select"
    }
  },
  "example": {
    "attributes": {
      "label": "Your OS",
      "options": [
        {
          "label": "Windows"
        },
        {
          "label": "MacOS"
        },
        {
          "label": "Linux"
        }
      ]
    }
  },
  "style": "file:./style-index.css",
  "editorScript": "file:./index.js",
  "render": "file:./render.php"
}