{
  "name": "Menu",
  "package": "@magicblocksai/ui",
  "file": "packages/ui/src/components/Menu.tsx",
  "chapterTag": "06 Navigation",
  "chapter": "07-navigation.html",
  "sectionId": "menu",
  "elName": "Dropdown menu",
  "demoUrl": "https://brand.magicblocks.ai/components/07-navigation#menu",
  "hasLiveDemo": false,
  "description": "Dropdown menu with portal positioning, focus trap, arrow-key nav, and\ntypeahead. Wraps `.menu`. Supports two authoring styles:",
  "useClient": true,
  "interactivity": "interactive",
  "namedExports": [
    {
      "name": "Menu",
      "isPrincipal": true,
      "isType": false
    },
    {
      "name": "MenuItem",
      "isPrincipal": false,
      "isType": true
    },
    {
      "name": "MenuDivider",
      "isPrincipal": false,
      "isType": false
    },
    {
      "name": "MenuGroup",
      "isPrincipal": false,
      "isType": true
    },
    {
      "name": "MenuProps",
      "isPrincipal": false,
      "isType": true
    },
    {
      "name": "MenuItemProps",
      "isPrincipal": false,
      "isType": true
    },
    {
      "name": "MenuDividerProps",
      "isPrincipal": false,
      "isType": true
    },
    {
      "name": "MenuGroupProps",
      "isPrincipal": false,
      "isType": true
    },
    {
      "name": "MenuItemData",
      "isPrincipal": false,
      "isType": false
    },
    {
      "name": "MenuGroupData",
      "isPrincipal": false,
      "isType": false
    }
  ],
  "importStatement": "import { Menu } from \"@magicblocksai/ui\";",
  "props": [
    {
      "name": "label",
      "optional": true,
      "type": "ReactNode",
      "doc": ""
    },
    {
      "name": "children",
      "optional": true,
      "type": "ReactNode",
      "doc": "Inline children render alongside (or in place of) `label`."
    },
    {
      "name": "icon",
      "optional": true,
      "type": "ReactNode",
      "doc": ""
    },
    {
      "name": "shortcut",
      "optional": true,
      "type": "string",
      "doc": ""
    },
    {
      "name": "danger",
      "optional": true,
      "type": "boolean",
      "doc": "Render this item with the danger style."
    },
    {
      "name": "disabled",
      "optional": true,
      "type": "boolean",
      "doc": "Disable the item — non-focusable, non-clickable."
    },
    {
      "name": "href",
      "optional": true,
      "type": "string",
      "doc": "Optional href to render as `<a>`."
    },
    {
      "name": "onSelect",
      "optional": true,
      "type": "() => void",
      "doc": "Click / Enter handler."
    },
    {
      "name": "keepOpen",
      "optional": true,
      "type": "boolean; // ── internal — wired by parent <Menu> ── /** @internal */ _index?: number",
      "doc": "Keep the menu open after the item is selected. Default `false` (every selection closes — the historic kit behaviour). Set to `true` for multi-select rows where consumers want to flick several toggles without re-opening the menu between each — e.g. a workspace switcher with checkboxes, a column-visibility chooser, a tag picker. v1.39.0 — Spark Round X+1 (`DropdownMenuItem keepOpen`)."
    },
    {
      "name": "_isActive",
      "optional": true,
      "type": "boolean",
      "doc": "@internal"
    },
    {
      "name": "_onActivate",
      "optional": true,
      "type": "(index: number) => void",
      "doc": "@internal"
    },
    {
      "name": "_close",
      "optional": true,
      "type": "() => void",
      "doc": "@internal"
    },
    {
      "name": "_id",
      "optional": true,
      "type": "string",
      "doc": "@internal"
    }
  ],
  "classesUsed": [
    "menu",
    "menu-divider",
    "menu-group",
    "menu-group-label",
    "menu-item",
    "menu-item-icon",
    "menu-item-label",
    "menu-trigger-wrap"
  ],
  "examples": {
    "react": null,
    "html": "<div class=\"menu-demo\">\n  <button class=\"menu-trigger\">Acme, Inc. <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\"><path d=\"m6 9 6 6 6-6\"/></svg></button>\n  <div class=\"menu\">\n    <div class=\"menu-head\">\n      <div class=\"menu-head-avatar\">A</div>\n      <div>\n        <div class=\"menu-head-name\">Acme, Inc.</div>\n        <div class=\"menu-head-sub\">Team · 4 seats</div>\n      </div>\n    </div>\n    <div class=\"menu-divider\"></div>\n    <button class=\"menu-item\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 10.5 12 3l9 7.5V20a2 2 0 0 1-2 2h-4v-7h-6v7H5a2 2 0 0 1-2-2z\"/></svg> Dashboard</button>\n    <button class=\"menu-item\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"9\" cy=\"9\" r=\"3\"/><path d=\"M12 15a5 5 0 0 0-5 5h10a5 5 0 0 0-5-5Z\"/><circle cx=\"17\" cy=\"7\" r=\"2\"/><path d=\"M21 13a3 3 0 0 0-6 0\"/></svg> Team members</button>\n    <button class=\"menu-item\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M12 2v3M12 19v3M4.9 4.9l2.1 2.1M16.9 16.9l2.1 2.1M2 12h3M19 12h3M4.9 19.1l2.1-2.1M16.9 7.1l2.1-2.1\"/></svg> Workspace settings</button>\n    <div class=\"menu-divider\"></div>\n    <button class=\"menu-item is-danger\">Leave workspace</button>\n  </div>\n</div>",
    "css": ".menu {\n  background: var(--bg-paper);\n  border: 1px solid var(--hair);\n  border-radius: var(--r-lg);\n  padding: var(--s-2);\n  display: flex; flex-direction: column; gap: 2px;\n  box-shadow: var(--sh-3);\n  min-width: 260px;\n}\n\n.menu-divider { height: 1px; background: var(--hair); margin: 4px 0; }\n\n.menu-group { display: flex; flex-direction: column; gap: 2px; }\n\n.menu-group-label { font: 500 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-dim); padding: var(--s-2) var(--s-3); }\n\n.menu-item {\n  display: flex; align-items: center; gap: var(--s-3);\n  padding: 8px var(--s-3);\n  background: transparent; border: 0;\n  border-radius: var(--r-xs);\n  font: 500 13.5px/1 var(--f-body);\n  color: var(--fg); cursor: pointer;\n  text-align: left;\n  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);\n}\n\n.menu-item-icon { display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--fg-dim); }\n\n.menu-item-label { flex: 1; min-width: 0; }\n\n.menu-trigger-wrap { display: inline-block; }"
  }
}
