{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "navigation",
  "status": "alpha",
  "import": "@senvenli/react/navigation",
  "name": "accordion",
  "title": "Accordion",
  "exports": [
    "Accordion",
    "Disclosure"
  ],
  "description": "Sections that expand and collapse; Disclosure is a single expandable section.",
  "keywords": [
    "accordion",
    "collapse",
    "compound",
    "disclosure",
    "expand",
    "faq"
  ],
  "usage": {
    "when": [
      "Long content people scan by heading, like an FAQ."
    ],
    "instead": [
      {
        "use": "tabs",
        "when": "Views are parallel and only one shows at a time."
      },
      {
        "use": "tree",
        "when": "The sections nest more than one level."
      }
    ]
  },
  "a11y": {
    "keyboard": [
      {
        "keys": "Enter, Space",
        "does": "Expands or collapses a section."
      }
    ],
    "builtIn": [
      "Each header is a button with aria-expanded inside a heading."
    ],
    "youProvide": [
      "A heading level that fits the page.",
      "With children: an id on every Disclosure inside an Accordion (expandedKeys uses it)."
    ]
  },
  "genui": {
    "expose": true,
    "description": "Expandable sections such as an FAQ. items are {id, title, content}.",
    "props": [
      "items",
      "allowsMultipleExpanded"
    ],
    "children": "none",
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "content": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "content"
            ]
          },
          "description": "FAQ entries, settings groups, long-form sections. Leave it out to compose `Disclosure`s as children instead."
        },
        "allowsMultipleExpanded": {
          "type": "boolean",
          "description": "Several open at once; by default opening one closes the others."
        }
      }
    }
  },
  "source": [
    "src/navigation/accordion.tsx"
  ],
  "props": {
    "Accordion": [
      {
        "name": "items",
        "type": "readonly AccordionItem[]",
        "required": false,
        "origin": "own",
        "description": "FAQ entries, settings groups, long-form sections. Leave it out to compose `Disclosure`s as children instead.",
        "schema": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "content": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "title",
              "content"
            ]
          }
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "With no `items`: `Disclosure`s, each with an `id` (the key `expandedKeys` uses)."
      },
      {
        "name": "expandedKeys",
        "type": "Iterable<Key>",
        "required": false,
        "origin": "own"
      },
      {
        "name": "defaultExpandedKeys",
        "type": "Iterable<Key>",
        "required": false,
        "origin": "own"
      },
      {
        "name": "onExpandedChange",
        "type": "(keys: Set<Key>) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "allowsMultipleExpanded",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "description": "Several open at once; by default opening one closes the others.",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "headingLevel",
        "type": "4 | 2 | 3 | 5 | 6",
        "required": false,
        "origin": "own",
        "schema": {
          "enum": [
            4,
            2,
            3,
            5,
            6
          ]
        }
      },
      {
        "name": "motion",
        "type": "ComponentMotion",
        "required": false,
        "origin": "own",
        "description": "`auto` (follow the device), `reduce` or `none`, for this component; the provider's setting otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "reduce"
          ]
        }
      }
    ],
    "Disclosure": [
      {
        "name": "title",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own",
        "description": "A full question or a clear section name (\"When is my deposit refunded?\")."
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own"
      },
      {
        "name": "isExpanded",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "defaultExpanded",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "onExpandedChange",
        "type": "(isExpanded: boolean) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "headingLevel",
        "type": "4 | 2 | 3 | 5 | 6",
        "required": false,
        "origin": "own",
        "description": "The heading level of the title in the page outline; the Accordion's, or 3 by default.",
        "schema": {
          "enum": [
            4,
            2,
            3,
            5,
            6
          ]
        }
      },
      {
        "name": "id",
        "type": "Key",
        "required": false,
        "origin": "own",
        "description": "Inside an Accordion: its key.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "motion",
        "type": "ComponentMotion",
        "required": false,
        "origin": "own",
        "description": "`auto` (follow the device), `reduce` or `none`, for this component; the provider's setting otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "reduce"
          ]
        }
      }
    ]
  },
  "tokens": [
    "ds-border",
    "ds-border-focused",
    "ds-easing-standard",
    "ds-icon-subtle",
    "ds-radius-small",
    "ds-space-150",
    "ds-space-200",
    "ds-text",
    "ds-text-subtle"
  ],
  "strings": [],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
