import { type PropertyValues } from 'lit'; import { LuxenElement } from '../../shared/luxen-element.js'; import type { Placement } from '@floating-ui/dom'; import type { DropdownItem } from '../dropdown-item/dropdown-item.js'; /** Fired when a dropdown item is selected. Bubbles; not composed. */ export declare class DropdownSelectEvent extends Event { readonly item: DropdownItem; constructor(item: DropdownItem); } interface DropdownEventMap { select: DropdownSelectEvent; } /** * A dropdown menu anchored to a trigger element. * * @slot trigger - The element that triggers the dropdown. * @slot header - Optional content rendered above the menu items (e.g. a user profile row). Use an `` (or `
`) after it to separate from items. * @slot - Menu content (`l-dropdown-item` elements). Drop an `` (or `
`) between items to render a section separator, or an `` to caption a group of items. Nest items with `slot="submenu"` inside an item to create a submenu. * @slot footer - Optional content rendered below the menu items (e.g. a version label or shortcut row). Use an `` (or `
`) before it to separate from items. * * @csspart panel - The floating menu container. * * @cssproperty --background - Panel background color. * @cssproperty --border-radius - Panel border radius. Default `8px`. * @cssproperty --padding - Panel inner padding. Default `0.25rem`. Slotted `` elements bleed by this amount on each side to span the panel edges. * @cssproperty --shadow - Panel box shadow. * @cssproperty --show-duration - Show animation duration in ms. Default `150`. * @cssproperty --hide-duration - Hide animation duration in ms. Default `150`. * * @event show - Fired before the dropdown opens. Cancelable. * @event after-show - Fired after the open animation completes. * @event hide - Fired before the dropdown closes. Cancelable. * @event after-hide - Fired after the close animation completes. * @event select - Fired when an item is selected, including items nested in submenus. Bubbles. Properties: `item: DropdownItem`. * * @customElement l-dropdown */ export declare class Dropdown extends LuxenElement { static styles: import("lit").CSSResult[]; private _floating; private _typeaheadBuffer; private _typeaheadTimeout; /** Whether the dropdown is open. */ accessor open: boolean; /** Preferred placement of the panel. */ accessor placement: Placement; /** Distance in pixels from the trigger. */ accessor distance: number; /** Disables the dropdown trigger. */ accessor disabled: boolean; /** * Floor the panel's width at the trigger's width. Set to `trigger` so the * panel is never narrower than the trigger; it still grows with its content. * Useful for select-like triggers (a date-range or filter button) where the * panel should line up with the control. Re-applies if the trigger resizes * while open. */ accessor minWidth: 'trigger' | undefined; private get _triggerEl(); private get _panelEl(); private _getItems; private _getAllItems; /** Every item in the menu tree, submenu items included (light-DOM descendants). */ private _getAllItemsDeep; /** The enabled items of the menu level `item` belongs to (its siblings, itself included). */ private _levelItemsOf; /** The parent item whose submenu contains `item`, or null at the root level. */ private _parentItemOf; /** The enabled items of the level that currently holds focus (root level as fallback). */ private _currentLevelItems; private _getDuration; show(): void; hide(): void; toggle(): void; disconnectedCallback(): void; updated(changed: PropertyValues): void; private _handleOpenChange; private _hoverTimer; private _hoverItem; private _openSubmenu; private _closeAllSubmenus; /** * The item targeted by a pointer event, via the composed path. Returns null * for hits inside an item's submenu panel that miss every nested item row * (e.g. the panel padding) — those must not read as hits on the parent item. */ private _itemFromEvent; private _setActiveItem; private _focusFirstItem; private _focusLastItem; private _getCurrentItem; private _focusNextItem; private _focusPreviousItem; private _handleTypeahead; /** * Expose menu-button semantics on whatever element is slotted as the trigger, * and give the root `role="menu"` panel an accessible name derived from it. * Runs on initial assignment and on any runtime trigger swap. */ private _onTriggerSlotChange; private _onTriggerClick; private _onTriggerKeyDown; private _onPanelKeyDown; private _onItemClick; /** Open submenus on hover after a short intent delay; hovering a sibling closes them. */ private _onPanelPointerOver; private _onPanelPointerOut; private _selectCurrentItem; private _selectItem; /** Sync `open` when popover="auto" light-dismiss fires. */ private _onToggle; render(): import("lit").TemplateResult<1>; } export interface Dropdown { addEventListener(type: K, listener: (this: Dropdown, ev: DropdownEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Dropdown, ev: DropdownEventMap[K]) => void, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } export {}; //# sourceMappingURL=dropdown.d.ts.map