{
  "$schema": "https://next.0build.dev/schema/component.v1.json",
  "accessibility": {
    "aria": [],
    "notes": [
      "Triggers receive `aria-expanded` and `aria-controls`; panels receive `role=\"region\"` and `aria-labelledby` unless they are lists or already carry a role.",
      "With `no-collapsible`, the last open trigger is marked `aria-disabled` because it cannot be closed."
    ]
  },
  "attributes": [
    {
      "default": "false",
      "description": "Allows several panels to stay open at once; otherwise opening one closes the others.",
      "from": null,
      "name": "multiple",
      "property": "multiple",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "false",
      "description": "Keeps at least one panel open: the last open panel cannot be closed, and the first enabled panel opens automatically.",
      "from": null,
      "name": "no-collapsible",
      "property": "no-collapsible",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": null,
      "description": "Open panels as a comma- or space-separated list of indices, values, or ids; `-1` closes all. Kept in sync with the open state.",
      "from": null,
      "name": "active",
      "property": "active",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "150",
      "description": "Panel transition duration in milliseconds; `0` disables animation.",
      "from": null,
      "name": "duration",
      "property": "duration",
      "reflect": false,
      "tokens": null,
      "type": "number",
      "values": null
    },
    {
      "default": "false",
      "description": "Skips panel transitions entirely, showing and hiding content instantly.",
      "from": null,
      "name": "no-animation",
      "property": "no-animation",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "''",
      "description": "CSS selector for item elements within the container, replacing the default item detection.",
      "from": null,
      "name": "targets",
      "property": "targets",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "CSS selector for the clickable trigger within each item, replacing `.z-accordion-title` detection.",
      "from": null,
      "name": "trigger",
      "property": "trigger",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "CSS selector for the collapsible panel within each item, replacing `.z-accordion-content` detection.",
      "from": null,
      "name": "content",
      "property": "content",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Adds classes to named parts as `key: classes` pairs; a plain string targets the default part.",
      "from": "Base",
      "name": "cls",
      "property": "cls",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Adds inline styles to named parts as `key: styles` pairs; a plain string targets the default part.",
      "from": "Base",
      "name": "stl",
      "property": "stl",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    }
  ],
  "category": "layout",
  "children": [],
  "cssClasses": [
    {
      "appliesTo": "z-accordion",
      "class": ".z-accordion",
      "description": "Root list container.",
      "role": "root"
    },
    {
      "appliesTo": ".z-accordion",
      "class": ".z-accordion-content",
      "description": "Collapsible panel associated with a trigger.",
      "role": "element"
    },
    {
      "appliesTo": ".z-accordion",
      "class": ".z-accordion-icon",
      "description": "Indicator icon in the trigger, styled to reflect the open state.",
      "role": "element"
    },
    {
      "appliesTo": ".z-accordion",
      "class": ".z-accordion-title",
      "description": "Clickable trigger that toggles its panel.",
      "role": "element"
    },
    {
      "appliesTo": ".z-accordion",
      "class": ".z-open",
      "description": "State class on open items.",
      "role": "state"
    }
  ],
  "cssVars": [
    {
      "affects": [
        "border-color"
      ],
      "default": "var(--z-border)",
      "description": "Border color of the accordion items.",
      "file": "src/css/kit-components/accordion.css",
      "kind": "base",
      "name": "--z-accordion-border",
      "scope": ".z-accordion",
      "syntax": "<color>"
    },
    {
      "affects": [
        "border-color"
      ],
      "default": "var(--z-border-o)",
      "description": "Opacity applied to the item border color.",
      "file": "src/css/kit-components/accordion.css",
      "kind": "base",
      "name": "--z-accordion-border-o",
      "scope": ".z-accordion",
      "syntax": "<percentage>"
    },
    {
      "affects": [
        "border-style"
      ],
      "default": "solid",
      "description": "Border style of each item.",
      "file": "src/css/kit-components/accordion.css",
      "kind": "hook",
      "name": "--z-accordion-border-style",
      "scope": ".z-accordion > li, .z-accordion > div",
      "syntax": "<line-style>"
    },
    {
      "affects": [
        "border-width"
      ],
      "default": "0 0 1px 0",
      "description": "Border widths per side of each item; the default draws only a bottom hairline.",
      "file": "src/css/kit-components/accordion.css",
      "kind": "hook",
      "name": "--z-accordion-border-w",
      "scope": ".z-accordion > li, .z-accordion > div",
      "syntax": "<length>"
    },
    {
      "affects": [
        "transition"
      ],
      "default": "150ms cubic-bezier(0.16, 1, 0.3, 1)",
      "description": "Transition timing used for the accordion's animated state changes.",
      "file": "src/css/kit-components/accordion.css",
      "kind": "base",
      "name": "--z-accordion-transition",
      "scope": ".z-accordion",
      "syntax": ""
    },
    {
      "affects": [
        "opacity"
      ],
      "default": "0.5",
      "description": "Opacity of disabled triggers.",
      "file": "src/css/kit-components/accordion.css",
      "kind": "hook",
      "name": "--z-disabled-opacity",
      "scope": ".z-accordion > .z-disabled > .z-accordion-title, .z-accordion-title.z-disabled, .z-accordion-title:disabled",
      "syntax": "<percentage>"
    }
  ],
  "dataHooks": [
    {
      "appliesTo": "descendant",
      "attribute": "data-accordion-ignore",
      "description": "Excludes the element from item detection.",
      "role": "config",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-accordion-item",
      "description": "Turns the element into an accordion control: `open-all`, `close-all`, `next`, `previous`, or a target index, value, or id to toggle.",
      "role": "trigger",
      "values": [
        "close-all",
        "next",
        "open-all",
        "previous"
      ]
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-fn",
      "description": "Marks a deferred `<template>` child whose content is mounted into the container on demand.",
      "from": "Controller",
      "role": "config",
      "values": [
        "template"
      ]
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-part",
      "description": "Marks the list container (`list`) when the host itself is not the accordion list.",
      "role": "marker",
      "values": [
        "list"
      ]
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-value",
      "description": "Identifies the item for `active` and toggle targets; falls back to the item id or index.",
      "role": "read-only",
      "values": []
    }
  ],
  "events": [
    {
      "bubbles": true,
      "cancelable": true,
      "description": "Fires before a panel closes; `preventDefault()` cancels the change.",
      "detail": {
        "fields": [
          {
            "name": "index",
            "type": "number"
          },
          {
            "name": "item",
            "type": "HTMLElement"
          },
          {
            "name": "trigger",
            "type": "HTMLElement"
          },
          {
            "name": "content",
            "type": "HTMLElement"
          },
          {
            "name": "value",
            "type": "string"
          }
        ],
        "type": "{ index: number; item: HTMLElement; trigger: HTMLElement; content: HTMLElement; value: string }"
      },
      "name": "z-accordion:before-hide"
    },
    {
      "bubbles": true,
      "cancelable": true,
      "description": "Fires before a panel opens; `preventDefault()` cancels the change.",
      "detail": {
        "fields": [
          {
            "name": "index",
            "type": "number"
          },
          {
            "name": "item",
            "type": "HTMLElement"
          },
          {
            "name": "trigger",
            "type": "HTMLElement"
          },
          {
            "name": "content",
            "type": "HTMLElement"
          },
          {
            "name": "value",
            "type": "string"
          }
        ],
        "type": "{ index: number; item: HTMLElement; trigger: HTMLElement; content: HTMLElement; value: string }"
      },
      "name": "z-accordion:before-show"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires after any open-state change; detail carries the active indices and the primarily affected item.",
      "detail": {
        "fields": [
          {
            "name": "activeIndices",
            "type": "number[]"
          },
          {
            "name": "index",
            "type": "number"
          },
          {
            "name": "open",
            "type": "boolean"
          },
          {
            "name": "item",
            "type": "HTMLElement | null"
          },
          {
            "name": "trigger",
            "type": "HTMLElement | null"
          },
          {
            "name": "content",
            "type": "HTMLElement | null"
          },
          {
            "name": "value",
            "type": "string | null"
          }
        ],
        "type": "{ activeIndices: number[]; index: number; open: boolean; item: HTMLElement | null; trigger: HTMLElement | null; content: HTMLElement | null; value: string | null }"
      },
      "name": "z-accordion:change"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires after a panel's close transition completes.",
      "detail": {
        "fields": [
          {
            "name": "index",
            "type": "number"
          },
          {
            "name": "item",
            "type": "HTMLElement"
          },
          {
            "name": "trigger",
            "type": "HTMLElement"
          },
          {
            "name": "content",
            "type": "HTMLElement"
          },
          {
            "name": "value",
            "type": "string"
          }
        ],
        "type": "{ index: number; item: HTMLElement; trigger: HTMLElement; content: HTMLElement; value: string }"
      },
      "name": "z-accordion:hidden"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when a panel starts closing.",
      "detail": {
        "fields": [
          {
            "name": "index",
            "type": "number"
          },
          {
            "name": "item",
            "type": "HTMLElement"
          },
          {
            "name": "trigger",
            "type": "HTMLElement"
          },
          {
            "name": "content",
            "type": "HTMLElement"
          },
          {
            "name": "value",
            "type": "string"
          }
        ],
        "type": "{ index: number; item: HTMLElement; trigger: HTMLElement; content: HTMLElement; value: string }"
      },
      "name": "z-accordion:hide"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when deferred template content is mounted into the container.",
      "detail": {
        "fields": [],
        "type": "Record<string, unknown>"
      },
      "from": "Controller",
      "name": "z-accordion:mount"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when a panel starts opening.",
      "detail": {
        "fields": [
          {
            "name": "index",
            "type": "number"
          },
          {
            "name": "item",
            "type": "HTMLElement"
          },
          {
            "name": "trigger",
            "type": "HTMLElement"
          },
          {
            "name": "content",
            "type": "HTMLElement"
          },
          {
            "name": "value",
            "type": "string"
          }
        ],
        "type": "{ index: number; item: HTMLElement; trigger: HTMLElement; content: HTMLElement; value: string }"
      },
      "name": "z-accordion:show"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires after a panel's open transition completes.",
      "detail": {
        "fields": [
          {
            "name": "index",
            "type": "number"
          },
          {
            "name": "item",
            "type": "HTMLElement"
          },
          {
            "name": "trigger",
            "type": "HTMLElement"
          },
          {
            "name": "content",
            "type": "HTMLElement"
          },
          {
            "name": "value",
            "type": "string"
          }
        ],
        "type": "{ index: number; item: HTMLElement; trigger: HTMLElement; content: HTMLElement; value: string }"
      },
      "name": "z-accordion:shown"
    }
  ],
  "i18n": [],
  "icons": [],
  "id": "accordion",
  "inherits": [
    "Controller",
    "Base"
  ],
  "keyboard": [
    {
      "action": "Move focus to the next / previous enabled trigger, wrapping at the ends.",
      "keys": [
        "ArrowDown",
        "ArrowUp"
      ],
      "when": "Focus is on a trigger"
    },
    {
      "action": "Move focus to the first / last enabled trigger.",
      "keys": [
        "Home",
        "End"
      ],
      "when": "Focus is on a trigger"
    },
    {
      "action": "Toggle the focused panel when the trigger is not a native button.",
      "keys": [
        " "
      ],
      "when": "Focus is on a non-button trigger"
    },
    {
      "action": "Toggle the focused panel when the trigger is neither a button nor a link.",
      "keys": [
        "Enter"
      ],
      "when": "Focus is on a non-button, non-link trigger"
    }
  ],
  "kind": "controller",
  "methods": [
    {
      "description": "Returns the indices of open panels, sorted ascending.",
      "name": "activeIndices",
      "params": [],
      "returns": "number[]",
      "static": false
    },
    {
      "description": "Closes the given panel; refuses to close the last one when `no-collapsible` is set.",
      "name": "close",
      "params": [
        {
          "default": null,
          "name": "target",
          "optional": false,
          "type": "number | string"
        },
        {
          "default": "true",
          "name": "animate",
          "optional": true,
          "type": "boolean"
        }
      ],
      "returns": "Promise<boolean>",
      "static": false
    },
    {
      "description": "Closes all panels, keeping one open when `no-collapsible` is set.",
      "name": "closeAll",
      "params": [
        {
          "default": "true",
          "name": "animate",
          "optional": true,
          "type": "boolean"
        }
      ],
      "returns": "Promise<boolean>",
      "static": false
    },
    {
      "description": "Opens the panel at the given index, value, or id; resolves `true` when open.",
      "name": "open",
      "params": [
        {
          "default": null,
          "name": "target",
          "optional": false,
          "type": "number | string"
        },
        {
          "default": "true",
          "name": "animate",
          "optional": true,
          "type": "boolean"
        }
      ],
      "returns": "Promise<boolean>",
      "static": false
    },
    {
      "description": "Opens every enabled panel; with `multiple` off, opens only the first enabled one.",
      "name": "openAll",
      "params": [
        {
          "default": "true",
          "name": "animate",
          "optional": true,
          "type": "boolean"
        }
      ],
      "returns": "Promise<boolean>",
      "static": false
    },
    {
      "description": "Re-scans the DOM and rebinds listeners after items change.",
      "name": "refresh",
      "params": [],
      "returns": "void",
      "static": false
    },
    {
      "description": "Opens the given panel if closed, otherwise closes it.",
      "name": "toggle",
      "params": [
        {
          "default": null,
          "name": "target",
          "optional": false,
          "type": "number | string"
        },
        {
          "default": "true",
          "name": "animate",
          "optional": true,
          "type": "boolean"
        }
      ],
      "returns": "Promise<boolean>",
      "static": false
    }
  ],
  "notes": [
    "Items are detected from direct children with a `.z-accordion-title` trigger and a `.z-accordion-content` panel; nav lists (`.z-nav`) use links and sublists instead.",
    "Panel animation is skipped when the user prefers reduced motion."
  ],
  "parts": {
    "defaultClsTarget": "open",
    "defaultStlTarget": "host-inner",
    "items": [
      {
        "defaultCls": "z-open",
        "description": "Class applied to open items; the default `cls` target for this component.",
        "foundIn": [
          "$cls"
        ],
        "key": "open",
        "supportsCls": true,
        "supportsStl": false
      }
    ]
  },
  "recipes": [],
  "related": [],
  "schemaVersion": 1,
  "sources": {
    "css": [
      "src/css/kit-components/accordion.css"
    ],
    "cssSelectors": [
      ".z-accordion",
      ".z-accordion-*"
    ],
    "ts": "src/js/controllers/components/accordion.ts"
  },
  "summary": "Collapsible content panels with single or multiple open items, animated height transitions, and keyboard navigation.",
  "tag": "z-accordion",
  "title": "Accordion"
}
