{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "dropdown-menu", "type": "registry:ui", "title": "Dropdown Menu", "files": [ { "path": "ui/dropdown-menu.tsrx", "type": "registry:ui", "target": "components/ui/dropdown-menu.tsrx", "content": "// Base UI base dropdown-menu — runs on @octanejs/base-ui's `Menu`. Class strings come from the\n// maintainer-supplied radix source; every difference below was verified by rendering the primitive\n// and reading the DOM, not inferred.\n//\n// PART TREE. Radix's `Content` is one element; Base UI splits positioning out, exactly as this\n// base's popover already does:\n//\n// radix Root > Portal > Content\n// Base UI Root > Portal > Positioner > Popup (Positioner owns align/sideOffset)\n//\n// THREE CSS VARIABLES ARE RENAMED. Radix publishes per-component names; Base UI's Positioner\n// publishes generic ones, and a utility pointing at a variable nothing sets silently does nothing:\n//\n// --radix-dropdown-menu-content-available-height -> --available-height\n// --radix-dropdown-menu-trigger-width -> --anchor-width\n// --radix-dropdown-menu-content-transform-origin -> --transform-origin\n//\n// THE SUBMENU TRIGGER'S OPEN ATTRIBUTE DIFFERS. Base UI marks an open trigger with\n// `data-popup-open` (triggerOpenStateMapping), not the `data-open` the popup itself carries — so\n// radix's `data-open:bg-accent` on the sub-trigger would never match and an open submenu's parent\n// row would not stay highlighted.\n//\n// WHAT DOES CARRY OVER UNCHANGED, and is worth recording because it looks like it should not:\n// radix styles item highlight with `focus:`, which works here because Base UI moves REAL DOM focus\n// onto the highlighted item (checked by driving ArrowDown and reading document.activeElement) as\n// well as publishing `data-highlighted`. `data-side`, `data-align`, `data-open`, `data-closed` and\n// `data-disabled` are all emitted with the same spellings radix uses.\n//\n// TWO PARTS ARE PLAIN HOST ELEMENTS ON PURPOSE:\n// - `Label` is a `