043a5418f3
- 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.
131 lines
3.1 KiB
CSS
131 lines
3.1 KiB
CSS
/* Adapted from HeroUI ce90ea3. Copyright 2025 NextUI Inc.
|
|
* Apache-2.0; see third-party/HEROUI-LICENSE. hv- namespace and Vue adapters. */
|
|
/* ==========================================================================
|
|
Base dropdown styles
|
|
========================================================================== */
|
|
|
|
.hv-dropdown {
|
|
@apply flex flex-col gap-1;
|
|
}
|
|
|
|
.hv-dropdown__trigger {
|
|
@apply inline-block;
|
|
/* Custom trigger (not a library Button) gets button-like affordances */
|
|
@apply outline-none;
|
|
transition:
|
|
transform 250ms var(--ease-out-quart),
|
|
background-color 150ms var(--ease-smooth),
|
|
box-shadow 150ms var(--ease-out);
|
|
@apply transform-gpu motion-reduce:transition-none;
|
|
|
|
cursor: var(--cursor-interactive);
|
|
|
|
&:focus-visible:not([data-focused]),
|
|
&[data-focus-visible="true"] {
|
|
@apply status-focused;
|
|
}
|
|
|
|
&:disabled,
|
|
&[aria-disabled="true"] {
|
|
@apply status-disabled;
|
|
}
|
|
|
|
&[data-pending="true"] {
|
|
@apply status-pending;
|
|
}
|
|
|
|
&:active,
|
|
&[data-pressed="true"] {
|
|
transform: scale(0.97);
|
|
}
|
|
}
|
|
|
|
/* Library Button/Avatar keep their own layout when used as a Vue trigger.
|
|
The custom-trigger affordances above only need to apply to plain elements,
|
|
so the base layout utilities of those components win back. */
|
|
.hv-dropdown__trigger.hv-button {
|
|
display: inline-flex;
|
|
}
|
|
|
|
.hv-dropdown__trigger.hv-avatar {
|
|
display: flex;
|
|
}
|
|
|
|
/* Similar to select popover styles */
|
|
.hv-dropdown__popover {
|
|
@apply max-w-[48svw] origin-(--trigger-anchor-point) scroll-py-1 scrollbar overflow-y-auto overscroll-contain bg-overlay p-0 text-sm md:min-w-55;
|
|
border-radius: min(32px, var(--radius-3xl));
|
|
box-shadow: var(--overlay-shadow);
|
|
|
|
&:focus-visible:not([data-focused]),
|
|
&[data-focus-visible="true"] {
|
|
@apply outline-none;
|
|
}
|
|
|
|
/* Entering animations */
|
|
&[data-entering="true"] {
|
|
@apply animate-in duration-150 ease-smooth fade-in-0 zoom-in-90;
|
|
|
|
&[data-side="top"] {
|
|
@apply slide-in-from-bottom-1;
|
|
}
|
|
|
|
&[data-side="bottom"] {
|
|
@apply slide-in-from-top-1;
|
|
}
|
|
|
|
&[data-side="left"] {
|
|
@apply slide-in-from-right-1;
|
|
}
|
|
|
|
&[data-side="right"] {
|
|
@apply slide-in-from-left-1;
|
|
}
|
|
}
|
|
|
|
/* Exiting animations */
|
|
&[data-exiting="true"] {
|
|
@apply animate-out duration-100 ease-smooth zoom-out-95 fade-out;
|
|
@apply pointer-events-none;
|
|
}
|
|
|
|
&[data-exiting="true"],
|
|
&[data-entering="true"] {
|
|
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
|
}
|
|
|
|
/* Arrow styling */
|
|
& [data-slot="popover-overlay-arrow"] {
|
|
fill: var(--overlay);
|
|
}
|
|
|
|
&[data-side="bottom"] [data-slot="popover-overlay-arrow"] {
|
|
rotate: 180deg;
|
|
}
|
|
|
|
&[data-side="left"] [data-slot="popover-overlay-arrow"] {
|
|
rotate: -90deg;
|
|
}
|
|
|
|
&[data-side="right"] [data-slot="popover-overlay-arrow"] {
|
|
rotate: 90deg;
|
|
}
|
|
|
|
/* Menu styles */
|
|
[data-slot="dropdown-menu"] {
|
|
@apply p-1.5 outline-none;
|
|
}
|
|
|
|
[data-slot="menu-item"] {
|
|
@apply px-2.5;
|
|
}
|
|
}
|
|
|
|
.hv-dropdown__menu {
|
|
@apply relative flex w-full flex-col gap-0.5 overflow-clip p-1;
|
|
|
|
[data-slot="separator"] {
|
|
@apply ms-[3%] w-[94%];
|
|
}
|
|
}
|