{
  "purpose": "Offer contextual commands for a concrete surface while retaining an equivalent visible actions entry point.",
  "avoid": "Provide an accessible route beyond pointer context-click.",
  "classification": "source-bound-reference-with-explicit-decisions",
  "basis": "Pinned React/primitive sources lead API, lifecycle and semantics; native visual observations and explicit reference decisions are mapped in figma/traceability.json.",
  "profile": "interactive-control/1",
  "profileRationale": "The family presents controls or navigation; static depictions do not establish an interactive contract.",
  "componentId": "shadcn:ContextMenu",
  "sourceRule": "ContextMenu is a Menu composition whose default Trigger is a div responding to contextmenu and touch long press500ms, with movement/cancel handling. It does not add a tab stop or an explicit keydown shortcut. This reference deliberately renders a named section as the contextual surface and supplies a visible DropdownMenu Actions button exposing equivalent commands and every checkbox/radio setting independently. It does not register a ContextMenu/Shift+F10 shortcut; on the tested browser/platform Shift+F10 did not generate the required contextmenu event. No extra obligatory surface tab stop is added. Ordinary left click on the surface is not an action. ContextRoot excludes modal/triggerId/handle props from its public inherited surface; do not claim they are accepted. closeParentOnEsc is deprecated/no effect. Content defaults right/start, alignOffset4, sideOffset0. All exported wrappers retain exact source types. Menu Item uses div role=menuitem, CheckboxItem role=menuitemcheckbox with boolean checked/defaultChecked and cancellable onCheckedChange, RadioGroup uses role=group with any value/defaultValue and cancellable onValueChange; RadioItem uses menuitemradio. Item closeOnClick defaults true, but CheckboxItem and RadioItem closeOnClick default false in Base UI 1.9. Command onClick is the native React/Base UI synthetic handler, not an onValueChange. Its event.preventBaseUIHandler() can prevent remaining internal primitive handling such as default closing; this is distinct from callback eventDetails.cancel() on Root or setting changes. Source useButton makes disabled items focusable in the composite while blocking activation; do not promise they are skipped by arrows. Labels/Groups/Separators supply native primitive relations, and Shortcut is only displayed text: it registers no shortcut. SubmenuRoot/Trigger/Content form an independently owned child menu; Root closeParentOnEsc=false normally limits Escape to the child, while context-menu nested Escape follows its specialized source policy. Canceled callbacks preserve the relevant open/checked/radio state; controlled props remain authoritative. onItemHighlighted reports actual element|undefined and reason/label details. Root open transitions, onOpenChangeComplete and externally deferred unmount are distinct. Positioning, pointer safe zones, typeahead, focus management and automatic sibling closing belong to the primitive.",
  "keyboardAndFocus": "Native trigger Enter/Space or supported opening arrows enter the menu. Within a vertical menu Up/Down, Home/End and label typeahead highlight items; disabled entries may be focused but cannot activate. Enter/Space activate an enabled command or setting. Focus/highlight is not a command commit. Right opens an appropriate submenu and Left returns according to source direction/orientation. Escape dismisses the applicable menu level unless the source change callback is canceled, normally returning to its owning trigger; an outside press/focus transition follows the actual modality and finalFocus policy rather than a universal focus jump. Tab follows the primitive dismissal/focus-manager policy and never becomes a Dialog-style fabricated trap. Menubar parent keyboard navigation is separate from child vertical navigation. Essential instructions and command alternatives stay visible outside hover/long-press alone.",
  "sourceCommit": "45bbf9ba23c9c0f63d38887947e5fb06f59c7da3",
  "sourceFiles": [
    "sources/shadcn/apps/v4/registry/bases/base/ui/context-menu.tsx.source",
    "sources/shadcn/apps/v4/content/docs/components/base/context-menu.mdx.source",
    "sources/shadcn/apps/v4/registry/bases/base/examples/context-menu-example.tsx.source"
  ],
  "primitiveDocs": [
    "sources/base-ui-1.9.0/docs/context-menu.md.source"
  ],
  "referenceDecision": "Concrete command names, checkbox/radio values, surface focusability, visible context-menu alternative and stable instance labels are caller-supplied. Each Menu/Submenu Root has its own protocol instance; Menubar and shared CSS do not merge their callback/state authority.",
  "visualContract": {
    "layoutPolicy": "Menu Root/Sub/Portal are context controllers, not fabricated DOM anatomy. Popup, trigger, item roles, public variants and actual private indicator wrappers remain source-bound. Common surface/item rules are deliberately delegated to the shared source menu class cn-menu-target; independent ContextMenu 8px and Dropdown/Menubar 10px corners retain native measurements. Standard rows have a28px minimum,14/20 text and source-backed 4px popup inset; content width is intrinsic with 128px minimum/320px chosen maximum further constrained by actual Positioner available width/height. Native specimen widths are not forced on long localized commands. Source highlight/disabled/checked attributes style real states; destructive text is accompanied by an explicit Delete command name. Label/shortcut helper attributes are caller additions on actual slots, with shortcut hidden from accessible name and not an invented keyboard handler. Positioner owns collision, submenu placement and available space. Portals receive direction and theme explicitly in the target; no inherited main-only styling assumption. Checkbox and radio semantics remain genuine menuitems, and indicator ownership differs between Dropdown slots and private Context/Menubar classes. Source closing/focus/cancellation authority remains in existing SCXML/API; controls are not reduced to CSS transitions. Context trigger is a passive pointer region with a real visible DropdownMenu keyboard equivalent; no unsupported ShiftF10 claim. No menu/modal/tooltip ARIA is added beyond actual primitive semantics.",
    "parts": "component.json#/partBindings",
    "tokenBindings": "component.json#/visualContract/tokens",
    "sourceEvidence": "figma/traceability.json"
  }
}
