import * as i0 from '@angular/core'; import { InjectionToken, Signal, InputSignal, TemplateRef, InputSignalWithTransform, ModelSignal, OutputEmitterRef, WritableSignal } from '@angular/core'; import { VariantProps, cva } from 'class-variance-authority'; import { FocusableOption } from '@angular/cdk/a11y'; /** * Interface for the root menu trigger, allowing items to close the entire menu tree. */ interface RootMenuTrigger { /** Close the menu and all submenus. */ close(): void; /** Whether to close the menu when an item is selected. */ menuCloseOnSelect(): boolean; /** Called by ComMenuComponent to register itself when attached. */ registerMenu?(menu: MenuRef): void; } /** * Interface for a parent menu, allowing items and submenus to coordinate. */ interface MenuRef { /** Unique ID of the menu for ARIA. */ readonly menuId: string; /** Size variant inherited by items. */ readonly menuSize: () => 'sm' | 'md' | 'lg'; /** Close this menu level. */ close(): void; /** Focus the first item. */ focusFirstItem(): void; /** Focus the last item. */ focusLastItem(): void; } /** * Token to access the root menu trigger from anywhere in the menu tree. * Used by items to close the entire menu on selection. */ declare const ROOT_MENU_TRIGGER: InjectionToken; /** * Token to access the nearest parent menu component. * Used by items and submenu triggers to coordinate with their parent. */ declare const MENU_REF: InjectionToken; type MenuSize = 'sm' | 'md' | 'lg'; type MenuVariant = 'default' | 'compact'; type MenuPosition = 'above' | 'below' | 'left' | 'right'; type MenuAlignment = 'start' | 'center' | 'end'; /** * Menu panel styling variants. * * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay`, `--radius-popover` */ declare const menuPanelVariants: ReturnType; variant: Record; }>>; type MenuPanelVariants = VariantProps; type BooleanVariant = Record<'true' | 'false', string>; /** * Menu item styling variants (base for all item types). * * @tokens `--color-popover-foreground`, `--color-foreground`, `--color-muted`, `--color-warn`, `--color-warn-subtle` */ declare const menuItemVariants: ReturnType; focused: BooleanVariant; disabled: BooleanVariant; destructive: BooleanVariant; }>>; type MenuItemVariants = VariantProps; /** * Menu label (section header) styling variants. * * @tokens `--color-muted-foreground` */ declare const menuLabelVariants: ReturnType; }>>; type MenuLabelVariants = VariantProps; /** * Check/radio indicator sizing variants. */ declare const menuCheckIndicatorVariants: ReturnType; }>>; type MenuCheckIndicatorVariants = VariantProps; /** * Keyboard shortcut hint styling variants. * * @tokens `--color-muted-foreground` */ declare const menuShortcutVariants: ReturnType; }>>; type MenuShortcutVariants = VariantProps; /** Side for submenu positioning. */ type MenuSide = 'left' | 'right'; /** * Unified menu trigger directive — opens a menu in a CDK overlay. * * **Root context** (outside a menu): Opens on click, has backdrop. * **Submenu context** (inside a menu): Opens on hover/ArrowRight, no backdrop. * * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay` * * @example Root trigger * ```html * * * * * * * * ``` * * @example Submenu trigger (inside a menu, combined with comMenuItem) * ```html * * ``` */ declare class ComMenuTrigger implements RootMenuTrigger { private readonly overlay; private readonly elementRef; private readonly viewContainerRef; private readonly injector; private readonly destroyRef; private readonly renderer; private readonly parentMenu; private readonly parentRootTrigger; private overlayRef; private attachedMenu; private readonly menuId; private openDelayTimer; private closeDelayTimer; private mouseInSubmenu; private submenuMouseEnterCleanup; private submenuMouseLeaveCleanup; /** Whether this trigger is inside a menu (submenu context). */ readonly isSubmenu: Signal; /** Template containing `` with items. */ readonly comMenuTrigger: InputSignal>; /** Preferred position direction (root trigger only). */ readonly menuPosition: InputSignal; /** Alignment along cross-axis (root trigger only). */ readonly menuAlignment: InputSignal; /** Gap in px between trigger and menu. */ readonly menuOffset: InputSignal; /** Prevents opening when true. */ readonly menuDisabled: InputSignalWithTransform; /** Two-way bindable open state. */ readonly menuOpen: ModelSignal; /** Custom CSS class(es) on the overlay panel. */ readonly menuPanelClass: InputSignal; /** Close menu when an item is selected. */ readonly menuCloseOnSelect: InputSignalWithTransform; /** Side for submenu positioning (submenu context only). */ readonly side: InputSignal; /** Alignment for submenu positioning (submenu context only). */ readonly align: InputSignal; /** Hover delay before submenu opens in ms (submenu context only). */ readonly subMenuOpenDelay: InputSignal; /** Hover delay before submenu closes in ms (submenu context only). */ readonly subMenuCloseDelay: InputSignal; /** Emitted after menu opens. */ readonly menuOpened: OutputEmitterRef; /** Emitted after menu closes. */ readonly menuClosed: OutputEmitterRef; protected readonly ariaControls: Signal; private readonly panelClassArray; constructor(); /** Programmatically open the menu. */ open(): void; /** Programmatically close the menu. */ close(): void; /** Toggle the menu open/close state. */ toggle(): void; /** Called by ComMenuComponent to register itself when attached. */ registerMenu(menu: MenuRef): void; protected onClick(event: Event): void; protected onArrowDown(event: Event): void; protected onArrowUp(event: Event): void; protected onArrowRight(event: Event): void; protected onArrowLeft(event: Event): void; protected onEnter(event: Event): void; protected onSpace(event: Event): void; protected onMouseEnter(): void; protected onMouseLeave(): void; private focusFirstItemDeferred; private focusLastItemDeferred; private openMenu; private closeMenu; private openSubmenuInternal; private closeSubmenu; private createOverlay; private attachContent; private subscribeToCloseEvents; private subscribeToSubmenuCloseEvents; private onSubmenuMouseEnter; private onSubmenuMouseLeave; private cancelOpenTimer; private cancelCloseTimer; private disposeOverlay; private cleanupSubmenuListeners; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Base class for focusable menu items. * All item directives must implement this interface for FocusKeyManager. */ declare abstract class ComMenuItemBase implements FocusableOption { abstract focus(): void; abstract getLabel(): string; /** Whether the item is disabled. */ abstract get disabled(): boolean; } /** * Menu panel component that renders inside an overlay. * Manages keyboard navigation across its items using CDK FocusKeyManager. * * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay` * * @example * ```html * * * * * ``` */ declare class ComMenuComponent implements MenuRef { private readonly rootTrigger; private keyManager; /** Size variant for the menu panel. */ readonly menuSize: InputSignal; /** Spacing density variant. */ readonly menuVariant: InputSignal; /** Accessible label for the menu. */ readonly ariaLabel: InputSignal; /** ID of element labeling this menu. */ readonly ariaLabelledBy: InputSignal; readonly menuId: string; readonly animationState: WritableSignal<'open' | 'closed'>; /** Query all focusable items in the menu. */ private readonly items; protected readonly panelClasses: Signal; constructor(); /** Focus the first non-disabled item. */ focusFirstItem(): void; /** Focus the last non-disabled item. */ focusLastItem(): void; /** Close this menu level. */ close(): void; protected onKeydown(event: KeyboardEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Menu item directive for actionable menu items. * Applied to buttons, anchors, or any element that should be selectable. * * @tokens `--color-popover-foreground`, `--color-foreground`, `--color-muted`, `--color-warn`, `--color-warn-subtle` * * @example * ```html * * * * ``` */ declare class ComMenuItem extends ComMenuItemBase { private readonly elementRef; private readonly menu; private readonly rootTrigger; /** Disables the item. */ readonly menuItemDisabled: InputSignalWithTransform; /** Marks item as destructive (delete, remove actions). */ readonly destructive: InputSignalWithTransform; /** Emitted when item is activated. */ readonly menuItemSelect: OutputEmitterRef; private readonly isFocused; private readonly size; protected readonly itemClasses: Signal; get disabled(): boolean; focus(): void; getLabel(): string; protected onAction(event: Event): void; protected onMouseEnter(): void; protected onMouseLeave(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Checkbox menu item component with toggleable checked state. * * @tokens `--color-popover-foreground`, `--color-foreground`, `--color-muted` * * @example * ```html * * ``` */ declare class ComMenuItemCheckbox extends ComMenuItemBase { private readonly elementRef; private readonly menu; /** Disables the item. */ readonly menuItemDisabled: InputSignalWithTransform; /** Two-way bindable checked state. */ readonly checked: ModelSignal; private readonly isFocused; private readonly size; protected readonly itemClasses: Signal; protected readonly indicatorClasses: Signal; get disabled(): boolean; focus(): void; getLabel(): string; protected toggle(event: Event): void; protected onMouseEnter(): void; protected onMouseLeave(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Radio menu item component for single-selection within a group. * * @tokens `--color-popover-foreground`, `--color-foreground`, `--color-muted` * * @example * ```html *
* * *
* ``` */ declare class ComMenuItemRadio extends ComMenuItemBase { private readonly elementRef; private readonly menu; private readonly rootTrigger; private readonly group; /** Disables the item. */ readonly menuItemDisabled: InputSignalWithTransform; /** The value this radio item represents. */ readonly value: InputSignal; private readonly isFocused; private readonly size; /** Whether this radio item is currently selected. */ readonly isChecked: Signal; protected readonly itemClasses: Signal; protected readonly indicatorClasses: Signal; get disabled(): boolean; focus(): void; getLabel(): string; protected select(event: Event): void; protected onMouseEnter(): void; protected onMouseLeave(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Token for menu group to allow radio items to coordinate. */ declare abstract class ComMenuGroupRef { abstract readonly groupValue: () => unknown; abstract setGroupValue(value: unknown): void; } /** * Menu group directive for organizing related items. * For radio items, ensures mutual exclusivity within the group. * * @example * ```html *
* * *
* ``` * * @tokens None - uses only ARIA attributes */ declare class ComMenuGroup extends ComMenuGroupRef { /** Optional accessible label for the group. */ readonly ariaLabel: InputSignal; /** Two-way bindable value for radio groups. */ readonly groupValue: ModelSignal; setGroupValue(value: unknown): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Non-interactive section label/header inside a menu. * * @tokens `--color-muted-foreground` * * @example * ```html * Team * * ``` */ declare class ComMenuLabel { private readonly menu; /** Unique ID that can be referenced by aria-labelledby. */ readonly labelId: string; private readonly size; protected readonly labelClasses: Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Visual separator between menu sections. * * @tokens `--color-border` * * @example * ```html * *
* * ``` */ declare class ComMenuDivider { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Submenu indicator component — displays a chevron icon indicating a submenu. * Place inside a menu item that has `[comMenuTrigger]` to indicate it opens a submenu. * * @tokens `--color-muted-foreground` * * @example * ```html * * ``` */ declare class ComMenuSubIndicator { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Keyboard shortcut hint displayed in a menu item. * * @tokens `--color-muted-foreground` * * @example * ```html * * ``` */ declare class ComMenuShortcut { private readonly menu; private readonly size; protected readonly shortcutClasses: Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export { ComMenuComponent, ComMenuDivider, ComMenuGroup, ComMenuGroupRef, ComMenuItem, ComMenuItemBase, ComMenuItemCheckbox, ComMenuItemRadio, ComMenuLabel, ComMenuShortcut, ComMenuSubIndicator, ComMenuTrigger, MENU_REF, ROOT_MENU_TRIGGER, menuCheckIndicatorVariants, menuItemVariants, menuLabelVariants, menuPanelVariants, menuShortcutVariants }; export type { MenuAlignment, MenuCheckIndicatorVariants, MenuItemVariants, MenuLabelVariants, MenuPanelVariants, MenuPosition, MenuRef, MenuShortcutVariants, MenuSide, MenuSize, MenuVariant, RootMenuTrigger };