fix: align Dropdown/Menu with the HeroUI baseline after fidelity audit
- menu-item.css keys disabled styling off the presence attribute Reka emits. - Dropdown surfaces drive the ported enter/exit animations and use data-side for placement-specific motion. - One role=menu per popup; items render their key as DOM id; submenu surfaces point aria-labelledby at the real trigger; MenuSection names its group from a nested Header. - Custom (asChild) triggers stay keyboard focusable; library Button/Avatar keep their own layout instead of the custom-trigger rules. - Items emit data-focused/data-hovered/data-pressed, expose the upstream render props to slots, and merge caller classes through tailwind-variants. - Submenu triggers declare hasSubmenu explicitly and forward class/ARIA; the default submenu indicator uses the baseline chevron artwork. - Demos restore Kbd slot="keyboard" (27x), IconSquarePlus, and remove the added comment, stray space and duplicated indicator SVGs. - Document the page after the official structure and API tables, including renamed props, Vue extensions and remaining gaps.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import {
|
||||
IconDeviceFloppy,
|
||||
IconFolderOpen,
|
||||
IconPlus,
|
||||
IconSquarePlus,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-vue";
|
||||
import {
|
||||
@@ -30,9 +30,9 @@ function onAction(key: string | number) {
|
||||
<DropdownPopover>
|
||||
<DropdownMenu @action="onAction">
|
||||
<DropdownItem id="new-file" text-value="新建文件">
|
||||
<IconPlus class="size-4 shrink-0 text-muted" />
|
||||
<IconSquarePlus class="size-4 shrink-0 text-muted" />
|
||||
<Label>新建文件</Label>
|
||||
<Kbd class="ms-auto" variant="light">
|
||||
<Kbd class="ms-auto" slot="keyboard" variant="light">
|
||||
<KbdAbbr key-value="command" />
|
||||
<KbdContent>N</KbdContent>
|
||||
</Kbd>
|
||||
@@ -40,7 +40,7 @@ function onAction(key: string | number) {
|
||||
<DropdownItem id="open-file" text-value="打开文件">
|
||||
<IconFolderOpen class="size-4 shrink-0 text-muted" />
|
||||
<Label>打开文件</Label>
|
||||
<Kbd class="ms-auto" variant="light">
|
||||
<Kbd class="ms-auto" slot="keyboard" variant="light">
|
||||
<KbdAbbr key-value="command" />
|
||||
<KbdContent>O</KbdContent>
|
||||
</Kbd>
|
||||
@@ -48,7 +48,7 @@ function onAction(key: string | number) {
|
||||
<DropdownItem id="save-file" text-value="保存文件">
|
||||
<IconDeviceFloppy class="size-4 shrink-0 text-muted" />
|
||||
<Label>保存文件</Label>
|
||||
<Kbd class="ms-auto" variant="light">
|
||||
<Kbd class="ms-auto" slot="keyboard" variant="light">
|
||||
<KbdAbbr key-value="command" />
|
||||
<KbdContent>S</KbdContent>
|
||||
</Kbd>
|
||||
@@ -56,7 +56,7 @@ function onAction(key: string | number) {
|
||||
<DropdownItem id="delete-file" text-value="删除文件" variant="danger">
|
||||
<IconTrash class="size-4 shrink-0 text-danger" />
|
||||
<Label>删除文件</Label>
|
||||
<Kbd class="ms-auto" variant="light">
|
||||
<Kbd class="ms-auto" slot="keyboard" variant="light">
|
||||
<KbdAbbr key-value="command" />
|
||||
<KbdAbbr key-value="shift" />
|
||||
<KbdContent>D</KbdContent>
|
||||
|
||||
Reference in New Issue
Block a user