{
 "id": "action-menu",
 "name": "Action menu",
 "purpose": "A More button with its dropdown shown open: grouped actions with icons and shortcuts, a submenu, a disabled item and a danger action at the end. Positioning is the project's.",
 "use_when": [
  "when a row or record has more actions than fit as buttons",
  "a toolbar or card header where rare or destructive actions should stay out of sight until asked for"
 ],
 "avoid_when": [
  "searching across many commands or pages by typing: use command-menu",
  "only one or two actions: show them as buttons",
  "an action that needs a reason or a second look before it runs: open confirm-dialog from the menu item"
 ],
 "type": "overlay",
 "style": "dense",
 "width": "narrow",
 "tags": {
  "audience": "work",
  "industries": [
   "any"
  ],
  "keywords": [
   "menu",
   "dropdown",
   "actions",
   "shortcuts",
   "context menu"
  ]
 },
 "root": ".odl-action-menu",
 "parts": [
  {
   "name": "trigger",
   "selector": ".odl-trigger",
   "what": "the More button that opens and closes the menu",
   "slot": "action"
  },
  {
   "name": "group",
   "selector": ".odl-group",
   "what": "a small heading over a group of items",
   "slot": "text"
  },
  {
   "name": "items",
   "selector": "[role=\"menuitem\"]",
   "what": "one action: icon, label, then a shortcut, a submenu arrow or a note",
   "slot": "list"
  },
  {
   "name": "shortcut",
   "selector": "kbd",
   "what": "the key or keys shown for an item",
   "slot": "text"
  },
  {
   "name": "note",
   "selector": "small",
   "what": "why a disabled item is off",
   "slot": "text"
  },
  {
   "name": "danger",
   "selector": ".odl-danger",
   "what": "the destructive action, last and in red",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "trigger",
   "groups"
  ],
  "properties": {
   "trigger": {
    "type": "string",
    "maxLength": 16,
    "part": "trigger"
   },
   "menu_label": {
    "type": "string",
    "maxLength": 40
   },
   "groups": {
    "type": "array",
    "minItems": 1,
    "maxItems": 4,
    "items": {
     "type": "object",
     "required": [
      "items"
     ],
     "properties": {
      "heading": {
       "type": "string",
       "maxLength": 24,
       "part": "group"
      },
      "items": {
       "type": "array",
       "minItems": 1,
       "maxItems": 6,
       "part": "items",
       "items": {
        "type": "object",
        "required": [
         "label"
        ],
        "properties": {
         "label": {
          "type": "string",
          "maxLength": 22
         },
         "icon": {
          "type": "string",
          "maxLength": 32
         },
         "shortcut": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "part": "shortcut",
          "items": {
           "type": "string",
           "maxLength": 3
          }
         },
         "submenu": {
          "type": "boolean"
         },
         "disabled": {
          "type": "boolean"
         },
         "disabled_note": {
          "type": "string",
          "maxLength": 18,
          "part": "note"
         }
        }
       }
      }
     }
    }
   },
   "danger": {
    "type": "object",
    "required": [
     "label"
    ],
    "part": "danger",
    "properties": {
     "label": {
      "type": "string",
      "maxLength": 22
     },
     "shortcut": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "items": {
       "type": "string",
       "maxLength": 3
      }
     }
    }
   },
   "danger_label": {
    "type": "string",
    "maxLength": 80
   },
   "danger_shortcut": {
    "type": "string",
    "maxLength": 80
   }
  }
 },
 "states": {
  "shown": [
   "open",
   "closed",
   "hover",
   "focus",
   "disabled",
   "danger",
   "submenu"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if an action fails after the menu closes, report it with toast-stack"
   },
   "disabled": {
    "status": "shown",
    "how": "an item marked aria-disabled turns grey, shows a note on why, and clicking it does nothing",
    "evidence": "[aria-disabled=\"true\"] { cursor: not-allowed"
   },
   "overflow": {
    "status": "not_built",
    "how": "the menu has no height limit; for long lists give the menu a max height with its own scroll"
   },
   "long_text": {
    "status": "handled",
    "how": "a long label wraps in its column while shortcuts and notes stay on one line",
    "evidence": "minmax(0, 1fr) auto"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-danger-subtle",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-icon-default",
  "--ds-color-icon-subtle",
  "--ds-color-surface-overlay",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-danger",
  "--ds-color-text-disabled",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-elevation-floating",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-family-text",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-enter",
  "--ds-motion-easing-hover",
  "--ds-motion-easing-standard",
  "--ds-motion-scale-enter",
  "--ds-radius-control",
  "--ds-radius-detail",
  "--ds-radius-nested",
  "--ds-radius-overlay",
  "--ds-size-control-md",
  "--ds-size-icon-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-4",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xs",
  "--ds-space-stack-sm",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-label-sm"
 ],
 "a11y": {
  "summary": "A menu button with aria-expanded; items are menuitems with roving focus (arrow keys, Home, End), Escape closes and returns focus to the button, and the disabled item is aria-disabled.",
  "roles": [
   "menu",
   "menuitem",
   "separator"
  ],
  "keyboard": [
   "Enter or Space on More opens or closes the menu and focuses the first item",
   "Arrow Down or Arrow Up on More opens the menu at the first or last item",
   "Arrow Down and Arrow Up move between items and wrap around; Home and End jump to the first and last",
   "Enter or Space runs the focused item and closes the menu, except the disabled item and Move to",
   "Escape or Tab closes the menu and returns focus to More",
   "the shortcut keys shown are labels only; the file does not listen for them"
  ],
  "controls": {
   "button": 1,
   "input": 0,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/action-menu/component.html",
  "bytes": 12395,
  "script": true
 },
 "source": null,
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/action-menu.html",
  "json": "https://opendesigner.dev/library/action-menu.json",
  "page": "https://opendesigner.dev/library/action-menu/"
 },
 "get": {
  "curl": "curl -fsSLo action-menu.html https://opendesigner.dev/library/action-menu.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add action-menu --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component action-menu to this project: https://opendesigner.dev/library/action-menu.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
