{
  "$schema": "https://schemas.wp.org/trunk/block.json",
  "apiVersion": 3,
  "name": "designsetgo/accordion",
  "version": "1.0.0",
  "title": "Accordion",
  "category": "designsetgo",
  "description": "Create accessible accordion sections with customizable icons and behavior for FAQs and content organization.",
  "keywords": [
    "accordion",
    "faq",
    "collapsible",
    "toggle",
    "expand"
  ],
  "textdomain": "designsetgo",
  "icon": "menu-alt",
  "attributes": {
    "allowMultipleOpen": {
      "type": "boolean",
      "default": false
    },
    "iconStyle": {
      "type": "string",
      "default": "chevron",
      "enum": [
        "chevron",
        "plus-minus",
        "caret",
        "none"
      ]
    },
    "iconPosition": {
      "type": "string",
      "default": "right",
      "enum": [
        "left",
        "right"
      ]
    },
    "borderBetween": {
      "type": "boolean",
      "default": true
    },
    "borderBetweenColor": {
      "type": "string",
      "default": ""
    },
    "itemGap": {
      "type": "string",
      "default": "0.5rem"
    },
    "openBackgroundColor": {
      "type": "string",
      "default": ""
    },
    "openTextColor": {
      "type": "string",
      "default": ""
    },
    "hoverBackgroundColor": {
      "type": "string",
      "default": ""
    },
    "hoverTextColor": {
      "type": "string",
      "default": ""
    }
  },
  "schemaMetadata": {
    "attributeDescriptions": {
      "allowMultipleOpen": "Allow multiple accordion items to be expanded simultaneously",
      "iconStyle": "Visual style for the expand/collapse indicator icon",
      "iconPosition": "Position of the expand/collapse icon relative to the title",
      "borderBetween": "Show a horizontal border between accordion items",
      "borderBetweenColor": "Color of the border between accordion items",
      "itemGap": "Vertical spacing between accordion items (CSS value)",
      "openBackgroundColor": "Background color for expanded accordion items",
      "openTextColor": "Text color for expanded accordion items",
      "hoverBackgroundColor": "Background color when hovering over an accordion item",
      "hoverTextColor": "Text color when hovering over an accordion item"
    },
    "htmlMappings": {
      "dataAttributes": {
        "allowMultipleOpen": "allow-multiple",
        "iconStyle": "icon-style"
      },
      "cssModifiers": {
        "allowMultipleOpen": {
          "true": "dsgo-accordion--multiple",
          "false": ""
        },
        "iconPosition": "dsgo-accordion--icon-{value}",
        "borderBetween": {
          "true": "dsgo-accordion--border-between",
          "false": ""
        }
      },
      "cssVariables": {
        "itemGap": "--dsgo-accordion-gap",
        "openBackgroundColor": "--dsgo-accordion-open-bg",
        "openTextColor": "--dsgo-accordion-open-text",
        "hoverBackgroundColor": "--dsgo-accordion-hover-bg",
        "hoverTextColor": "--dsgo-accordion-hover-text"
      }
    }
  },
  "providesContext": {
    "designsetgo/accordion/allowMultipleOpen": "allowMultipleOpen",
    "designsetgo/accordion/iconStyle": "iconStyle",
    "designsetgo/accordion/iconPosition": "iconPosition",
    "designsetgo/accordion/borderBetweenColor": "borderBetweenColor",
    "designsetgo/accordion/openBackgroundColor": "openBackgroundColor",
    "designsetgo/accordion/openTextColor": "openTextColor",
    "designsetgo/accordion/hoverBackgroundColor": "hoverBackgroundColor",
    "designsetgo/accordion/hoverTextColor": "hoverTextColor"
  },
  "supports": {
    "anchor": true,
    "align": [
      "wide",
      "full"
    ],
    "html": false,
    "inserter": true,
    "spacing": {
      "margin": true,
      "padding": true,
      "blockGap": true,
      "__experimentalDefaultControls": {
        "padding": true,
        "blockGap": true
      }
    },
    "color": {
      "background": true,
      "text": true,
      "link": true,
      "__experimentalDefaultControls": {
        "background": true,
        "text": true
      }
    },
    "typography": {
      "fontSize": true,
      "lineHeight": true,
      "__experimentalDefaultControls": {
        "fontSize": true,
        "lineHeight": true,
        "fontWeight": true
      },
      "__experimentalFontFamily": true,
      "__experimentalFontWeight": true
    },
    "__experimentalBorder": {
      "color": true,
      "radius": true,
      "style": true,
      "width": true,
      "__experimentalDefaultControls": {
        "color": true,
        "radius": true,
        "style": true,
        "width": true
      }
    }
  },
  "example": {
    "attributes": {
      "allowMultipleOpen": false
    },
    "innerBlocks": [
      {
        "name": "designsetgo/accordion-item",
        "attributes": {
          "title": "What is an accordion?",
          "isOpen": true
        },
        "innerBlocks": [
          {
            "name": "core/paragraph",
            "attributes": {
              "content": "An accordion is a vertically stacked list of items that can be expanded or collapsed to show or hide content."
            }
          }
        ]
      },
      {
        "name": "designsetgo/accordion-item",
        "attributes": {
          "title": "How do I use this block?",
          "isOpen": false
        },
        "innerBlocks": [
          {
            "name": "core/paragraph",
            "attributes": {
              "content": "Add accordion items and customize the title. You can add any content inside each item using the block editor."
            }
          }
        ]
      }
    ]
  },
  "viewScript": "file:./view.js",
  "editorScript": "file:./index.js",
  "editorStyle": "file:./index.css",
  "style": "file:./index.css"
}