@radix-ng/primitives 0.33.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-navigation-menu.mjs","sources":["../../../packages/primitives/navigation-menu/src/navigation-menu-a11y.component.ts","../../../packages/primitives/navigation-menu/src/navigation-menu.token.ts","../../../packages/primitives/navigation-menu/src/navigation-menu.types.ts","../../../packages/primitives/navigation-menu/src/utils.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-item.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-content.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-indicator.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-link.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-list.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-sub.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-trigger.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-viewport.directive.ts","../../../packages/primitives/navigation-menu/index.ts","../../../packages/primitives/navigation-menu/radix-ng-primitives-navigation-menu.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Component({\n selector: 'rdx-navigation-menu-focus-proxy',\n template: `\n <span\n [attr.tabindex]=\"0\"\n [attr.aria-hidden]=\"true\"\n (focus)=\"onFocus($event)\"\n rdxVisuallyHidden\n feature=\"focusable\"\n ></span>\n `,\n imports: [RdxVisuallyHiddenDirective]\n})\nexport class RdxNavigationMenuFocusProxyComponent {\n @Input() triggerElement: HTMLElement | null = null;\n @Input() contentElement: HTMLElement | null = null;\n @Output() proxyFocus = new EventEmitter<'start' | 'end'>();\n\n onFocus(event: FocusEvent): void {\n const prevFocusedElement = event.relatedTarget as HTMLElement | null;\n const wasTriggerFocused = prevFocusedElement === this.triggerElement;\n const wasFocusFromContent = this.contentElement ? this.contentElement.contains(prevFocusedElement) : false;\n\n if (wasTriggerFocused || !wasFocusFromContent) {\n this.proxyFocus.emit(wasTriggerFocused ? 'start' : 'end');\n }\n }\n}\n\n@Component({\n selector: 'rdx-navigation-menu-aria-owns',\n template: `\n <span [attr.aria-owns]=\"contentId\" rdxVisuallyHidden feature=\"fully-hidden\"></span>\n `,\n imports: [RdxVisuallyHiddenDirective]\n})\nexport class RdxNavigationMenuAriaOwnsComponent {\n @Input() contentId: string = '';\n}\n","import { inject, InjectionToken, Provider, Type } from '@angular/core';\nimport { RdxNavigationMenuSubDirective } from './navigation-menu-sub.directive';\nimport { RdxNavigationMenuDirective } from './navigation-menu.directive';\n\nexport interface NavigationMenuContext {\n isRootMenu: boolean;\n value: () => string;\n previousValue: () => string;\n baseId: string;\n dir: 'ltr' | 'rtl';\n orientation: 'horizontal' | 'vertical';\n loop: boolean;\n rootNavigationMenu: () => HTMLElement | null;\n\n indicatorTrack?: () => HTMLElement | null;\n onIndicatorTrackChange?: (track: HTMLElement | null) => void;\n userDismissedByClick?: () => boolean;\n resetUserDismissed?: () => void;\n viewport?: () => HTMLElement | null;\n onViewportChange?: (viewport: HTMLElement | null) => void;\n viewportContent?: () => Map<string, any>;\n onViewportContentChange?: (contentValue: string, contentData: any) => void;\n onViewportContentRemove?: (contentValue: string) => void;\n onTriggerEnter?: (itemValue: string) => void;\n onTriggerLeave?: () => void;\n onContentEnter?: () => void;\n onContentLeave?: () => void;\n onItemSelect?: (itemValue: string) => void;\n onItemDismiss?: () => void;\n handleClose?: (force?: boolean) => void;\n setTriggerPointerState?: (isOver: boolean) => void;\n setContentPointerState?: (isOver: boolean) => void;\n isPointerInSystem?: () => boolean;\n}\n\nexport const RDX_NAVIGATION_MENU_TOKEN = new InjectionToken<NavigationMenuContext>('RdxNavigationMenuToken');\n\nexport function injectNavigationMenu(): NavigationMenuContext {\n return inject(RDX_NAVIGATION_MENU_TOKEN);\n}\n\nexport function isRootNavigationMenu(context: NavigationMenuContext): boolean {\n return context.isRootMenu;\n}\n\nexport function provideNavigationMenuContext(\n provider: Type<RdxNavigationMenuDirective | RdxNavigationMenuSubDirective>\n): Provider {\n return {\n provide: RDX_NAVIGATION_MENU_TOKEN,\n useExisting: provider\n };\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\n\nexport enum RdxNavigationMenuAnimationStatus {\n OPEN_STARTED = 'open_started',\n OPEN_ENDED = 'open_ended',\n CLOSED_STARTED = 'closed_started',\n CLOSED_ENDED = 'closed_ended'\n}\n\n/**\n * A stub class solely used to query a single type of focusable element in the navigation menu.\n */\nexport abstract class RdxNavigationMenuFocusableOption implements FocusableOption {\n focus(): void {\n throw new Error('Method not implemented.');\n }\n}\n","export type NavigationMenuOrientation = 'horizontal' | 'vertical';\nexport type NavigationMenuDirection = 'ltr' | 'rtl';\nexport type MotionAttribute = 'to-start' | 'to-end' | 'from-start' | 'from-end';\n\nexport const ROOT_CONTENT_DISMISS = 'navigationMenu.rootContentDismiss';\n\n/**\n * Generate a unique ID\n */\nexport function generateId(): string {\n return Math.random().toString(36).substring(2, 11);\n}\n\n/**\n * Get the open state for data-state attribute\n */\nexport function getOpenStateLabel(open: boolean): 'open' | 'closed' {\n return open ? 'open' : 'closed';\n}\n\n/**\n * Create a trigger ID from base ID and value\n */\nexport function makeTriggerId(baseId: string, value: string): string {\n return `${baseId}-trigger-${value}`;\n}\n\n/**\n * Create a content ID from base ID and value\n */\nexport function makeContentId(baseId: string, value: string): string {\n return `${baseId}-content-${value}`;\n}\n\n/**\n * Get the motion attribute for animations\n */\nexport function getMotionAttribute(\n currentValue: string,\n previousValue: string,\n itemValue: string,\n itemValues: string[],\n dir: NavigationMenuDirection\n): MotionAttribute | null {\n // reverse values in RTL\n const values = dir === 'rtl' ? [...itemValues].reverse() : itemValues;\n\n const currentIndex = values.indexOf(currentValue);\n const prevIndex = values.indexOf(previousValue);\n const isSelected = itemValue === currentValue;\n const wasSelected = prevIndex === values.indexOf(itemValue);\n\n // only update selected and last selected content\n if (!isSelected && !wasSelected) return null;\n\n // don't provide direction on initial open\n if (currentIndex !== -1 && prevIndex !== -1) {\n // if moving to this item from another\n if (isSelected && prevIndex !== -1) {\n return currentIndex > prevIndex ? 'from-end' : 'from-start';\n }\n // if leaving this item for another\n if (wasSelected && currentIndex !== -1) {\n return currentIndex > prevIndex ? 'to-start' : 'to-end';\n }\n }\n\n // otherwise entering/leaving the list entirely\n return isSelected ? 'from-start' : 'from-end';\n}\n\n/**\n * Focus the first element in a list of candidates\n * @param candidates Array of elements that can receive focus\n * @param preventScroll Whether to prevent scrolling when focusing\n * @param activateKeyboardNav Whether to dispatch a dummy keydown event to activate keyboard navigation handlers\n * @returns Whether focus was successfully moved\n */\nexport function focusFirst(candidates: HTMLElement[], preventScroll = false, activateKeyboardNav = true): boolean {\n const prevFocusedElement = document.activeElement;\n\n // sort candidates by tabindex to ensure proper order\n const sortedCandidates = [...candidates].sort((a, b) => {\n const aIndex = a.tabIndex || 0;\n const bIndex = b.tabIndex || 0;\n return aIndex - bIndex;\n });\n\n const success = sortedCandidates.some((candidate) => {\n // if focus is already where we want it, do nothing\n if (candidate === prevFocusedElement) return true;\n\n try {\n candidate.focus({ preventScroll });\n return document.activeElement !== prevFocusedElement;\n } catch (e) {\n console.error('Error focusing element:', e);\n return false;\n }\n });\n\n // if focus was moved successfully and we want to activate keyboard navigation,\n // dispatch a dummy keypress to ensure keyboard handlers are activated\n if (success && activateKeyboardNav && document.activeElement !== prevFocusedElement) {\n try {\n // dispatch a no-op keydown event to activate any keyboard handlers\n document.activeElement?.dispatchEvent(\n new KeyboardEvent('keydown', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n code: 'Tab'\n })\n );\n } catch (e) {\n console.error('Error dispatching keyboard event:', e);\n }\n }\n\n return success;\n}\n\n/**\n * Get all tabbable candidates in a container\n */\nexport function getTabbableCandidates(container: HTMLElement): HTMLElement[] {\n if (!container || !container.querySelectorAll) return [];\n\n const TABBABLE_SELECTOR =\n 'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), ' +\n 'select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), ' +\n '[contenteditable=\"true\"]:not([tabindex=\"-1\"])';\n\n // use querySelector for better browser support\n const elements = Array.from(container.querySelectorAll(TABBABLE_SELECTOR)) as HTMLElement[];\n\n // filter out elements that are hidden, have display:none, etc.\n return elements.filter((element) => {\n if (element.tabIndex < 0) return false;\n if (element.hasAttribute('disabled')) return false;\n if (element.hasAttribute('aria-hidden') && element.getAttribute('aria-hidden') === 'true') return false;\n\n // Check if element or any parent is hidden\n let current: HTMLElement | null = element;\n while (current) {\n const style = window.getComputedStyle(current);\n if (style.display === 'none' || style.visibility === 'hidden' || style.opacity === '0') {\n return false;\n }\n current = current.parentElement;\n }\n\n return true;\n });\n}\n\n/**\n * Remove elements from tab order and return a function to restore them\n */\nexport function removeFromTabOrder(candidates: HTMLElement[]): () => void {\n const originalValues = new Map<HTMLElement, string | null>();\n\n candidates.forEach((candidate) => {\n // Store original tabindex\n originalValues.set(candidate, candidate.getAttribute('tabindex'));\n\n // Set to -1 to remove from tab order\n candidate.setAttribute('tabindex', '-1');\n });\n\n // Return restore function\n return () => {\n candidates.forEach((candidate) => {\n const originalValue = originalValues.get(candidate);\n if (originalValue == null) {\n candidate.removeAttribute('tabindex');\n } else {\n candidate.setAttribute('tabindex', originalValue);\n }\n });\n };\n}\n\n/**\n * Wrap array around itself at given start index\n */\nexport function wrapArray<T>(array: T[], startIndex: number): T[] {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { contentChild, Directive, ElementRef, inject, input, Signal, signal } from '@angular/core';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { RdxNavigationMenuFocusableOption } from './navigation-menu.types';\nimport { focusFirst, getTabbableCandidates, removeFromTabOrder } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuItem]',\n host: {\n '[attr.value]': 'value()'\n },\n exportAs: 'rdxNavigationMenuItem'\n})\nexport class RdxNavigationMenuItemDirective implements FocusableOption {\n readonly elementRef = inject(ElementRef);\n private readonly context = injectNavigationMenu();\n\n readonly value = input('');\n\n /**\n * @ignore\n */\n readonly triggerOrLink = contentChild(RdxNavigationMenuFocusableOption);\n\n readonly triggerRef = signal<HTMLElement | null>(null);\n readonly contentRef = signal<HTMLElement | null>(null);\n readonly focusProxyRef = signal<HTMLElement | null>(null);\n readonly wasEscapeCloseRef = signal(false);\n\n private readonly _restoreContentTabOrderRef = signal<(() => void) | null>(null);\n\n get restoreContentTabOrderRef(): Signal<(() => void) | null> {\n return this._restoreContentTabOrderRef;\n }\n\n /**\n * Handle keyboard entry into content from trigger\n */\n onEntryKeyDown() {\n // Check if we're using a viewport in a root menu\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n const viewport = this.context.viewport();\n if (viewport) {\n // find tabbable elements in the viewport\n const candidates = getTabbableCandidates(viewport);\n if (candidates.length) {\n this.ensureTabOrder();\n\n // focus the first element\n focusFirst(candidates);\n return;\n }\n }\n }\n\n // fallback to content if no viewport or no tabbable elements in viewport\n if (this.contentRef()) {\n // restore tab order if needed\n const restoreFn = this._restoreContentTabOrderRef();\n if (restoreFn) restoreFn();\n\n // find and focus first tabbable element\n const candidates = getTabbableCandidates(this.contentRef()!);\n if (candidates.length) {\n focusFirst(candidates);\n }\n }\n }\n\n focus(): void {\n this.triggerOrLink()?.focus();\n }\n\n /**\n * Ensure elements are in the tab order by restoring any previously removed tabindex values\n */\n private ensureTabOrder(): void {\n const restoreFn = this._restoreContentTabOrderRef();\n if (restoreFn) {\n restoreFn();\n this._restoreContentTabOrderRef.set(null);\n }\n }\n\n /**\n * Handle focus coming from the focus proxy element\n * @param side Which side the focus is coming from (start = from trigger, end = from after content)\n */\n onFocusProxyEnter(side: 'start' | 'end' = 'start') {\n // check for viewport first\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n const viewport = this.context.viewport();\n if (viewport) {\n const candidates = getTabbableCandidates(viewport);\n if (candidates.length) {\n this.ensureTabOrder();\n\n // focus first or last element depending on direction\n focusFirst(side === 'start' ? candidates : [...candidates].reverse());\n return;\n }\n }\n }\n\n // fallback to content\n if (this.contentRef()) {\n // restore tab order if needed\n const restoreFn = this._restoreContentTabOrderRef();\n if (restoreFn) restoreFn();\n\n // find and focus appropriate element based on direction\n const candidates = getTabbableCandidates(this.contentRef()!);\n if (candidates.length) {\n // Focus first or last element depending on which direction we're coming from\n focusFirst(side === 'start' ? candidates : [...candidates].reverse());\n }\n }\n }\n\n /**\n * Handle focus moving outside of the content\n * Remove elements from tab order when not focused\n */\n onContentFocusOutside() {\n // get all tabbable elements from both viewport and content\n let allCandidates: HTMLElement[] = [];\n\n // check viewport first\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n const viewport = this.context.viewport();\n if (viewport) {\n allCandidates = getTabbableCandidates(viewport);\n }\n }\n\n // ... also check direct content\n if (this.contentRef()) {\n const contentCandidates = getTabbableCandidates(this.contentRef()!);\n allCandidates = [...allCandidates, ...contentCandidates];\n }\n\n // remove from tab order and store restore function\n if (allCandidates.length) {\n this._restoreContentTabOrderRef.set(removeFromTabOrder(allCandidates));\n }\n }\n\n /**\n * Handle content being closed from root menu\n */\n onRootContentClose() {\n this.onContentFocusOutside();\n }\n}\n","import {\n booleanAttribute,\n Directive,\n ElementRef,\n inject,\n Input,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n TemplateRef\n} from '@angular/core';\nimport { ESCAPE, injectDocument } from '@radix-ng/primitives/core';\nimport { RdxNavigationMenuItemDirective } from './navigation-menu-item.directive';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { getMotionAttribute, makeContentId, makeTriggerId } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuContent]'\n})\nexport class RdxNavigationMenuContentDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly ngZone = inject(NgZone);\n private readonly template = inject(TemplateRef);\n private readonly document = injectDocument();\n private readonly item = inject(RdxNavigationMenuItemDirective);\n private readonly context = injectNavigationMenu();\n\n @Input({ transform: booleanAttribute })\n set rdxNavigationMenuContent(value: boolean) {\n // structural directive requires this input even if unused\n }\n\n /**\n * Used to keep the content rendered and available in the DOM, even when closed.\n * Useful for animations or SEO.\n * @default false\n */\n readonly forceMount = input(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly contentId = makeContentId(this.context.baseId, this.item.value());\n /** @ignore */\n readonly triggerId = makeTriggerId(this.context.baseId, this.item.value());\n\n private escapeHandler: ((e: KeyboardEvent) => void) | null = null;\n\n /** @ignore */\n ngOnInit() {\n this.item.contentRef.set(this.elementRef.nativeElement);\n\n // register template with viewport in root menu via context\n if (isRootNavigationMenu(this.context) && this.context.onViewportContentChange) {\n this.context.onViewportContentChange(this.item.value(), {\n ref: this.elementRef,\n templateRef: this.template,\n forceMount: this.forceMount(),\n value: this.item.value(),\n getMotionAttribute: this.getMotionAttribute.bind(this),\n additionalAttrs: {\n id: this.contentId,\n 'aria-labelledby': this.triggerId,\n role: 'menu'\n }\n });\n }\n\n // add Escape key handler\n this.escapeHandler = (event: KeyboardEvent) => {\n if (event.key === ESCAPE && this.context.value() === this.item.value()) {\n // mark that this close was triggered by Escape\n this.item.wasEscapeCloseRef.set(true);\n\n // close the content\n if (this.context.onItemDismiss) {\n this.context.onItemDismiss();\n }\n\n // refocus the trigger\n setTimeout(() => {\n const trigger = this.item.triggerRef();\n if (trigger) trigger.focus();\n }, 0);\n\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n this.ngZone.runOutsideAngular(() => {\n if (this.escapeHandler) {\n this.document.addEventListener('keydown', this.escapeHandler);\n }\n });\n }\n\n /** @ignore */\n ngOnDestroy() {\n // unregister from viewport\n if (isRootNavigationMenu(this.context) && this.context.onViewportContentRemove) {\n this.context.onViewportContentRemove(this.item.value());\n }\n\n // remove escape key handler\n if (this.escapeHandler) {\n this.document.removeEventListener('keydown', this.escapeHandler);\n this.escapeHandler = null;\n }\n }\n\n /** @ignore - Compute motion attribute for animations */\n getMotionAttribute(): string | null {\n if (!isRootNavigationMenu(this.context)) return null;\n\n const itemValues = Array.from(this.context.viewportContent?.() ?? new Map()).map(([value]) => value);\n\n return getMotionAttribute(\n this.context.value(),\n this.context.previousValue(),\n this.item.value(),\n itemValues,\n this.context.dir\n );\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n Renderer2,\n runInInjectionContext,\n signal,\n untracked\n} from '@angular/core';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\n\n@Directive({\n selector: '[rdxNavigationMenuIndicator]',\n host: {\n '[attr.data-state]': 'isVisible() ? \"visible\" : \"hidden\"',\n '[attr.data-orientation]': 'context.orientation',\n '[style.display]': 'isVisible() ? null : \"none\"',\n 'aria-hidden': 'true'\n }\n})\nexport class RdxNavigationMenuIndicatorDirective implements OnDestroy {\n private readonly context = injectNavigationMenu();\n private readonly elementRef = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n\n /**\n * Used to keep the indicator rendered and available in the DOM, even when hidden.\n * Useful for animations.\n * @default false\n */\n readonly forceMount = input(false, { transform: booleanAttribute });\n\n /** @ignore */\n private readonly _position = signal<{ size: number; offset: number } | null>(null);\n /** @ignore */\n private readonly _activeTrigger = signal<HTMLElement | null>(null);\n /** @ignore */\n private readonly _resizeObserver = new ResizeObserver(() => this.updatePosition());\n\n readonly isVisible = computed(() => Boolean(this.context.value() || this.forceMount()));\n\n constructor() {\n // set up effect for tracking active trigger and position\n effect(() => {\n // this effect runs when the current value changes\n const value = this.context.value();\n\n untracked(() => {\n if (value && isRootNavigationMenu(this.context)) {\n this.findAndSetActiveTrigger();\n }\n });\n });\n\n // initialize observers for position tracking\n runInInjectionContext(this.context as any, () => {\n if (isRootNavigationMenu(this.context) && this.context.indicatorTrack) {\n const track = this.context.indicatorTrack();\n if (track) {\n // observe size changes on the track\n this._resizeObserver.observe(track);\n }\n\n // initial position update if menu is open\n if (this.context.value()) {\n setTimeout(() => this.findAndSetActiveTrigger(), 0);\n }\n }\n });\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._resizeObserver.disconnect();\n }\n\n /** @ignore */\n private findAndSetActiveTrigger(): void {\n if (!isRootNavigationMenu(this.context) || !this.context.indicatorTrack) return;\n\n const track = this.context.indicatorTrack();\n if (!track) return;\n\n // find all triggers within the track\n const triggers = Array.from(track.querySelectorAll('[rdxNavigationMenuTrigger]')) as HTMLElement[];\n\n // find the active trigger based on the current menu value\n const activeTrigger = triggers.find((trigger) => {\n const item = trigger.closest('[rdxNavigationMenuItem]');\n if (!item) return false;\n\n const value = item.getAttribute('value');\n return value === this.context.value();\n });\n\n if (activeTrigger && activeTrigger !== this._activeTrigger()) {\n this._activeTrigger.set(activeTrigger);\n this.updatePosition();\n }\n }\n\n /** @ignore */\n private updatePosition(): void {\n const trigger = this._activeTrigger();\n if (!trigger) return;\n\n const isHorizontal = this.context.orientation === 'horizontal';\n\n // calculate new position\n const newPosition = {\n size: isHorizontal ? trigger.offsetWidth : trigger.offsetHeight,\n offset: isHorizontal ? trigger.offsetLeft : trigger.offsetTop\n };\n\n // only update if position has changed\n if (JSON.stringify(newPosition) !== JSON.stringify(this._position())) {\n this._position.set(newPosition);\n\n // apply position styles\n const styles = isHorizontal\n ? {\n position: 'absolute',\n left: '0',\n width: `${newPosition.size}px`,\n transform: `translateX(${newPosition.offset}px)`\n }\n : {\n position: 'absolute',\n top: '0',\n height: `${newPosition.size}px`,\n transform: `translateY(${newPosition.offset}px)`\n };\n\n Object.entries(styles).forEach(([key, value]) => {\n this.renderer.setStyle(this.elementRef.nativeElement, key, value);\n });\n }\n }\n}\n","import { booleanAttribute, Directive, ElementRef, inject, input, OnInit } from '@angular/core';\nimport { ENTER, SPACE } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxNavigationMenuFocusableOption } from './navigation-menu.types';\nimport { generateId } from './utils';\n\nconst LINK_SELECT = 'navigationMenu.linkSelect';\nconst ROOT_CONTENT_DISMISS = 'navigationMenu.rootContentDismiss';\n\n@Directive({\n selector: '[rdxNavigationMenuLink]',\n hostDirectives: [{ directive: RdxRovingFocusItemDirective, inputs: ['focusable'] }],\n host: {\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.aria-current]': 'active() ? \"page\" : undefined',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeydown($event)'\n },\n providers: [{ provide: RdxNavigationMenuFocusableOption, useExisting: RdxNavigationMenuLinkDirective }]\n})\nexport class RdxNavigationMenuLinkDirective extends RdxNavigationMenuFocusableOption implements OnInit {\n private readonly rovingFocusItem = inject(RdxRovingFocusItemDirective, { self: true });\n private readonly uniqueId = generateId();\n readonly active = input(false, { transform: booleanAttribute });\n readonly onSelect = input<(event: Event) => void>();\n readonly elementRef = inject(ElementRef);\n\n ngOnInit(): void {\n this.rovingFocusItem.tabStopId = this.elementRef.nativeElement.id || `link-${this.uniqueId}`;\n }\n\n override focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n onClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n\n // dispatch link select event\n const linkSelectEvent = new CustomEvent(LINK_SELECT, {\n bubbles: true,\n cancelable: true\n });\n\n // add one-time listener for onSelect handler\n const onSelect = this.onSelect();\n if (onSelect) {\n target.addEventListener(LINK_SELECT, onSelect, { once: true });\n }\n\n // dispatch event\n target.dispatchEvent(linkSelectEvent);\n\n // if not prevented and not meta key, dismiss content\n if (!linkSelectEvent.defaultPrevented && !event.metaKey) {\n const dismissEvent = new CustomEvent(ROOT_CONTENT_DISMISS, {\n bubbles: true,\n cancelable: true\n });\n target.dispatchEvent(dismissEvent);\n }\n }\n\n onKeydown(event: KeyboardEvent): void {\n // activate link on Enter or Space\n if (event.key === ENTER || event.key === SPACE) {\n // prevent default behavior like scrolling (Space) or form submission (Enter) BEFORE simulating the click.\n event.preventDefault();\n\n // simulate a click event on the link element itself\n const clickEvent = new MouseEvent('click', { bubbles: true, cancelable: true });\n this.elementRef.nativeElement.dispatchEvent(clickEvent);\n\n return;\n }\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n AfterViewInit,\n contentChildren,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n Renderer2\n} from '@angular/core';\nimport { TAB } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus'; // Import Roving Focus Group\nimport { RdxNavigationMenuItemDirective } from './navigation-menu-item.directive';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\n\n@Directive({\n selector: '[rdxNavigationMenuList]',\n hostDirectives: [RdxRovingFocusGroupDirective],\n host: {\n role: 'menubar',\n '(keydown)': 'onKeydown($event)'\n }\n})\nexport class RdxNavigationMenuListDirective implements AfterContentInit, AfterViewInit {\n private readonly context = injectNavigationMenu();\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly renderer = inject(Renderer2);\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n /**\n * @private\n * @ignore\n */\n readonly items = contentChildren(\n forwardRef(() => RdxNavigationMenuItemDirective),\n { descendants: true }\n );\n\n /**\n * @ignore\n */\n protected keyManager: FocusKeyManager<RdxNavigationMenuItemDirective>;\n\n /**\n * @ignore\n */\n ngAfterContentInit(): void {\n const items = this.items();\n this.keyManager = new FocusKeyManager(items);\n\n if (this.context.orientation === 'horizontal') {\n this.keyManager.withHorizontalOrientation(this.context.dir || 'ltr');\n } else {\n this.keyManager.withVerticalOrientation();\n }\n }\n\n /**\n * @ignore\n */\n ngAfterViewInit() {\n this.rovingFocusGroup.orientation = this.context.orientation;\n this.rovingFocusGroup.dir = this.context.dir;\n\n // looping typically only applies to the root menu bar\n if (isRootNavigationMenu(this.context)) {\n this.rovingFocusGroup.loop = this.context.loop ?? false;\n } else {\n this.rovingFocusGroup.loop = false;\n }\n\n if (isRootNavigationMenu(this.context) && this.context.onIndicatorTrackChange) {\n const listElement = this.elementRef.nativeElement;\n const parent = listElement.parentNode;\n\n // ensure parent exists and list hasn't already been wrapped\n if (parent && !listElement.parentElement?.hasAttribute('data-radix-navigation-menu-list-wrapper')) {\n // create a wrapper div with relative positioning\n const wrapper = this.renderer.createElement('div');\n this.renderer.setAttribute(wrapper, 'data-radix-navigation-menu-list-wrapper', ''); // Add marker\n this.renderer.setStyle(wrapper, 'position', 'relative');\n\n // insert the wrapper before the list element in the parent\n this.renderer.insertBefore(parent, wrapper, listElement);\n\n // move the list element inside the new wrapper\n this.renderer.appendChild(wrapper, listElement);\n\n // register the wrapper element as the track for the indicator positioning\n this.context.onIndicatorTrackChange(wrapper);\n } else if (listElement.parentElement?.hasAttribute('data-radix-navigation-menu-list-wrapper')) {\n // if wrapper somehow already exists, ensure context has the correct reference\n this.context.onIndicatorTrackChange(listElement.parentElement);\n }\n }\n }\n\n /**\n * @ignore\n */\n onKeydown(event: KeyboardEvent) {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n\n if (event.key === TAB && event.shiftKey) {\n if (this.keyManager.activeItemIndex === 0) return;\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n } else if (event.key === TAB) {\n const items = this.items();\n if (this.keyManager.activeItemIndex === items.length - 1) {\n return;\n }\n this.keyManager.setNextItemActive();\n event.preventDefault();\n } else {\n this.keyManager.onKeydown(event);\n }\n }\n\n /**\n * @ignore\n */\n setActiveItem(item: RdxNavigationMenuItemDirective) {\n this.keyManager.setActiveItem(item);\n }\n}\n","import {\n booleanAttribute,\n Directive,\n effect,\n ElementRef,\n inject,\n Input,\n numberAttribute,\n OnDestroy,\n signal,\n WritableSignal\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectDocument, injectWindow } from '@radix-ng/primitives/core';\nimport { debounce, map, Subject, tap, timer } from 'rxjs';\nimport { provideNavigationMenuContext } from './navigation-menu.token';\nimport { RdxNavigationMenuAnimationStatus } from './navigation-menu.types';\nimport { generateId } from './utils';\n\n// define action types for clearer intent\nexport enum RdxNavigationMenuAction {\n OPEN = 'open',\n CLOSE = 'close'\n}\n\n@Directive({\n selector: '[rdxNavigationMenu]',\n providers: [provideNavigationMenuContext(RdxNavigationMenuDirective)],\n host: {\n '[attr.data-orientation]': 'orientation',\n '[attr.dir]': 'dir',\n 'aria-label': 'Main',\n role: 'navigation'\n },\n exportAs: 'rdxNavigationMenu'\n})\nexport class RdxNavigationMenuDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly document = injectDocument();\n private readonly window = injectWindow();\n\n // State\n readonly #value = signal<string>('');\n readonly #previousValue = signal<string>('');\n readonly baseId = `rdx-nav-menu-${generateId()}`;\n readonly #indicatorTrack = signal<HTMLElement | null>(null);\n readonly #viewport = signal<HTMLElement | null>(null);\n readonly #viewportContent = signal<Map<string, any>>(new Map());\n readonly #rootNavigationMenu = signal<HTMLElement | null>(this.elementRef.nativeElement);\n\n readonly #userDismissedByClick = signal(false);\n userDismissedByClick = () => this.#userDismissedByClick();\n resetUserDismissed = () => this.#userDismissedByClick.set(false);\n\n // delay timers\n private openTimerRef = 0;\n private closeTimerRef = 0;\n private skipDelayTimerRef = 0;\n readonly #isOpenDelayed = signal(true);\n\n // pointer tracking\n readonly #isPointerOverContent = signal(false);\n readonly #isPointerOverTrigger = signal(false);\n private documentMouseLeaveHandler: ((e: Event) => void) | null = null;\n\n readonly actionSubject$ = new Subject<{ action: RdxNavigationMenuAction; itemValue?: string }>();\n\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n @Input() dir: 'ltr' | 'rtl' = 'ltr';\n @Input({ transform: numberAttribute }) delayDuration = 200;\n @Input({ transform: numberAttribute }) skipDelayDuration = 300;\n @Input({ transform: booleanAttribute }) loop = false;\n @Input({ transform: booleanAttribute }) cssAnimation = false;\n @Input({ transform: booleanAttribute }) cssOpeningAnimation = false;\n @Input({ transform: booleanAttribute }) cssClosingAnimation = false;\n\n readonly isRootMenu = true;\n readonly cssAnimationStatus: WritableSignal<RdxNavigationMenuAnimationStatus | null> = signal(null);\n\n // exposed state as functions for the token\n value = () => this.#value();\n previousValue = () => this.#previousValue();\n rootNavigationMenu = () => this.#rootNavigationMenu();\n indicatorTrack = () => this.#indicatorTrack();\n viewport = () => this.#viewport();\n viewportContent = () => this.#viewportContent();\n\n // exposed pointer state\n setTriggerPointerState = (isOver: boolean) => this.#isPointerOverTrigger.set(isOver);\n setContentPointerState = (isOver: boolean) => this.#isPointerOverContent.set(isOver);\n isPointerInSystem = () => this.#isPointerOverContent() || this.#isPointerOverTrigger();\n\n // exposed animation state\n getCssAnimation = () => this.cssAnimation;\n getCssOpeningAnimation = () => this.cssOpeningAnimation;\n getCssClosingAnimation = () => this.cssClosingAnimation;\n\n constructor() {\n effect(() => {\n const value = this.#value();\n if (value) {\n this.window.clearTimeout(this.skipDelayTimerRef);\n if (this.skipDelayDuration > 0) {\n this.#isOpenDelayed.set(false);\n }\n } else {\n // menu is closed, start skip delay timer\n this.window.clearTimeout(this.skipDelayTimerRef);\n this.skipDelayTimerRef = this.window.setTimeout(() => {\n this.#isOpenDelayed.set(true);\n }, this.skipDelayDuration);\n }\n });\n\n this.actionSubject$\n .pipe(\n map((config) => {\n // different delays for open vs close (better ux)\n const duration = config.action === RdxNavigationMenuAction.OPEN ? this.delayDuration : 150;\n return { ...config, duration };\n }),\n debounce((config) => timer(config.duration)),\n tap((config) => {\n switch (config.action) {\n case RdxNavigationMenuAction.OPEN:\n if (config.itemValue) {\n this.setValue(config.itemValue);\n }\n break;\n case RdxNavigationMenuAction.CLOSE:\n // only close if not hovering over any part of the system\n if (!this.isPointerInSystem()) {\n this.setValue('');\n }\n break;\n }\n }),\n takeUntilDestroyed()\n )\n .subscribe();\n\n // set up document mouseleave handler to close menu when mouse leaves window\n this.documentMouseLeaveHandler = () => this.handleClose();\n this.document.addEventListener('mouseleave', this.documentMouseLeaveHandler);\n }\n\n ngOnDestroy() {\n this.window.clearTimeout(this.openTimerRef);\n this.window.clearTimeout(this.closeTimerRef);\n this.window.clearTimeout(this.skipDelayTimerRef);\n\n // clean up document event listener\n if (this.documentMouseLeaveHandler) {\n document.removeEventListener('mouseleave', this.documentMouseLeaveHandler);\n }\n }\n\n onIndicatorTrackChange(track: HTMLElement | null) {\n this.#indicatorTrack.set(track);\n }\n\n onViewportChange(viewport: HTMLElement | null) {\n this.#viewport.set(viewport);\n }\n\n onTriggerEnter(itemValue: string) {\n // skip opening if user explicitly dismissed this menu\n if (this.#userDismissedByClick() && itemValue === this.#previousValue()) {\n return;\n }\n\n this.window.clearTimeout(this.openTimerRef);\n this.window.clearTimeout(this.closeTimerRef);\n\n if (this.#isOpenDelayed()) {\n this.handleDelayedOpen(itemValue);\n } else {\n this.handleOpen(itemValue);\n }\n }\n\n onTriggerLeave() {\n this.window.clearTimeout(this.openTimerRef);\n this.startCloseTimer();\n }\n\n onContentEnter() {\n this.window.clearTimeout(this.closeTimerRef);\n }\n\n onContentLeave() {\n this.startCloseTimer();\n }\n\n handleClose() {\n this.actionSubject$.next({ action: RdxNavigationMenuAction.CLOSE });\n }\n\n onItemSelect(itemValue: string) {\n const wasOpen = this.#value() === itemValue;\n const newValue = wasOpen ? '' : itemValue;\n\n // if user is closing an open menu, mark as user-dismissed\n if (wasOpen) {\n this.#userDismissedByClick.set(true);\n } else {\n this.#userDismissedByClick.set(false);\n }\n\n this.setValue(newValue);\n }\n\n onItemDismiss() {\n this.setValue('');\n }\n\n onViewportContentChange(contentValue: string, contentData: any) {\n const newMap = new Map(this.#viewportContent());\n newMap.set(contentValue, contentData);\n this.#viewportContent.set(newMap);\n }\n\n onViewportContentRemove(contentValue: string) {\n const newMap = new Map(this.#viewportContent());\n if (newMap.has(contentValue)) {\n newMap.delete(contentValue);\n this.#viewportContent.set(newMap);\n }\n }\n\n private setValue(value: string) {\n // Store previous value before changing\n this.#previousValue.set(this.#value());\n this.#value.set(value);\n }\n\n private startCloseTimer() {\n this.window.clearTimeout(this.closeTimerRef);\n this.closeTimerRef = this.window.setTimeout(() => {\n // only close if not hovering over any part of the system\n if (!this.isPointerInSystem()) {\n this.setValue('');\n }\n }, 150);\n }\n\n private handleOpen(itemValue: string) {\n this.window.clearTimeout(this.closeTimerRef);\n this.setValue(itemValue);\n }\n\n private handleDelayedOpen(itemValue: string) {\n const isOpenItem = this.#value() === itemValue;\n if (isOpenItem) {\n // if the item is already open, clear close timer\n this.window.clearTimeout(this.closeTimerRef);\n } else {\n // otherwise, start the open timer\n this.openTimerRef = this.window.setTimeout(() => {\n this.window.clearTimeout(this.closeTimerRef);\n this.setValue(itemValue);\n }, this.delayDuration);\n }\n }\n}\n","import { Directive, inject, Input, input, output, signal } from '@angular/core';\nimport { RdxNavigationMenuDirective } from './navigation-menu.directive';\nimport { provideNavigationMenuContext } from './navigation-menu.token';\nimport { generateId } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuSub]',\n providers: [provideNavigationMenuContext(RdxNavigationMenuSubDirective)],\n host: {\n '[attr.data-orientation]': 'orientation()'\n }\n})\nexport class RdxNavigationMenuSubDirective {\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n @Input() set defaultValue(val: string) {\n if (val) this.value.set(val);\n }\n\n readonly valueChange = output<string>();\n\n readonly value = signal<string>('');\n readonly previousValue = signal<string>('');\n readonly baseId = `rdx-nav-menu-sub-${generateId()}`;\n readonly isRootMenu = false;\n\n private readonly parent = inject(RdxNavigationMenuDirective, { optional: true });\n\n get dir(): 'ltr' | 'rtl' {\n if (!this.parent) {\n return 'ltr';\n }\n\n return this.parent.dir || 'ltr';\n }\n\n get rootNavigationMenu(): HTMLElement | null {\n return this.parent?.rootNavigationMenu() || null;\n }\n\n onTriggerEnter(itemValue: string) {\n this.setValue(itemValue);\n }\n\n onItemSelect(itemValue: string) {\n this.setValue(itemValue);\n }\n\n onItemDismiss() {\n this.setValue('');\n }\n\n private setValue(value: string) {\n this.previousValue.set(this.value());\n this.value.set(value);\n this.valueChange.emit(value);\n }\n}\n","import {\n booleanAttribute,\n ComponentRef,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n untracked,\n ViewContainerRef\n} from '@angular/core';\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ENTER, SPACE, TAB } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport {\n RdxNavigationMenuAriaOwnsComponent,\n RdxNavigationMenuFocusProxyComponent\n} from './navigation-menu-a11y.component';\nimport { RdxNavigationMenuItemDirective } from './navigation-menu-item.directive';\nimport { RdxNavigationMenuListDirective } from './navigation-menu-list.directive';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { RdxNavigationMenuFocusableOption } from './navigation-menu.types';\nimport { getTabbableCandidates, makeContentId, makeTriggerId } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuTrigger]',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[id]': 'triggerId',\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'context.orientation',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[disabled]': 'disabled() ? true : null',\n '[attr.aria-expanded]': 'open()',\n '[attr.aria-controls]': 'contentId',\n '[attr.aria-haspopup]': '\"menu\"',\n '(pointerenter)': 'onPointerEnter()',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerleave)': 'onPointerLeave($event)',\n '(click)': 'onClick()',\n '(keydown)': 'onKeydown($event)',\n type: 'button'\n },\n providers: [{ provide: RdxNavigationMenuFocusableOption, useExisting: RdxNavigationMenuTriggerDirective }]\n})\nexport class RdxNavigationMenuTriggerDirective extends RdxNavigationMenuFocusableOption implements OnInit, OnDestroy {\n private readonly context = injectNavigationMenu();\n private readonly item = inject(RdxNavigationMenuItemDirective);\n private readonly list = inject(RdxNavigationMenuListDirective);\n private readonly rovingFocusItem = inject(RdxRovingFocusItemDirective, { self: true });\n private readonly elementRef = inject(ElementRef);\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly triggerId = makeTriggerId(this.context.baseId, this.item.value());\n readonly contentId = makeContentId(this.context.baseId, this.item.value());\n readonly open = computed(() => {\n return this.item.value() === this.context.value();\n });\n\n private focusProxyRef: ComponentRef<RdxNavigationMenuFocusProxyComponent> | null = null;\n private ariaOwnsRef: ComponentRef<RdxNavigationMenuAriaOwnsComponent> | null = null;\n\n private hasPointerMoveOpened = false;\n private wasClickClose = false;\n\n constructor() {\n super();\n\n effect(() => {\n this.rovingFocusItem.focusable = !this.disabled();\n });\n\n effect(() => {\n const isOpen = this.open();\n\n untracked(() => {\n // handle focus proxy and aria-owns when open state changes\n if (isOpen) {\n this.createAccessibilityComponents();\n } else {\n this.removeAccessibilityComponents();\n\n if (!this.item.wasEscapeCloseRef()) {\n this.item.onRootContentClose();\n }\n\n this.hasPointerMoveOpened = false;\n }\n });\n });\n }\n\n ngOnInit() {\n this.item.triggerRef.set(this.elementRef.nativeElement);\n\n // configure the static part of the roving focus item directive instance\n this.rovingFocusItem.tabStopId = this.item.value();\n }\n\n ngOnDestroy() {\n this.removeAccessibilityComponents();\n }\n\n override focus() {\n this.elementRef.nativeElement.focus();\n }\n\n private createAccessibilityComponents(): void {\n if (this.focusProxyRef || this.ariaOwnsRef) {\n return;\n }\n\n // create focus proxy component\n this.focusProxyRef = this.viewContainerRef.createComponent(RdxNavigationMenuFocusProxyComponent);\n this.focusProxyRef.instance.triggerElement = this.elementRef.nativeElement;\n this.focusProxyRef.instance.contentElement = this.item.contentRef();\n this.focusProxyRef.instance.proxyFocus.subscribe((direction: 'start' | 'end') => {\n this.item.onFocusProxyEnter(direction);\n });\n\n // store reference in item directive\n this.item.focusProxyRef.set(this.focusProxyRef.location.nativeElement);\n\n // only add aria-owns component if using viewport\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n this.ariaOwnsRef = this.viewContainerRef.createComponent(RdxNavigationMenuAriaOwnsComponent);\n this.ariaOwnsRef.instance.contentId = this.contentId;\n }\n }\n\n private removeAccessibilityComponents(): void {\n if (this.focusProxyRef) {\n this.focusProxyRef.destroy();\n this.focusProxyRef = null;\n this.item.focusProxyRef.set(null);\n }\n\n if (this.ariaOwnsRef) {\n this.ariaOwnsRef.destroy();\n this.ariaOwnsRef = null;\n }\n }\n\n onPointerEnter(): void {\n // ignore if disabled or not the root menu (hover logic primarily for root)\n if (this.disabled() || !isRootNavigationMenu(this.context)) return;\n\n this.wasClickClose = false; // Reset click close flag on enter\n this.item.wasEscapeCloseRef.set(false); // Reset escape flag\n this.context.setTriggerPointerState?.(true); // Update context state\n\n // if the menu isn't already open for this item, trigger the enter logic (handles delays)\n if (!this.open()) {\n this.context.onTriggerEnter?.(this.item.value());\n }\n }\n\n onPointerMove(event: PointerEvent): void {\n // ignore if not a mouse event, disabled, closed by click/escape, or already opened by this move\n if (\n event.pointerType !== 'mouse' ||\n this.disabled() ||\n this.wasClickClose ||\n this.item.wasEscapeCloseRef() ||\n this.hasPointerMoveOpened ||\n !isRootNavigationMenu(this.context)\n ) {\n return;\n }\n // trigger enter logic (handles delays) and mark that this move initiated an open attempt\n this.context.onTriggerEnter?.(this.item.value());\n this.hasPointerMoveOpened = true;\n }\n\n onPointerLeave(event: PointerEvent): void {\n // ignore if not a mouse event or disabled\n if (event.pointerType !== 'mouse' || this.disabled() || !isRootNavigationMenu(this.context)) {\n return;\n }\n\n this.context.setTriggerPointerState?.(false); // Update context state\n this.context.onTriggerLeave?.(); // Trigger leave logic (handles delays)\n this.hasPointerMoveOpened = false; // Reset flag\n\n // reset user dismissal flag if pointer leaves the whole system (trigger + content)\n if (this.context.resetUserDismissed) {\n // relay slightly to allow pointer movement to content area without resetting dismissal state\n setTimeout(() => {\n if (!this.context.isPointerInSystem?.()) {\n this.context.resetUserDismissed?.();\n }\n }, 50); // small delay for tolerance\n }\n }\n\n onClick(): void {\n if (this.disabled()) return;\n\n // manually set the `KeyManager` active item to this trigger\n this.list.setActiveItem(this.item);\n\n if (this.context.onItemSelect) {\n this.context.onItemSelect(this.item.value());\n // track if this click action resulted in closing the menu\n this.wasClickClose = !this.open();\n // reset escape flag if menu was opened by click\n if (this.open()) {\n this.item.wasEscapeCloseRef.set(false);\n }\n }\n }\n\n onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) return;\n\n if (event.key === ENTER || event.key === SPACE) {\n event.preventDefault(); // prevent default button behavior\n this.onClick();\n\n // if menu was opened by this keypress, move focus into the content\n if (this.open()) {\n // defer focus slightly to ensure content is ready\n setTimeout(() => this.item.onEntryKeyDown(), 0);\n }\n return;\n }\n\n const isHorizontal = this.context.orientation === 'horizontal';\n const isRTL = this.context.dir === 'rtl';\n\n // handle `ArrowDown` specifically for viewport navigation\n if (event.key === ARROW_DOWN || event.key === TAB) {\n if (event.key === ARROW_DOWN) {\n event.preventDefault();\n }\n\n // if the menu is open, focus into the content\n if (this.open()) {\n if (event.key === TAB) {\n // needed to ensure that the `keyManager` on the list directive does not activate\n // any focus updates, shifting focus to the subsequent focusable list item\n event.stopImmediatePropagation();\n }\n\n // direct focus handling for viewport case\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n // get the viewport element\n const viewport = this.context.viewport();\n if (viewport) {\n // find all tabbable elements in the viewport\n const tabbables = getTabbableCandidates(viewport);\n if (tabbables.length > 0) {\n // focus the first tabbable element directly\n setTimeout(() => {\n tabbables[0].focus();\n }, 0);\n return;\n }\n }\n }\n\n // fallback to the standard entry key down approach\n setTimeout(() => this.item.onEntryKeyDown(), 0);\n return;\n }\n\n // if not open but in horizontal orientation, emulate right key navigation\n if (isHorizontal) {\n const nextEvent = new KeyboardEvent('keydown', {\n key: isRTL ? ARROW_LEFT : ARROW_RIGHT,\n bubbles: true\n });\n this.elementRef.nativeElement.dispatchEvent(nextEvent);\n return;\n }\n }\n\n // handle ArrowUp in horizontal orientation\n if (isHorizontal && event.key === ARROW_UP) {\n event.preventDefault();\n\n // emulate a left key press to move to the previous item\n const nextEvent = new KeyboardEvent('keydown', {\n key: isRTL ? ARROW_RIGHT : ARROW_LEFT,\n bubbles: true\n });\n this.elementRef.nativeElement.dispatchEvent(nextEvent);\n return;\n }\n\n // handle vertical navigation and entry into content\n const verticalEntryKey = isRTL ? ARROW_LEFT : ARROW_RIGHT;\n const entryKey = isHorizontal ? ARROW_DOWN : verticalEntryKey;\n\n if (this.item.contentRef() && event.key === entryKey && event.key !== ARROW_DOWN) {\n // Skip if it's ArrowDown as we already handled it above\n event.preventDefault();\n\n if (!this.open()) {\n // if closed, open the menu first\n this.context.onItemSelect?.(this.item.value());\n // defer focus movement into content until after state update and render\n setTimeout(() => this.item.onEntryKeyDown(), 0);\n } else {\n // if already open, just move focus into the content\n this.item.onEntryKeyDown();\n }\n return;\n }\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n Renderer2,\n signal,\n TemplateRef,\n untracked,\n ViewContainerRef\n} from '@angular/core';\nimport { ARROW_DOWN, ARROW_UP, injectDocument, injectWindow } from '@radix-ng/primitives/core';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { getOpenStateLabel, getTabbableCandidates } from './utils';\n\ninterface ContentNode {\n embeddedView: EmbeddedViewRef<unknown>;\n element: HTMLElement;\n}\n\n@Directive({\n selector: '[rdxNavigationMenuViewport]',\n host: {\n '[attr.data-state]': 'getOpenState()',\n '[attr.data-orientation]': 'context.orientation',\n '[style.--radix-navigation-menu-viewport-width.px]': 'viewportSize()?.width',\n '[style.--radix-navigation-menu-viewport-height.px]': 'viewportSize()?.height',\n '(keydown)': 'onKeydown($event)',\n '(pointerenter)': 'onPointerEnter()',\n '(pointerleave)': 'onPointerLeave()'\n }\n})\nexport class RdxNavigationMenuViewportDirective implements OnInit, OnDestroy {\n private readonly context = injectNavigationMenu();\n private readonly document = injectDocument();\n private readonly window = injectWindow();\n\n private readonly elementRef = inject(ElementRef);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly renderer = inject(Renderer2);\n\n /**\n * Used to keep the viewport rendered and available in the DOM, even when closed.\n * Useful for animations.\n * @default false\n */\n readonly forceMount = input(false, { transform: booleanAttribute });\n\n private readonly _contentNodes = signal(new Map<string, ContentNode>());\n private readonly _activeContentNode = signal<ContentNode | null>(null);\n private readonly _viewportSize = signal<{ width: number; height: number } | null>(null);\n private readonly _resizeObserver = new ResizeObserver(() => this.updateSize());\n\n // compute the active content value - either current value if open, or previous value if closing\n readonly activeContentValue = computed(() => {\n return this.open ? this.context.value() : this.context.previousValue();\n });\n\n // size for viewport CSS variables\n readonly viewportSize = computed(() => this._viewportSize());\n\n get open(): boolean {\n return Boolean(this.context.value() || this.forceMount());\n }\n\n onKeydown(event: KeyboardEvent): void {\n // only handle if viewport is open\n if (!this.open) return;\n\n // get all tabbable elements in the viewport\n const tabbableElements = getTabbableCandidates(this.elementRef.nativeElement);\n if (!tabbableElements.length) return;\n\n // find the currently focused element\n const activeElement = this.document.activeElement as HTMLElement | null;\n const currentIndex = tabbableElements.findIndex((el) => el === activeElement);\n\n if (event.key === ARROW_DOWN) {\n event.preventDefault();\n\n if (currentIndex >= 0 && currentIndex < tabbableElements.length - 1) {\n // focus the next element\n tabbableElements[currentIndex + 1].focus();\n } else if (currentIndex === -1 || currentIndex === tabbableElements.length - 1) {\n // if no element is focused or we're at the end, focus the first element\n tabbableElements[0].focus();\n }\n } else if (event.key === ARROW_UP) {\n event.preventDefault();\n\n if (currentIndex > 0) {\n // focus the previous element\n tabbableElements[currentIndex - 1].focus();\n } else if (currentIndex === 0) {\n // if at the first element, loop to the last element\n tabbableElements[tabbableElements.length - 1].focus();\n } else if (currentIndex === -1) {\n // if no element is focused, focus the last element\n tabbableElements[tabbableElements.length - 1].focus();\n }\n }\n }\n\n constructor() {\n // setup effect to manage content\n effect(() => {\n const activeValue = this.activeContentValue();\n const open = this.open;\n\n untracked(() => {\n // handle visibility based on open state\n this.renderer.setStyle(this.elementRef.nativeElement, 'display', open ? 'block' : 'none');\n\n if (isRootNavigationMenu(this.context) && this.context.viewportContent) {\n const viewportContent = this.context.viewportContent();\n\n if (viewportContent.has(activeValue)) {\n const contentData = viewportContent.get(activeValue);\n\n // only render content when we have a templateRef\n if (contentData?.templateRef) {\n this.renderContent(contentData.templateRef, activeValue);\n }\n }\n }\n });\n });\n }\n\n ngOnInit() {\n // register viewport with context\n if (isRootNavigationMenu(this.context) && this.context.onViewportChange) {\n this.context.onViewportChange(this.elementRef.nativeElement);\n }\n }\n\n ngOnDestroy() {\n this._resizeObserver.disconnect();\n\n // clear all views\n this._contentNodes().forEach((node) => {\n if (node.embeddedView) {\n node.embeddedView.destroy();\n }\n });\n\n // unregister viewport\n if (isRootNavigationMenu(this.context) && this.context.onViewportChange) {\n this.context.onViewportChange(null);\n }\n }\n\n getOpenState() {\n return getOpenStateLabel(this.open);\n }\n\n onPointerEnter(): void {\n if (isRootNavigationMenu(this.context) && this.context.onContentEnter) {\n this.context.onContentEnter();\n }\n\n // update pointer tracking state\n if (isRootNavigationMenu(this.context) && this.context.setContentPointerState) {\n this.context.setContentPointerState(true);\n }\n }\n\n onPointerLeave(): void {\n if (isRootNavigationMenu(this.context) && this.context.onContentLeave) {\n this.context.onContentLeave();\n }\n\n // Update pointer tracking state\n if (isRootNavigationMenu(this.context) && this.context.setContentPointerState) {\n this.context.setContentPointerState(false);\n }\n }\n\n private updateSize() {\n const activeNode = this._activeContentNode()?.element;\n if (!activeNode) return;\n\n // force layout recalculation while keeping element in the DOM\n this.window.getComputedStyle(activeNode).getPropertyValue('width');\n\n const firstChild = activeNode.firstChild as HTMLElement;\n const width = Math.ceil(firstChild.offsetWidth);\n const height = Math.ceil(firstChild.offsetHeight);\n\n // update size with valid dimensions (but only if not zero)\n if (width !== 0 && height !== 0) {\n this._viewportSize.set({ width, height });\n }\n }\n\n private renderContent(templateRef: TemplateRef<unknown>, contentValue: string) {\n // check if we already have a view for this content\n let contentNode = this._contentNodes().get(contentValue);\n\n if (!contentNode) {\n try {\n // create a new embedded view\n const embeddedView = this.viewContainerRef.createEmbeddedView(templateRef);\n embeddedView.detectChanges();\n\n // create a container for the view\n const container = this.renderer.createElement('div');\n this.renderer.setAttribute(container, 'class', 'NavigationMenuContentWrapper');\n this.renderer.setAttribute(container, 'data-content-value', contentValue);\n this.renderer.setStyle(container, 'width', '100%');\n\n const viewportContent = this.context.viewportContent && this.context.viewportContent();\n if (!viewportContent) return;\n\n const contentData = viewportContent.get(contentValue);\n\n // apply motion attribute if available\n if (contentData?.getMotionAttribute) {\n const motionAttr = contentData.getMotionAttribute();\n if (motionAttr) {\n this.renderer.setAttribute(container, 'data-motion', motionAttr);\n }\n }\n\n // apply additional a11y attributes to the first root node\n if (contentData?.additionalAttrs && embeddedView.rootNodes.length > 0) {\n const rootNode = embeddedView.rootNodes[0];\n // check if rootNode has setAttribute (is an Element)\n if (rootNode.setAttribute) {\n Object.entries(contentData.additionalAttrs).forEach(([attr, value]) => {\n // don't override existing attributes that the user might have set manually\n if (!rootNode.hasAttribute(attr) || attr === 'id') {\n this.renderer.setAttribute(rootNode, attr, value as string);\n }\n });\n }\n }\n\n // add each root node to the container\n embeddedView.rootNodes.forEach((node: Node) => {\n this.renderer.appendChild(container, node);\n });\n\n // set styles for proper measurement and display\n this.renderer.setStyle(container, 'position', 'relative');\n this.renderer.setStyle(container, 'visibility', 'visible');\n this.renderer.setStyle(container, 'pointer-events', 'auto');\n this.renderer.setStyle(container, 'display', 'block');\n\n // store in cache\n contentNode = { embeddedView, element: container };\n const newMap = new Map(this._contentNodes());\n newMap.set(contentValue, contentNode);\n this._contentNodes.set(newMap);\n } catch (error) {\n console.error('Error in renderContent:', error);\n return;\n }\n }\n\n if (contentNode) {\n this.updateActiveContent(contentNode);\n }\n }\n\n private updateActiveContent(contentNode: ContentNode) {\n if (contentNode !== this._activeContentNode()) {\n // clear viewport\n while (this.elementRef.nativeElement.firstChild) {\n this.renderer.removeChild(this.elementRef.nativeElement, this.elementRef.nativeElement.firstChild);\n }\n\n // add content to viewport\n this.renderer.appendChild(this.elementRef.nativeElement, contentNode.element);\n\n // update active content reference\n this._activeContentNode.set(contentNode);\n\n // setup resize observation\n this._resizeObserver.disconnect();\n this._resizeObserver.observe(contentNode.element);\n\n // measure after adding to DOM\n setTimeout(() => this.updateSize(), 0);\n\n // measure again after a frame to catch any style changes\n requestAnimationFrame(() => this.updateSize());\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport {\n RdxNavigationMenuAriaOwnsComponent,\n RdxNavigationMenuFocusProxyComponent\n} from './src/navigation-menu-a11y.component';\nimport { RdxNavigationMenuContentDirective } from './src/navigation-menu-content.directive';\nimport { RdxNavigationMenuIndicatorDirective } from './src/navigation-menu-indicator.directive';\nimport { RdxNavigationMenuItemDirective } from './src/navigation-menu-item.directive';\nimport { RdxNavigationMenuLinkDirective } from './src/navigation-menu-link.directive';\nimport { RdxNavigationMenuListDirective } from './src/navigation-menu-list.directive';\nimport { RdxNavigationMenuSubDirective } from './src/navigation-menu-sub.directive';\nimport { RdxNavigationMenuTriggerDirective } from './src/navigation-menu-trigger.directive';\nimport { RdxNavigationMenuViewportDirective } from './src/navigation-menu-viewport.directive';\nimport { RdxNavigationMenuDirective } from './src/navigation-menu.directive';\n\nexport * from './src/navigation-menu-a11y.component';\nexport * from './src/navigation-menu-content.directive';\nexport * from './src/navigation-menu-indicator.directive';\nexport * from './src/navigation-menu-item.directive';\nexport * from './src/navigation-menu-link.directive';\nexport * from './src/navigation-menu-list.directive';\nexport * from './src/navigation-menu-sub.directive';\nexport * from './src/navigation-menu-trigger.directive';\nexport * from './src/navigation-menu-viewport.directive';\nexport * from './src/navigation-menu.directive';\nexport * from './src/navigation-menu.token';\nexport * from './src/navigation-menu.types';\n\nconst _imports = [\n RdxNavigationMenuDirective,\n RdxNavigationMenuSubDirective,\n RdxNavigationMenuListDirective,\n RdxNavigationMenuItemDirective,\n RdxNavigationMenuTriggerDirective,\n RdxNavigationMenuLinkDirective,\n RdxNavigationMenuIndicatorDirective,\n RdxNavigationMenuContentDirective,\n RdxNavigationMenuViewportDirective,\n RdxNavigationMenuFocusProxyComponent,\n RdxNavigationMenuAriaOwnsComponent\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxNavigationMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ROOT_CONTENT_DISMISS"],"mappings":";;;;;;;;;;MAgBa,oCAAoC,CAAA;AAbjD,IAAA,WAAA,GAAA;QAca,IAAc,CAAA,cAAA,GAAuB,IAAI;QACzC,IAAc,CAAA,cAAA,GAAuB,IAAI;AACxC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAmB;AAW7D;AATG,IAAA,OAAO,CAAC,KAAiB,EAAA;AACrB,QAAA,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAmC;AACpE,QAAA,MAAM,iBAAiB,GAAG,kBAAkB,KAAK,IAAI,CAAC,cAAc;QACpE,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,KAAK;AAE1G,QAAA,IAAI,iBAAiB,IAAI,CAAC,mBAAmB,EAAE;AAC3C,YAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,GAAG,OAAO,GAAG,KAAK,CAAC;;;8GAXxD,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAApC,IAAA,SAAA,IAAA,CAAA,IAAA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YACpC,kCAAkC,CAAA,EAAA,CAAA,CAAA;+GAOzB,uBAAuB,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;AC7CD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-navigation-menu.mjs","sources":["../../../packages/primitives/navigation-menu/src/navigation-menu-a11y.component.ts","../../../packages/primitives/navigation-menu/src/navigation-menu.token.ts","../../../packages/primitives/navigation-menu/src/navigation-menu.types.ts","../../../packages/primitives/navigation-menu/src/utils.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-item.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-content.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-indicator.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-link.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-list.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-sub.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-trigger.directive.ts","../../../packages/primitives/navigation-menu/src/navigation-menu-viewport.directive.ts","../../../packages/primitives/navigation-menu/index.ts","../../../packages/primitives/navigation-menu/radix-ng-primitives-navigation-menu.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Component({\n selector: 'rdx-navigation-menu-focus-proxy',\n template: `\n <span\n [attr.tabindex]=\"0\"\n [attr.aria-hidden]=\"true\"\n (focus)=\"onFocus($event)\"\n rdxVisuallyHidden\n feature=\"focusable\"\n ></span>\n `,\n imports: [RdxVisuallyHiddenDirective]\n})\nexport class RdxNavigationMenuFocusProxyComponent {\n @Input() triggerElement: HTMLElement | null = null;\n @Input() contentElement: HTMLElement | null = null;\n @Output() proxyFocus = new EventEmitter<'start' | 'end'>();\n\n onFocus(event: FocusEvent): void {\n const prevFocusedElement = event.relatedTarget as HTMLElement | null;\n const wasTriggerFocused = prevFocusedElement === this.triggerElement;\n const wasFocusFromContent = this.contentElement ? this.contentElement.contains(prevFocusedElement) : false;\n\n if (wasTriggerFocused || !wasFocusFromContent) {\n this.proxyFocus.emit(wasTriggerFocused ? 'start' : 'end');\n }\n }\n}\n\n@Component({\n selector: 'rdx-navigation-menu-aria-owns',\n template: `\n <span [attr.aria-owns]=\"contentId\" rdxVisuallyHidden feature=\"fully-hidden\"></span>\n `,\n imports: [RdxVisuallyHiddenDirective]\n})\nexport class RdxNavigationMenuAriaOwnsComponent {\n @Input() contentId: string = '';\n}\n","import { inject, InjectionToken, Provider, Type } from '@angular/core';\nimport { RdxNavigationMenuSubDirective } from './navigation-menu-sub.directive';\nimport { RdxNavigationMenuDirective } from './navigation-menu.directive';\n\nexport interface NavigationMenuContext {\n isRootMenu: boolean;\n value: () => string;\n previousValue: () => string;\n baseId: string;\n dir: 'ltr' | 'rtl';\n orientation: 'horizontal' | 'vertical';\n loop: boolean;\n rootNavigationMenu: () => HTMLElement | null;\n\n indicatorTrack?: () => HTMLElement | null;\n onIndicatorTrackChange?: (track: HTMLElement | null) => void;\n userDismissedByClick?: () => boolean;\n resetUserDismissed?: () => void;\n viewport?: () => HTMLElement | null;\n onViewportChange?: (viewport: HTMLElement | null) => void;\n viewportContent?: () => Map<string, any>;\n onViewportContentChange?: (contentValue: string, contentData: any) => void;\n onViewportContentRemove?: (contentValue: string) => void;\n onTriggerEnter?: (itemValue: string) => void;\n onTriggerLeave?: () => void;\n onContentEnter?: () => void;\n onContentLeave?: () => void;\n onItemSelect?: (itemValue: string) => void;\n onItemDismiss?: () => void;\n handleClose?: (force?: boolean) => void;\n setTriggerPointerState?: (isOver: boolean) => void;\n setContentPointerState?: (isOver: boolean) => void;\n isPointerInSystem?: () => boolean;\n}\n\nexport const RDX_NAVIGATION_MENU_TOKEN = new InjectionToken<NavigationMenuContext>('RdxNavigationMenuToken');\n\nexport function injectNavigationMenu(): NavigationMenuContext {\n return inject(RDX_NAVIGATION_MENU_TOKEN);\n}\n\nexport function isRootNavigationMenu(context: NavigationMenuContext): boolean {\n return context.isRootMenu;\n}\n\nexport function provideNavigationMenuContext(\n provider: Type<RdxNavigationMenuDirective | RdxNavigationMenuSubDirective>\n): Provider {\n return {\n provide: RDX_NAVIGATION_MENU_TOKEN,\n useExisting: provider\n };\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\n\nexport enum RdxNavigationMenuAnimationStatus {\n OPEN_STARTED = 'open_started',\n OPEN_ENDED = 'open_ended',\n CLOSED_STARTED = 'closed_started',\n CLOSED_ENDED = 'closed_ended'\n}\n\n/**\n * A stub class solely used to query a single type of focusable element in the navigation menu.\n */\nexport abstract class RdxNavigationMenuFocusableOption implements FocusableOption {\n focus(): void {\n throw new Error('Method not implemented.');\n }\n}\n","export type NavigationMenuOrientation = 'horizontal' | 'vertical';\nexport type NavigationMenuDirection = 'ltr' | 'rtl';\nexport type MotionAttribute = 'to-start' | 'to-end' | 'from-start' | 'from-end';\n\nexport const ROOT_CONTENT_DISMISS = 'navigationMenu.rootContentDismiss';\n\n/**\n * Generate a unique ID\n */\nexport function generateId(): string {\n return Math.random().toString(36).substring(2, 11);\n}\n\n/**\n * Get the open state for data-state attribute\n */\nexport function getOpenStateLabel(open: boolean): 'open' | 'closed' {\n return open ? 'open' : 'closed';\n}\n\n/**\n * Create a trigger ID from base ID and value\n */\nexport function makeTriggerId(baseId: string, value: string): string {\n return `${baseId}-trigger-${value}`;\n}\n\n/**\n * Create a content ID from base ID and value\n */\nexport function makeContentId(baseId: string, value: string): string {\n return `${baseId}-content-${value}`;\n}\n\n/**\n * Get the motion attribute for animations\n */\nexport function getMotionAttribute(\n currentValue: string | null,\n previousValue: string | null,\n itemValue: string,\n itemValues: string[],\n dir: NavigationMenuDirection\n): MotionAttribute | null {\n // reverse values in RTL\n const values = dir === 'rtl' ? [...itemValues].reverse() : itemValues;\n\n const currentIndex = currentValue !== null ? values.indexOf(currentValue) : -1;\n const prevIndex = previousValue !== null ? values.indexOf(previousValue) : -1;\n\n const isSelected = itemValue === currentValue;\n const wasSelected = itemValue === previousValue && previousValue !== null;\n\n // Preserve motion attribute for items not directly involved in the transition\n // (This matches React's behaviour, using a ref/signal might be needed\n // in the component using this function to fully replicate React's prevMotionAttributeRef)\n // For now, returning null if not involved, as per the original code's intent here.\n if (!isSelected && !wasSelected) {\n return null;\n }\n\n // handle transitions between items\n if (currentIndex !== -1 && prevIndex !== -1) {\n // if moving to this item (isSelected)\n if (isSelected) {\n return currentIndex > prevIndex ? 'from-end' : 'from-start';\n }\n // if moving away from this item (wasSelected)\n if (wasSelected) {\n return currentIndex > prevIndex ? 'to-start' : 'to-end';\n }\n }\n\n // handle initial open (prevIndex is -1, currentIndex is valid)\n if (isSelected && prevIndex === -1) {\n return null;\n }\n\n // handle closing entirely (currentIndex is -1, prevIndex is valid)\n if (wasSelected && currentIndex === -1) {\n return null;\n }\n\n // fallback if none of the above conditions met (should ideally not happen with clear states)\n return null;\n}\n\n/**\n * Focus the first element in a list of candidates\n * @param candidates Array of elements that can receive focus\n * @param preventScroll Whether to prevent scrolling when focusing\n * @param activateKeyboardNav Whether to dispatch a dummy keydown event to activate keyboard navigation handlers\n * @returns Whether focus was successfully moved\n */\nexport function focusFirst(candidates: HTMLElement[], preventScroll = false, activateKeyboardNav = true): boolean {\n const prevFocusedElement = document.activeElement;\n\n // sort candidates by tabindex to ensure proper order\n const sortedCandidates = [...candidates].sort((a, b) => {\n const aIndex = a.tabIndex || 0;\n const bIndex = b.tabIndex || 0;\n return aIndex - bIndex;\n });\n\n const success = sortedCandidates.some((candidate) => {\n // if focus is already where we want it, do nothing\n if (candidate === prevFocusedElement) return true;\n\n try {\n candidate.focus({ preventScroll });\n return document.activeElement !== prevFocusedElement;\n } catch (e) {\n console.error('Error focusing element:', e);\n return false;\n }\n });\n\n // if focus was moved successfully and we want to activate keyboard navigation,\n // dispatch a dummy keypress to ensure keyboard handlers are activated\n if (success && activateKeyboardNav && document.activeElement !== prevFocusedElement) {\n try {\n // dispatch a no-op keydown event to activate any keyboard handlers\n document.activeElement?.dispatchEvent(\n new KeyboardEvent('keydown', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n code: 'Tab'\n })\n );\n } catch (e) {\n console.error('Error dispatching keyboard event:', e);\n }\n }\n\n return success;\n}\n\n/**\n * Get all tabbable candidates in a container\n */\nexport function getTabbableCandidates(container: HTMLElement): HTMLElement[] {\n if (!container || !container.querySelectorAll) return [];\n\n const TABBABLE_SELECTOR =\n 'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), ' +\n 'select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), ' +\n '[contenteditable=\"true\"]:not([tabindex=\"-1\"])';\n\n // use querySelector for better browser support\n const elements = Array.from(container.querySelectorAll(TABBABLE_SELECTOR)) as HTMLElement[];\n\n // filter out elements that are hidden, have display:none, etc.\n return elements.filter((element) => {\n if (element.tabIndex < 0) return false;\n if (element.hasAttribute('disabled')) return false;\n if (element.hasAttribute('aria-hidden') && element.getAttribute('aria-hidden') === 'true') return false;\n\n // Check if element or any parent is hidden\n let current: HTMLElement | null = element;\n while (current) {\n const style = window.getComputedStyle(current);\n if (style.display === 'none' || style.visibility === 'hidden' || style.opacity === '0') {\n return false;\n }\n current = current.parentElement;\n }\n\n return true;\n });\n}\n\n/**\n * Remove elements from tab order and return a function to restore them\n */\nexport function removeFromTabOrder(candidates: HTMLElement[]): () => void {\n const originalValues = new Map<HTMLElement, string | null>();\n\n candidates.forEach((candidate) => {\n // Store original tabindex\n originalValues.set(candidate, candidate.getAttribute('tabindex'));\n\n // Set to -1 to remove from tab order\n candidate.setAttribute('tabindex', '-1');\n });\n\n // Return restore function\n return () => {\n candidates.forEach((candidate) => {\n const originalValue = originalValues.get(candidate);\n if (originalValue == null) {\n candidate.removeAttribute('tabindex');\n } else {\n candidate.setAttribute('tabindex', originalValue);\n }\n });\n };\n}\n\n/**\n * Wrap array around itself at given start index\n */\nexport function wrapArray<T>(array: T[], startIndex: number): T[] {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { contentChild, Directive, ElementRef, inject, input, Signal, signal } from '@angular/core';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { RdxNavigationMenuFocusableOption } from './navigation-menu.types';\nimport { focusFirst, getTabbableCandidates, removeFromTabOrder } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuItem]',\n host: {\n '[attr.value]': 'value()'\n },\n exportAs: 'rdxNavigationMenuItem'\n})\nexport class RdxNavigationMenuItemDirective implements FocusableOption {\n readonly elementRef = inject(ElementRef);\n private readonly context = injectNavigationMenu();\n\n readonly value = input('');\n\n /**\n * @ignore\n */\n readonly triggerOrLink = contentChild(RdxNavigationMenuFocusableOption);\n\n readonly triggerRef = signal<HTMLElement | null>(null);\n readonly contentRef = signal<HTMLElement | null>(null);\n readonly focusProxyRef = signal<HTMLElement | null>(null);\n readonly wasEscapeCloseRef = signal(false);\n\n private readonly _restoreContentTabOrderRef = signal<(() => void) | null>(null);\n\n get restoreContentTabOrderRef(): Signal<(() => void) | null> {\n return this._restoreContentTabOrderRef;\n }\n\n /**\n * Handle keyboard entry into content from trigger\n */\n onEntryKeyDown() {\n // Check if we're using a viewport in a root menu\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n const viewport = this.context.viewport();\n if (viewport) {\n // find tabbable elements in the viewport\n const candidates = getTabbableCandidates(viewport);\n if (candidates.length) {\n this.ensureTabOrder();\n\n // focus the first element\n focusFirst(candidates);\n return;\n }\n }\n }\n\n // fallback to content if no viewport or no tabbable elements in viewport\n if (this.contentRef()) {\n // restore tab order if needed\n const restoreFn = this._restoreContentTabOrderRef();\n if (restoreFn) restoreFn();\n\n // find and focus first tabbable element\n const candidates = getTabbableCandidates(this.contentRef()!);\n if (candidates.length) {\n focusFirst(candidates);\n }\n }\n }\n\n focus(): void {\n this.triggerOrLink()?.focus();\n }\n\n /**\n * Ensure elements are in the tab order by restoring any previously removed tabindex values\n */\n private ensureTabOrder(): void {\n const restoreFn = this._restoreContentTabOrderRef();\n if (restoreFn) {\n restoreFn();\n this._restoreContentTabOrderRef.set(null);\n }\n }\n\n /**\n * Handle focus coming from the focus proxy element\n * @param side Which side the focus is coming from (start = from trigger, end = from after content)\n */\n onFocusProxyEnter(side: 'start' | 'end' = 'start') {\n // check for viewport first\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n const viewport = this.context.viewport();\n if (viewport) {\n const candidates = getTabbableCandidates(viewport);\n if (candidates.length) {\n this.ensureTabOrder();\n\n // focus first or last element depending on direction\n focusFirst(side === 'start' ? candidates : [...candidates].reverse());\n return;\n }\n }\n }\n\n // fallback to content\n if (this.contentRef()) {\n // restore tab order if needed\n const restoreFn = this._restoreContentTabOrderRef();\n if (restoreFn) restoreFn();\n\n // find and focus appropriate element based on direction\n const candidates = getTabbableCandidates(this.contentRef()!);\n if (candidates.length) {\n // Focus first or last element depending on which direction we're coming from\n focusFirst(side === 'start' ? candidates : [...candidates].reverse());\n }\n }\n }\n\n /**\n * Handle focus moving outside of the content\n * Remove elements from tab order when not focused\n */\n onContentFocusOutside() {\n // get all tabbable elements from both viewport and content\n let allCandidates: HTMLElement[] = [];\n\n // check viewport first\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n const viewport = this.context.viewport();\n if (viewport) {\n allCandidates = getTabbableCandidates(viewport);\n }\n }\n\n // ... also check direct content\n if (this.contentRef()) {\n const contentCandidates = getTabbableCandidates(this.contentRef()!);\n allCandidates = [...allCandidates, ...contentCandidates];\n }\n\n // remove from tab order and store restore function\n if (allCandidates.length) {\n this._restoreContentTabOrderRef.set(removeFromTabOrder(allCandidates));\n }\n }\n\n /**\n * Handle content being closed from root menu\n */\n onRootContentClose() {\n this.onContentFocusOutside();\n }\n}\n","import {\n booleanAttribute,\n Directive,\n ElementRef,\n inject,\n Input,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n TemplateRef\n} from '@angular/core';\nimport { ESCAPE, injectDocument } from '@radix-ng/primitives/core';\nimport { RdxNavigationMenuItemDirective } from './navigation-menu-item.directive';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { getMotionAttribute, makeContentId, makeTriggerId } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuContent]'\n})\nexport class RdxNavigationMenuContentDirective implements OnInit, OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly ngZone = inject(NgZone);\n private readonly template = inject(TemplateRef);\n private readonly document = injectDocument();\n private readonly item = inject(RdxNavigationMenuItemDirective);\n private readonly context = injectNavigationMenu();\n\n @Input({ transform: booleanAttribute })\n set rdxNavigationMenuContent(value: boolean) {\n // structural directive requires this input even if unused\n }\n\n /**\n * Used to keep the content rendered and available in the DOM, even when closed.\n * Useful for animations or SEO.\n * @default false\n */\n readonly forceMount = input(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly contentId = makeContentId(this.context.baseId, this.item.value());\n /** @ignore */\n readonly triggerId = makeTriggerId(this.context.baseId, this.item.value());\n\n private escapeHandler: ((e: KeyboardEvent) => void) | null = null;\n\n /** @ignore */\n ngOnInit() {\n this.item.contentRef.set(this.elementRef.nativeElement);\n\n // register template with viewport in root menu via context\n if (isRootNavigationMenu(this.context) && this.context.onViewportContentChange) {\n this.context.onViewportContentChange(this.item.value(), {\n ref: this.elementRef,\n templateRef: this.template,\n forceMount: this.forceMount(),\n value: this.item.value(),\n getMotionAttribute: this.getMotionAttribute.bind(this),\n additionalAttrs: {\n id: this.contentId,\n 'aria-labelledby': this.triggerId,\n role: 'menu'\n }\n });\n }\n\n // add Escape key handler\n this.escapeHandler = (event: KeyboardEvent) => {\n if (event.key === ESCAPE && this.context.value() === this.item.value()) {\n // mark that this close was triggered by Escape\n this.item.wasEscapeCloseRef.set(true);\n\n // close the content\n if (this.context.onItemDismiss) {\n this.context.onItemDismiss();\n }\n\n // refocus the trigger\n setTimeout(() => {\n const trigger = this.item.triggerRef();\n if (trigger) trigger.focus();\n }, 0);\n\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n this.ngZone.runOutsideAngular(() => {\n if (this.escapeHandler) {\n this.document.addEventListener('keydown', this.escapeHandler);\n }\n });\n }\n\n /** @ignore */\n ngOnDestroy() {\n // unregister from viewport\n if (isRootNavigationMenu(this.context) && this.context.onViewportContentRemove) {\n this.context.onViewportContentRemove(this.item.value());\n }\n\n // remove escape key handler\n if (this.escapeHandler) {\n this.document.removeEventListener('keydown', this.escapeHandler);\n this.escapeHandler = null;\n }\n }\n\n /** @ignore - Compute motion attribute for animations */\n getMotionAttribute(): string | null {\n if (!isRootNavigationMenu(this.context)) return null;\n\n const itemValues = Array.from(this.context.viewportContent?.() ?? new Map()).map(([value]) => value);\n\n return getMotionAttribute(\n this.context.value(),\n this.context.previousValue(),\n this.item.value(),\n itemValues,\n this.context.dir\n );\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n Renderer2,\n runInInjectionContext,\n signal,\n untracked\n} from '@angular/core';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\n\n@Directive({\n selector: '[rdxNavigationMenuIndicator]',\n host: {\n '[attr.data-state]': 'isVisible() ? \"visible\" : \"hidden\"',\n '[attr.data-orientation]': 'context.orientation',\n '[style.display]': 'isVisible() ? null : \"none\"',\n 'aria-hidden': 'true'\n }\n})\nexport class RdxNavigationMenuIndicatorDirective implements OnDestroy {\n private readonly context = injectNavigationMenu();\n private readonly elementRef = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n\n /**\n * Used to keep the indicator rendered and available in the DOM, even when hidden.\n * Useful for animations.\n * @default false\n */\n readonly forceMount = input(false, { transform: booleanAttribute });\n\n /** @ignore */\n private readonly _position = signal<{ size: number; offset: number } | null>(null);\n /** @ignore */\n private readonly _activeTrigger = signal<HTMLElement | null>(null);\n /** @ignore */\n private readonly _resizeObserver = new ResizeObserver(() => this.updatePosition());\n\n readonly isVisible = computed(() => Boolean(this.context.value() || this.forceMount()));\n\n constructor() {\n // set up effect for tracking active trigger and position\n effect(() => {\n // this effect runs when the current value changes\n const value = this.context.value();\n\n untracked(() => {\n if (value && isRootNavigationMenu(this.context)) {\n this.findAndSetActiveTrigger();\n }\n });\n });\n\n // initialize observers for position tracking\n runInInjectionContext(this.context as any, () => {\n if (isRootNavigationMenu(this.context) && this.context.indicatorTrack) {\n const track = this.context.indicatorTrack();\n if (track) {\n // observe size changes on the track\n this._resizeObserver.observe(track);\n }\n\n // initial position update if menu is open\n if (this.context.value()) {\n setTimeout(() => this.findAndSetActiveTrigger(), 0);\n }\n }\n });\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._resizeObserver.disconnect();\n }\n\n /** @ignore */\n private findAndSetActiveTrigger(): void {\n if (!isRootNavigationMenu(this.context) || !this.context.indicatorTrack) return;\n\n const track = this.context.indicatorTrack();\n if (!track) return;\n\n // find all triggers within the track\n const triggers = Array.from(track.querySelectorAll('[rdxNavigationMenuTrigger]')) as HTMLElement[];\n\n // find the active trigger based on the current menu value\n const activeTrigger = triggers.find((trigger) => {\n const item = trigger.closest('[rdxNavigationMenuItem]');\n if (!item) return false;\n\n const value = item.getAttribute('value');\n return value === this.context.value();\n });\n\n if (activeTrigger && activeTrigger !== this._activeTrigger()) {\n this._activeTrigger.set(activeTrigger);\n this.updatePosition();\n }\n }\n\n /** @ignore */\n private updatePosition(): void {\n const trigger = this._activeTrigger();\n if (!trigger) return;\n\n const isHorizontal = this.context.orientation === 'horizontal';\n\n // calculate new position\n const newPosition = {\n size: isHorizontal ? trigger.offsetWidth : trigger.offsetHeight,\n offset: isHorizontal ? trigger.offsetLeft : trigger.offsetTop\n };\n\n // only update if position has changed\n if (JSON.stringify(newPosition) !== JSON.stringify(this._position())) {\n this._position.set(newPosition);\n\n // apply position styles\n const styles = isHorizontal\n ? {\n position: 'absolute',\n left: '0',\n width: `${newPosition.size}px`,\n transform: `translateX(${newPosition.offset}px)`\n }\n : {\n position: 'absolute',\n top: '0',\n height: `${newPosition.size}px`,\n transform: `translateY(${newPosition.offset}px)`\n };\n\n Object.entries(styles).forEach(([key, value]) => {\n this.renderer.setStyle(this.elementRef.nativeElement, key, value);\n });\n }\n }\n}\n","import { booleanAttribute, Directive, ElementRef, inject, input, OnInit } from '@angular/core';\nimport { ENTER, SPACE } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxNavigationMenuFocusableOption } from './navigation-menu.types';\nimport { generateId } from './utils';\n\nconst LINK_SELECT = 'navigationMenu.linkSelect';\nconst ROOT_CONTENT_DISMISS = 'navigationMenu.rootContentDismiss';\n\n@Directive({\n selector: '[rdxNavigationMenuLink]',\n hostDirectives: [{ directive: RdxRovingFocusItemDirective, inputs: ['focusable'] }],\n host: {\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.aria-current]': 'active() ? \"page\" : undefined',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeydown($event)'\n },\n providers: [{ provide: RdxNavigationMenuFocusableOption, useExisting: RdxNavigationMenuLinkDirective }]\n})\nexport class RdxNavigationMenuLinkDirective extends RdxNavigationMenuFocusableOption implements OnInit {\n private readonly rovingFocusItem = inject(RdxRovingFocusItemDirective, { self: true });\n private readonly uniqueId = generateId();\n readonly active = input(false, { transform: booleanAttribute });\n readonly onSelect = input<(event: Event) => void>();\n readonly elementRef = inject(ElementRef);\n\n ngOnInit(): void {\n this.rovingFocusItem.tabStopId = this.elementRef.nativeElement.id || `link-${this.uniqueId}`;\n }\n\n override focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n onClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n\n // dispatch link select event\n const linkSelectEvent = new CustomEvent(LINK_SELECT, {\n bubbles: true,\n cancelable: true\n });\n\n // add one-time listener for onSelect handler\n const onSelect = this.onSelect();\n if (onSelect) {\n target.addEventListener(LINK_SELECT, onSelect, { once: true });\n }\n\n // dispatch event\n target.dispatchEvent(linkSelectEvent);\n\n // if not prevented and not meta key, dismiss content\n if (!linkSelectEvent.defaultPrevented && !event.metaKey) {\n const dismissEvent = new CustomEvent(ROOT_CONTENT_DISMISS, {\n bubbles: true,\n cancelable: true\n });\n target.dispatchEvent(dismissEvent);\n }\n }\n\n onKeydown(event: KeyboardEvent): void {\n // activate link on Enter or Space\n if (event.key === ENTER || event.key === SPACE) {\n // prevent default behavior like scrolling (Space) or form submission (Enter) BEFORE simulating the click.\n event.preventDefault();\n\n // simulate a click event on the link element itself\n const clickEvent = new MouseEvent('click', { bubbles: true, cancelable: true });\n this.elementRef.nativeElement.dispatchEvent(clickEvent);\n\n return;\n }\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n AfterViewInit,\n contentChildren,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n Renderer2\n} from '@angular/core';\nimport { TAB } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus'; // Import Roving Focus Group\nimport { RdxNavigationMenuItemDirective } from './navigation-menu-item.directive';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\n\n@Directive({\n selector: '[rdxNavigationMenuList]',\n hostDirectives: [RdxRovingFocusGroupDirective],\n host: {\n role: 'menubar',\n '(keydown)': 'onKeydown($event)'\n }\n})\nexport class RdxNavigationMenuListDirective implements AfterContentInit, AfterViewInit {\n private readonly context = injectNavigationMenu();\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly renderer = inject(Renderer2);\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n /**\n * @private\n * @ignore\n */\n readonly items = contentChildren(\n forwardRef(() => RdxNavigationMenuItemDirective),\n { descendants: true }\n );\n\n /**\n * @ignore\n */\n protected keyManager: FocusKeyManager<RdxNavigationMenuItemDirective>;\n\n /**\n * @ignore\n */\n ngAfterContentInit(): void {\n const items = this.items();\n this.keyManager = new FocusKeyManager(items);\n\n if (this.context.orientation === 'horizontal') {\n this.keyManager.withHorizontalOrientation(this.context.dir || 'ltr');\n } else {\n this.keyManager.withVerticalOrientation();\n }\n }\n\n /**\n * @ignore\n */\n ngAfterViewInit() {\n this.rovingFocusGroup.orientation = this.context.orientation;\n this.rovingFocusGroup.dir = this.context.dir;\n\n // looping typically only applies to the root menu bar\n if (isRootNavigationMenu(this.context)) {\n this.rovingFocusGroup.loop = this.context.loop ?? false;\n } else {\n this.rovingFocusGroup.loop = false;\n }\n\n if (isRootNavigationMenu(this.context) && this.context.onIndicatorTrackChange) {\n const listElement = this.elementRef.nativeElement;\n const parent = listElement.parentNode;\n\n // ensure parent exists and list hasn't already been wrapped\n if (parent && !listElement.parentElement?.hasAttribute('data-radix-navigation-menu-list-wrapper')) {\n // create a wrapper div with relative positioning\n const wrapper = this.renderer.createElement('div');\n this.renderer.setAttribute(wrapper, 'data-radix-navigation-menu-list-wrapper', ''); // Add marker\n this.renderer.setStyle(wrapper, 'position', 'relative');\n\n // insert the wrapper before the list element in the parent\n this.renderer.insertBefore(parent, wrapper, listElement);\n\n // move the list element inside the new wrapper\n this.renderer.appendChild(wrapper, listElement);\n\n // register the wrapper element as the track for the indicator positioning\n this.context.onIndicatorTrackChange(wrapper);\n } else if (listElement.parentElement?.hasAttribute('data-radix-navigation-menu-list-wrapper')) {\n // if wrapper somehow already exists, ensure context has the correct reference\n this.context.onIndicatorTrackChange(listElement.parentElement);\n }\n }\n }\n\n /**\n * @ignore\n */\n onKeydown(event: KeyboardEvent) {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n\n if (event.key === TAB && event.shiftKey) {\n if (this.keyManager.activeItemIndex === 0) return;\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n } else if (event.key === TAB) {\n const items = this.items();\n if (this.keyManager.activeItemIndex === items.length - 1) {\n return;\n }\n this.keyManager.setNextItemActive();\n event.preventDefault();\n } else {\n this.keyManager.onKeydown(event);\n }\n }\n\n /**\n * @ignore\n */\n setActiveItem(item: RdxNavigationMenuItemDirective) {\n this.keyManager.setActiveItem(item);\n }\n}\n","import {\n booleanAttribute,\n Directive,\n effect,\n ElementRef,\n inject,\n Input,\n numberAttribute,\n OnDestroy,\n signal,\n WritableSignal\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectDocument, injectWindow } from '@radix-ng/primitives/core';\nimport { debounce, map, Subject, tap, timer } from 'rxjs';\nimport { provideNavigationMenuContext } from './navigation-menu.token';\nimport { RdxNavigationMenuAnimationStatus } from './navigation-menu.types';\nimport { generateId } from './utils';\n\n// define action types for clearer intent\nexport enum RdxNavigationMenuAction {\n OPEN = 'open',\n CLOSE = 'close'\n}\n\n@Directive({\n selector: '[rdxNavigationMenu]',\n providers: [provideNavigationMenuContext(RdxNavigationMenuDirective)],\n host: {\n '[attr.data-orientation]': 'orientation',\n '[attr.dir]': 'dir',\n 'aria-label': 'Main',\n role: 'navigation'\n },\n exportAs: 'rdxNavigationMenu'\n})\nexport class RdxNavigationMenuDirective implements OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly document = injectDocument();\n private readonly window = injectWindow();\n\n // State\n readonly #value = signal<string>('');\n readonly #previousValue = signal<string>('');\n readonly baseId = `rdx-nav-menu-${generateId()}`;\n readonly #indicatorTrack = signal<HTMLElement | null>(null);\n readonly #viewport = signal<HTMLElement | null>(null);\n readonly #viewportContent = signal<Map<string, any>>(new Map());\n readonly #rootNavigationMenu = signal<HTMLElement | null>(this.elementRef.nativeElement);\n\n readonly #userDismissedByClick = signal(false);\n userDismissedByClick = () => this.#userDismissedByClick();\n resetUserDismissed = () => this.#userDismissedByClick.set(false);\n\n // delay timers\n private openTimerRef = 0;\n private closeTimerRef = 0;\n private skipDelayTimerRef = 0;\n readonly #isOpenDelayed = signal(true);\n\n // pointer tracking\n readonly #isPointerOverContent = signal(false);\n readonly #isPointerOverTrigger = signal(false);\n private documentMouseLeaveHandler: ((e: Event) => void) | null = null;\n\n readonly actionSubject$ = new Subject<{ action: RdxNavigationMenuAction; itemValue?: string }>();\n\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n @Input() dir: 'ltr' | 'rtl' = 'ltr';\n @Input({ transform: numberAttribute }) delayDuration = 200;\n @Input({ transform: numberAttribute }) skipDelayDuration = 300;\n @Input({ transform: booleanAttribute }) loop = false;\n @Input({ transform: booleanAttribute }) cssAnimation = false;\n @Input({ transform: booleanAttribute }) cssOpeningAnimation = false;\n @Input({ transform: booleanAttribute }) cssClosingAnimation = false;\n\n readonly isRootMenu = true;\n readonly cssAnimationStatus: WritableSignal<RdxNavigationMenuAnimationStatus | null> = signal(null);\n\n // exposed state as functions for the token\n value = () => this.#value();\n previousValue = () => this.#previousValue();\n rootNavigationMenu = () => this.#rootNavigationMenu();\n indicatorTrack = () => this.#indicatorTrack();\n viewport = () => this.#viewport();\n viewportContent = () => this.#viewportContent();\n\n // exposed pointer state\n setTriggerPointerState = (isOver: boolean) => this.#isPointerOverTrigger.set(isOver);\n setContentPointerState = (isOver: boolean) => this.#isPointerOverContent.set(isOver);\n isPointerInSystem = () => this.#isPointerOverContent() || this.#isPointerOverTrigger();\n\n // exposed animation state\n getCssAnimation = () => this.cssAnimation;\n getCssOpeningAnimation = () => this.cssOpeningAnimation;\n getCssClosingAnimation = () => this.cssClosingAnimation;\n\n constructor() {\n effect(() => {\n const value = this.#value();\n if (value) {\n this.window.clearTimeout(this.skipDelayTimerRef);\n if (this.skipDelayDuration > 0) {\n this.#isOpenDelayed.set(false);\n }\n } else {\n // menu is closed, start skip delay timer\n this.window.clearTimeout(this.skipDelayTimerRef);\n this.skipDelayTimerRef = this.window.setTimeout(() => {\n this.#isOpenDelayed.set(true);\n }, this.skipDelayDuration);\n }\n });\n\n this.actionSubject$\n .pipe(\n map((config) => {\n // different delays for open vs close (better ux)\n const duration = config.action === RdxNavigationMenuAction.OPEN ? this.delayDuration : 150;\n return { ...config, duration };\n }),\n debounce((config) => timer(config.duration)),\n tap((config) => {\n switch (config.action) {\n case RdxNavigationMenuAction.OPEN:\n if (config.itemValue) {\n this.setValue(config.itemValue);\n }\n break;\n case RdxNavigationMenuAction.CLOSE:\n // only close if not hovering over any part of the system\n if (!this.isPointerInSystem()) {\n this.setValue('');\n }\n break;\n }\n }),\n takeUntilDestroyed()\n )\n .subscribe();\n\n // set up document mouseleave handler to close menu when mouse leaves window\n this.documentMouseLeaveHandler = () => this.handleClose();\n this.document.addEventListener('mouseleave', this.documentMouseLeaveHandler);\n }\n\n ngOnDestroy() {\n this.window.clearTimeout(this.openTimerRef);\n this.window.clearTimeout(this.closeTimerRef);\n this.window.clearTimeout(this.skipDelayTimerRef);\n\n // clean up document event listener\n if (this.documentMouseLeaveHandler) {\n document.removeEventListener('mouseleave', this.documentMouseLeaveHandler);\n }\n }\n\n onIndicatorTrackChange(track: HTMLElement | null) {\n this.#indicatorTrack.set(track);\n }\n\n onViewportChange(viewport: HTMLElement | null) {\n this.#viewport.set(viewport);\n }\n\n onTriggerEnter(itemValue: string) {\n // skip opening if user explicitly dismissed this menu\n if (this.#userDismissedByClick() && itemValue === this.#previousValue()) {\n return;\n }\n\n this.window.clearTimeout(this.openTimerRef);\n this.window.clearTimeout(this.closeTimerRef);\n\n if (this.#isOpenDelayed()) {\n this.handleDelayedOpen(itemValue);\n } else {\n this.handleOpen(itemValue);\n }\n }\n\n onTriggerLeave() {\n this.window.clearTimeout(this.openTimerRef);\n this.startCloseTimer();\n }\n\n onContentEnter() {\n this.window.clearTimeout(this.closeTimerRef);\n }\n\n onContentLeave() {\n this.startCloseTimer();\n }\n\n handleClose() {\n this.actionSubject$.next({ action: RdxNavigationMenuAction.CLOSE });\n }\n\n onItemSelect(itemValue: string) {\n const wasOpen = this.#value() === itemValue;\n const newValue = wasOpen ? '' : itemValue;\n\n // if user is closing an open menu, mark as user-dismissed\n if (wasOpen) {\n this.#userDismissedByClick.set(true);\n } else {\n this.#userDismissedByClick.set(false);\n }\n\n this.setValue(newValue);\n }\n\n onItemDismiss() {\n this.setValue('');\n }\n\n onViewportContentChange(contentValue: string, contentData: any) {\n const newMap = new Map(this.#viewportContent());\n newMap.set(contentValue, contentData);\n this.#viewportContent.set(newMap);\n }\n\n onViewportContentRemove(contentValue: string) {\n const newMap = new Map(this.#viewportContent());\n if (newMap.has(contentValue)) {\n newMap.delete(contentValue);\n this.#viewportContent.set(newMap);\n }\n }\n\n private setValue(value: string) {\n // Store previous value before changing\n this.#previousValue.set(this.#value());\n this.#value.set(value);\n }\n\n private startCloseTimer() {\n this.window.clearTimeout(this.closeTimerRef);\n this.closeTimerRef = this.window.setTimeout(() => {\n // only close if not hovering over any part of the system\n if (!this.isPointerInSystem()) {\n this.setValue('');\n }\n }, 150);\n }\n\n private handleOpen(itemValue: string) {\n this.window.clearTimeout(this.closeTimerRef);\n this.setValue(itemValue);\n }\n\n private handleDelayedOpen(itemValue: string) {\n const isOpenItem = this.#value() === itemValue;\n if (isOpenItem) {\n // if the item is already open, clear close timer\n this.window.clearTimeout(this.closeTimerRef);\n } else {\n // otherwise, start the open timer\n this.openTimerRef = this.window.setTimeout(() => {\n this.window.clearTimeout(this.closeTimerRef);\n this.setValue(itemValue);\n }, this.delayDuration);\n }\n }\n}\n","import { Directive, inject, Input, input, output, signal } from '@angular/core';\nimport { RdxNavigationMenuDirective } from './navigation-menu.directive';\nimport { provideNavigationMenuContext } from './navigation-menu.token';\nimport { generateId } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuSub]',\n providers: [provideNavigationMenuContext(RdxNavigationMenuSubDirective)],\n host: {\n '[attr.data-orientation]': 'orientation()'\n }\n})\nexport class RdxNavigationMenuSubDirective {\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n @Input() set defaultValue(val: string) {\n if (val) this.value.set(val);\n }\n\n readonly valueChange = output<string>();\n\n readonly value = signal<string>('');\n readonly previousValue = signal<string>('');\n readonly baseId = `rdx-nav-menu-sub-${generateId()}`;\n readonly isRootMenu = false;\n\n private readonly parent = inject(RdxNavigationMenuDirective, { optional: true });\n\n get dir(): 'ltr' | 'rtl' {\n if (!this.parent) {\n return 'ltr';\n }\n\n return this.parent.dir || 'ltr';\n }\n\n get rootNavigationMenu(): HTMLElement | null {\n return this.parent?.rootNavigationMenu() || null;\n }\n\n onTriggerEnter(itemValue: string) {\n this.setValue(itemValue);\n }\n\n onItemSelect(itemValue: string) {\n this.setValue(itemValue);\n }\n\n onItemDismiss() {\n this.setValue('');\n }\n\n private setValue(value: string) {\n this.previousValue.set(this.value());\n this.value.set(value);\n this.valueChange.emit(value);\n }\n}\n","import {\n booleanAttribute,\n ComponentRef,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n untracked,\n ViewContainerRef\n} from '@angular/core';\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ENTER, SPACE, TAB } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport {\n RdxNavigationMenuAriaOwnsComponent,\n RdxNavigationMenuFocusProxyComponent\n} from './navigation-menu-a11y.component';\nimport { RdxNavigationMenuItemDirective } from './navigation-menu-item.directive';\nimport { RdxNavigationMenuListDirective } from './navigation-menu-list.directive';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { RdxNavigationMenuFocusableOption } from './navigation-menu.types';\nimport { getTabbableCandidates, makeContentId, makeTriggerId } from './utils';\n\n@Directive({\n selector: '[rdxNavigationMenuTrigger]',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[id]': 'triggerId',\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'context.orientation',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[disabled]': 'disabled() ? true : null',\n '[attr.aria-expanded]': 'open()',\n '[attr.aria-controls]': 'contentId',\n '[attr.aria-haspopup]': '\"menu\"',\n '(pointerenter)': 'onPointerEnter()',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerleave)': 'onPointerLeave($event)',\n '(click)': 'onClick()',\n '(keydown)': 'onKeydown($event)',\n type: 'button'\n },\n providers: [{ provide: RdxNavigationMenuFocusableOption, useExisting: RdxNavigationMenuTriggerDirective }]\n})\nexport class RdxNavigationMenuTriggerDirective extends RdxNavigationMenuFocusableOption implements OnInit, OnDestroy {\n private readonly context = injectNavigationMenu();\n private readonly item = inject(RdxNavigationMenuItemDirective);\n private readonly list = inject(RdxNavigationMenuListDirective);\n private readonly rovingFocusItem = inject(RdxRovingFocusItemDirective, { self: true });\n private readonly elementRef = inject(ElementRef);\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly triggerId = makeTriggerId(this.context.baseId, this.item.value());\n readonly contentId = makeContentId(this.context.baseId, this.item.value());\n readonly open = computed(() => {\n return this.item.value() === this.context.value();\n });\n\n private focusProxyRef: ComponentRef<RdxNavigationMenuFocusProxyComponent> | null = null;\n private ariaOwnsRef: ComponentRef<RdxNavigationMenuAriaOwnsComponent> | null = null;\n\n private hasPointerMoveOpened = false;\n private wasClickClose = false;\n\n constructor() {\n super();\n\n effect(() => {\n this.rovingFocusItem.focusable = !this.disabled();\n });\n\n effect(() => {\n const isOpen = this.open();\n\n untracked(() => {\n // handle focus proxy and aria-owns when open state changes\n if (isOpen) {\n this.createAccessibilityComponents();\n } else {\n this.removeAccessibilityComponents();\n\n if (!this.item.wasEscapeCloseRef()) {\n this.item.onRootContentClose();\n }\n\n this.hasPointerMoveOpened = false;\n }\n });\n });\n }\n\n ngOnInit() {\n this.item.triggerRef.set(this.elementRef.nativeElement);\n\n // configure the static part of the roving focus item directive instance\n this.rovingFocusItem.tabStopId = this.item.value();\n }\n\n ngOnDestroy() {\n this.removeAccessibilityComponents();\n }\n\n override focus() {\n this.elementRef.nativeElement.focus();\n }\n\n private createAccessibilityComponents(): void {\n if (this.focusProxyRef || this.ariaOwnsRef) {\n return;\n }\n\n // create focus proxy component\n this.focusProxyRef = this.viewContainerRef.createComponent(RdxNavigationMenuFocusProxyComponent);\n this.focusProxyRef.instance.triggerElement = this.elementRef.nativeElement;\n this.focusProxyRef.instance.contentElement = this.item.contentRef();\n this.focusProxyRef.instance.proxyFocus.subscribe((direction: 'start' | 'end') => {\n this.item.onFocusProxyEnter(direction);\n });\n\n // store reference in item directive\n this.item.focusProxyRef.set(this.focusProxyRef.location.nativeElement);\n\n // only add aria-owns component if using viewport\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n this.ariaOwnsRef = this.viewContainerRef.createComponent(RdxNavigationMenuAriaOwnsComponent);\n this.ariaOwnsRef.instance.contentId = this.contentId;\n }\n }\n\n private removeAccessibilityComponents(): void {\n if (this.focusProxyRef) {\n this.focusProxyRef.destroy();\n this.focusProxyRef = null;\n this.item.focusProxyRef.set(null);\n }\n\n if (this.ariaOwnsRef) {\n this.ariaOwnsRef.destroy();\n this.ariaOwnsRef = null;\n }\n }\n\n onPointerEnter(): void {\n // ignore if disabled or not the root menu (hover logic primarily for root)\n if (this.disabled() || !isRootNavigationMenu(this.context)) return;\n\n this.wasClickClose = false; // Reset click close flag on enter\n this.item.wasEscapeCloseRef.set(false); // Reset escape flag\n this.context.setTriggerPointerState?.(true); // Update context state\n\n // if the menu isn't already open for this item, trigger the enter logic (handles delays)\n if (!this.open()) {\n this.context.onTriggerEnter?.(this.item.value());\n }\n }\n\n onPointerMove(event: PointerEvent): void {\n // ignore if not a mouse event, disabled, closed by click/escape, or already opened by this move\n if (\n event.pointerType !== 'mouse' ||\n this.disabled() ||\n this.wasClickClose ||\n this.item.wasEscapeCloseRef() ||\n this.hasPointerMoveOpened ||\n !isRootNavigationMenu(this.context)\n ) {\n return;\n }\n // trigger enter logic (handles delays) and mark that this move initiated an open attempt\n this.context.onTriggerEnter?.(this.item.value());\n this.hasPointerMoveOpened = true;\n }\n\n onPointerLeave(event: PointerEvent): void {\n // ignore if not a mouse event or disabled\n if (event.pointerType !== 'mouse' || this.disabled() || !isRootNavigationMenu(this.context)) {\n return;\n }\n\n this.context.setTriggerPointerState?.(false); // Update context state\n this.context.onTriggerLeave?.(); // Trigger leave logic (handles delays)\n this.hasPointerMoveOpened = false; // Reset flag\n\n // reset user dismissal flag if pointer leaves the whole system (trigger + content)\n if (this.context.resetUserDismissed) {\n // relay slightly to allow pointer movement to content area without resetting dismissal state\n setTimeout(() => {\n if (!this.context.isPointerInSystem?.()) {\n this.context.resetUserDismissed?.();\n }\n }, 50); // small delay for tolerance\n }\n }\n\n onClick(): void {\n if (this.disabled()) return;\n\n // manually set the `KeyManager` active item to this trigger\n this.list.setActiveItem(this.item);\n\n if (this.context.onItemSelect) {\n this.context.onItemSelect(this.item.value());\n // track if this click action resulted in closing the menu\n this.wasClickClose = !this.open();\n // reset escape flag if menu was opened by click\n if (this.open()) {\n this.item.wasEscapeCloseRef.set(false);\n }\n }\n }\n\n onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) return;\n\n if (event.key === ENTER || event.key === SPACE) {\n event.preventDefault(); // prevent default button behavior\n this.onClick();\n\n // if menu was opened by this keypress, move focus into the content\n if (this.open()) {\n // defer focus slightly to ensure content is ready\n setTimeout(() => this.item.onEntryKeyDown(), 0);\n }\n return;\n }\n\n const isHorizontal = this.context.orientation === 'horizontal';\n const isRTL = this.context.dir === 'rtl';\n\n // handle `ArrowDown` specifically for viewport navigation\n if (event.key === ARROW_DOWN || event.key === TAB) {\n if (event.key === ARROW_DOWN) {\n event.preventDefault();\n }\n\n // if the menu is open, focus into the content\n if (this.open()) {\n if (event.key === TAB) {\n // needed to ensure that the `keyManager` on the list directive does not activate\n // any focus updates, shifting focus to the subsequent focusable list item\n event.stopImmediatePropagation();\n }\n\n // direct focus handling for viewport case\n if (isRootNavigationMenu(this.context) && this.context.viewport && this.context.viewport()) {\n // get the viewport element\n const viewport = this.context.viewport();\n if (viewport) {\n // find all tabbable elements in the viewport\n const tabbables = getTabbableCandidates(viewport);\n if (tabbables.length > 0) {\n // focus the first tabbable element directly\n setTimeout(() => {\n tabbables[0].focus();\n }, 0);\n return;\n }\n }\n }\n\n // fallback to the standard entry key down approach\n setTimeout(() => this.item.onEntryKeyDown(), 0);\n return;\n }\n\n // if not open but in horizontal orientation, emulate right key navigation\n if (isHorizontal) {\n const nextEvent = new KeyboardEvent('keydown', {\n key: isRTL ? ARROW_LEFT : ARROW_RIGHT,\n bubbles: true\n });\n this.elementRef.nativeElement.dispatchEvent(nextEvent);\n return;\n }\n }\n\n // handle ArrowUp in horizontal orientation\n if (isHorizontal && event.key === ARROW_UP) {\n event.preventDefault();\n\n // emulate a left key press to move to the previous item\n const nextEvent = new KeyboardEvent('keydown', {\n key: isRTL ? ARROW_RIGHT : ARROW_LEFT,\n bubbles: true\n });\n this.elementRef.nativeElement.dispatchEvent(nextEvent);\n return;\n }\n\n // handle vertical navigation and entry into content\n const verticalEntryKey = isRTL ? ARROW_LEFT : ARROW_RIGHT;\n const entryKey = isHorizontal ? ARROW_DOWN : verticalEntryKey;\n\n if (this.item.contentRef() && event.key === entryKey && event.key !== ARROW_DOWN) {\n // Skip if it's ArrowDown as we already handled it above\n event.preventDefault();\n\n if (!this.open()) {\n // if closed, open the menu first\n this.context.onItemSelect?.(this.item.value());\n // defer focus movement into content until after state update and render\n setTimeout(() => this.item.onEntryKeyDown(), 0);\n } else {\n // if already open, just move focus into the content\n this.item.onEntryKeyDown();\n }\n return;\n }\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n Renderer2,\n signal,\n untracked,\n ViewContainerRef\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ARROW_DOWN, ARROW_UP, injectDocument, injectWindow } from '@radix-ng/primitives/core';\nimport { TransitionOptions, TransitionStartFn, usePresence } from '@radix-ng/primitives/presence';\nimport { Subscription } from 'rxjs';\nimport { injectNavigationMenu, isRootNavigationMenu } from './navigation-menu.token';\nimport { getOpenStateLabel, getTabbableCandidates } from './utils';\n\ninterface ContentNode {\n embeddedView: EmbeddedViewRef<unknown>;\n element: HTMLElement;\n contentValue: string;\n state: 'open' | 'closed';\n transitionSubscription?: Subscription | null;\n}\n\n@Directive({\n selector: '[rdxNavigationMenuViewport]',\n host: {\n '[attr.data-state]': 'dataState()',\n '[attr.data-orientation]': 'context.orientation',\n '[style.--radix-navigation-menu-viewport-width.px]': 'viewportSize()?.width',\n '[style.--radix-navigation-menu-viewport-height.px]': 'viewportSize()?.height',\n '(keydown)': 'onKeydown($event)',\n '(pointerenter)': 'onPointerEnter()',\n '(pointerleave)': 'onPointerLeave()'\n }\n})\nexport class RdxNavigationMenuViewportDirective implements OnInit, OnDestroy {\n private readonly context = injectNavigationMenu();\n private readonly document = injectDocument();\n private readonly window = injectWindow();\n private readonly elementRef = inject(ElementRef);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly renderer = inject(Renderer2);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Used to keep the viewport rendered and available in the DOM, even when closed.\n * Useful for animations.\n * @default false\n */\n readonly forceMount = input(false, { transform: booleanAttribute });\n\n private readonly _contentNodes = signal(new Map<string, ContentNode>());\n private readonly _activeContentNode = signal<ContentNode | null>(null);\n private readonly _leavingContentNode = signal<ContentNode | null>(null);\n private readonly _viewportSize = signal<{ width: number; height: number } | null>(null);\n\n readonly activeContentValue = computed(() => {\n if (!isRootNavigationMenu(this.context)) return null;\n return this.context.value() || this.context.previousValue();\n });\n readonly isOpen = computed(() => {\n if (!isRootNavigationMenu(this.context)) return false;\n return Boolean(this.context.value() || this.forceMount());\n });\n readonly dataState = computed(() => getOpenStateLabel(this.isOpen()));\n readonly viewportSize = computed(() => this._viewportSize());\n\n private readonly _resizeObserver = new ResizeObserver(() => this.updateSize());\n\n constructor() {\n this.setupViewportEffect();\n }\n\n ngOnInit() {\n if (isRootNavigationMenu(this.context) && this.context.onViewportChange) {\n this.context.onViewportChange(this.elementRef.nativeElement);\n }\n }\n\n ngOnDestroy() {\n this._resizeObserver.disconnect();\n // clean up any remaining nodes/views/subscriptions\n this._contentNodes().forEach((node) => this.cleanupAfterLeave(node));\n if (isRootNavigationMenu(this.context) && this.context.onViewportChange) {\n this.context.onViewportChange(null);\n }\n }\n\n onKeydown(event: KeyboardEvent): void {\n if (!this.isOpen()) return;\n const tabbableElements = getTabbableCandidates(this.elementRef.nativeElement);\n if (!tabbableElements.length) return;\n const activeElement = this.document.activeElement as HTMLElement | null;\n const currentIndex = tabbableElements.findIndex((el) => el === activeElement);\n\n if (event.key === ARROW_DOWN) {\n event.preventDefault();\n const nextIndex = currentIndex >= 0 && currentIndex < tabbableElements.length - 1 ? currentIndex + 1 : 0;\n tabbableElements[nextIndex]?.focus();\n } else if (event.key === ARROW_UP) {\n event.preventDefault();\n const prevIndex = currentIndex > 0 ? currentIndex - 1 : tabbableElements.length - 1;\n tabbableElements[prevIndex]?.focus();\n }\n }\n\n onPointerEnter(): void {\n if (isRootNavigationMenu(this.context) && this.context.onContentEnter) {\n this.context.onContentEnter();\n }\n if (isRootNavigationMenu(this.context) && this.context.setContentPointerState) {\n this.context.setContentPointerState(true);\n }\n }\n\n onPointerLeave(): void {\n if (isRootNavigationMenu(this.context) && this.context.onContentLeave) {\n this.context.onContentLeave();\n }\n if (isRootNavigationMenu(this.context) && this.context.setContentPointerState) {\n this.context.setContentPointerState(false);\n }\n }\n\n private setupViewportEffect(): void {\n effect(() => {\n const currentActiveValue = this.context.value();\n const previousActiveValue = this.context.previousValue();\n const forceMount = this.forceMount();\n\n untracked(() => {\n // ensure context is root before proceeding\n if (!isRootNavigationMenu(this.context) || !this.context.viewportContent) {\n return;\n }\n\n const allContentData = this.context.viewportContent();\n const currentNodesMap = this._contentNodes();\n let enteringNode: ContentNode | null = null;\n let leavingNode = this._leavingContentNode(); // get potentially already leaving node\n\n // 1. Identify Entering Node\n if (currentActiveValue && allContentData.has(currentActiveValue)) {\n enteringNode = this.getOrCreateContentNode(currentActiveValue);\n }\n\n // 2. Identify Leaving Node\n const nodeThatWasActive = previousActiveValue ? currentNodesMap.get(previousActiveValue) : null;\n // if there was a previously active node, it's different from the entering one,\n // and it's not already leaving, mark it for removal.\n if (nodeThatWasActive && nodeThatWasActive !== enteringNode && nodeThatWasActive !== leavingNode) {\n // if another node was already leaving, force complete its transition\n if (leavingNode) {\n this.forceCompleteLeaveTransition(leavingNode);\n }\n leavingNode = nodeThatWasActive;\n this._leavingContentNode.set(leavingNode);\n }\n\n // 3. Handle Entering Node\n if (enteringNode) {\n // cancel any pending leave transition for this node if it was leaving\n if (enteringNode === leavingNode) {\n this.cancelLeaveTransition(enteringNode);\n leavingNode = null;\n this._leavingContentNode.set(null);\n }\n // ensure it's in the DOM and set state to open\n this.addNodeToDOM(enteringNode);\n this.setNodeState(enteringNode, 'open'); // Triggers enter animation via data-state\n this._activeContentNode.set(enteringNode);\n this.updateSize(); // Update size based on the entering node\n } else {\n // no node entering, clear active node state\n this._activeContentNode.set(null);\n }\n\n // 4. Handle Leaving Node\n if (leavingNode) {\n if (forceMount) {\n // if forceMount, just mark as closed, don't trigger removal animation\n this.setNodeState(leavingNode, 'closed');\n this._leavingContentNode.set(null); // No longer considered \"leaving\"\n } else {\n // start the leave transition (usePresence handles DOM removal)\n this.startLeaveTransition(leavingNode);\n }\n }\n });\n });\n }\n\n // gets or creates the ContentNode (wrapper + view)\n private getOrCreateContentNode(contentValue: string): ContentNode | null {\n const existingNode = this._contentNodes().get(contentValue);\n if (existingNode && !existingNode.embeddedView.destroyed) {\n return existingNode;\n }\n\n // create if doesn't exist or view was destroyed\n if (!isRootNavigationMenu(this.context) || !this.context.viewportContent) return null;\n const allContentData = this.context.viewportContent();\n const contentData = allContentData.get(contentValue);\n const templateRef = contentData?.templateRef;\n\n if (!templateRef) {\n console.error(`No templateRef found for content value: ${contentValue}`);\n return null;\n }\n\n try {\n const embeddedView = this.viewContainerRef.createEmbeddedView(templateRef);\n const container = this.renderer.createElement('div');\n this.renderer.setAttribute(container, 'class', 'NavigationMenuContentWrapper');\n this.renderer.setAttribute(container, 'data-content-value', contentValue);\n embeddedView.rootNodes.forEach((node: Node) => this.renderer.appendChild(container, node));\n\n const newNode: ContentNode = {\n embeddedView,\n element: container,\n contentValue,\n state: 'closed'\n };\n\n const newMap = new Map(this._contentNodes());\n newMap.set(contentValue, newNode);\n this._contentNodes.set(newMap);\n return newNode;\n } catch (error) {\n console.error(`Error creating content node for ${contentValue}:`, error);\n return null;\n }\n }\n\n // adds node element to viewport DOM if not already present\n private addNodeToDOM(node: ContentNode): void {\n if (!this.elementRef.nativeElement.contains(node.element)) {\n this.renderer.appendChild(this.elementRef.nativeElement, node.element);\n // observe size only when added to DOM\n this._resizeObserver.observe(node.element);\n }\n }\n\n // removes node element from viewport DOM\n private removeNodeFromDOM(node: ContentNode): void {\n if (this.elementRef.nativeElement.contains(node.element)) {\n this._resizeObserver.unobserve(node.element); // stop observing before removal\n this.renderer.removeChild(this.elementRef.nativeElement, node.element);\n }\n }\n\n // updates the data-state and motion attributes\n private setNodeState(node: ContentNode, state: 'open' | 'closed'): void {\n if (node.state === state) return; // avoid redundant updates\n\n node.state = state;\n this.renderer.setAttribute(node.element, 'data-state', state);\n\n // apply motion attribute based on context\n if (isRootNavigationMenu(this.context) && this.context.viewportContent) {\n const contentData = this.context.viewportContent().get(node.contentValue);\n if (contentData?.getMotionAttribute) {\n // get motion based on current state transition\n const motionAttr = contentData.getMotionAttribute();\n if (motionAttr) {\n this.renderer.setAttribute(node.element, 'data-motion', motionAttr);\n } else {\n this.renderer.removeAttribute(node.element, 'data-motion');\n }\n } else {\n this.renderer.removeAttribute(node.element, 'data-motion');\n }\n }\n\n // apply A11y attributes (might only be needed on open?)\n if (state === 'open') {\n this.applyA11yAttributes(node);\n }\n }\n\n // apply A11y attributes to the first child element\n private applyA11yAttributes(node: ContentNode): void {\n if (!isRootNavigationMenu(this.context) || !this.context.viewportContent) return;\n const contentData = this.context.viewportContent().get(node.contentValue);\n if (contentData?.additionalAttrs && node.embeddedView.rootNodes.length > 0) {\n const firstRootNode = node.embeddedView.rootNodes[0] as Element;\n if (firstRootNode) {\n Object.entries(contentData.additionalAttrs).forEach(([attr, value]) => {\n this.renderer.setAttribute(firstRootNode, attr, value as string);\n });\n }\n }\n }\n\n private startLeaveTransition(node: ContentNode): void {\n // ensure node exists and isn't already leaving with an active subscription\n if (!node || node.transitionSubscription) {\n node.transitionSubscription?.unsubscribe();\n return;\n }\n\n const startFn: TransitionStartFn<null> = () => {\n this.setNodeState(node, 'closed');\n return () => this.cleanupAfterLeave(node);\n };\n\n const options: TransitionOptions<null> = {\n animation: true, // assuming CSS animations/transitions handle the exit\n state: 'continue' // start the leave process\n };\n\n node.transitionSubscription = usePresence(this.zone, node.element, startFn, options)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n complete: () => {\n this.cleanupAfterLeave(node);\n }\n });\n }\n\n /**\n * Cleanup function called after leave animation finishes\n * @param node The node that is leaving\n */\n private cleanupAfterLeave(node: ContentNode): void {\n // check if this node is still marked as the one leaving\n if (this._leavingContentNode() === node) {\n this.removeNodeFromDOM(node);\n if (!this.forceMount() && node.embeddedView && !node.embeddedView.destroyed) {\n node.embeddedView.destroy();\n // Remove from cache if destroyed\n const newMap = new Map(this._contentNodes());\n newMap.delete(node.contentValue);\n this._contentNodes.set(newMap);\n }\n\n node.transitionSubscription = null;\n this._leavingContentNode.set(null);\n } else {\n // if this node is NOT the one currently marked as leaving, it means\n // a new transition started before this one finished. Just clean up DOM/Sub.\n this.removeNodeFromDOM(node);\n node.transitionSubscription?.unsubscribe();\n node.transitionSubscription = null;\n }\n }\n\n /**\n * Cancels an ongoing leave transition (e.g., if user hovers back)\n * @param node The node that is leaving\n */\n private cancelLeaveTransition(node: ContentNode): void {\n node.transitionSubscription?.unsubscribe();\n node.transitionSubscription = null;\n }\n\n /**\n * Force completes a leave transition (e.g., if another leave starts)\n * @param node The node that is leaving\n */\n private forceCompleteLeaveTransition(node: ContentNode): void {\n if (node && node.transitionSubscription) {\n node.transitionSubscription.unsubscribe();\n\n // perform cleanup immediately\n this.cleanupAfterLeave(node);\n }\n }\n\n private updateSize() {\n const activeNode = this._activeContentNode()?.element; // measure the currently active node\n if (!activeNode || !activeNode.isConnected) return;\n\n const firstChild = activeNode.firstChild as HTMLElement;\n if (!firstChild) return;\n\n this.window.requestAnimationFrame(() => {\n // keep rAF here for measurement stability\n activeNode.getBoundingClientRect(); // force layout\n const width = Math.ceil(firstChild.offsetWidth);\n const height = Math.ceil(firstChild.offsetHeight);\n\n if (width !== 0 || height !== 0) {\n const currentSize = this._viewportSize();\n if (!currentSize || currentSize.width !== width || currentSize.height !== height) {\n this._viewportSize.set({ width, height });\n }\n } else if (this._viewportSize() !== null) {\n this._viewportSize.set(null);\n }\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport {\n RdxNavigationMenuAriaOwnsComponent,\n RdxNavigationMenuFocusProxyComponent\n} from './src/navigation-menu-a11y.component';\nimport { RdxNavigationMenuContentDirective } from './src/navigation-menu-content.directive';\nimport { RdxNavigationMenuIndicatorDirective } from './src/navigation-menu-indicator.directive';\nimport { RdxNavigationMenuItemDirective } from './src/navigation-menu-item.directive';\nimport { RdxNavigationMenuLinkDirective } from './src/navigation-menu-link.directive';\nimport { RdxNavigationMenuListDirective } from './src/navigation-menu-list.directive';\nimport { RdxNavigationMenuSubDirective } from './src/navigation-menu-sub.directive';\nimport { RdxNavigationMenuTriggerDirective } from './src/navigation-menu-trigger.directive';\nimport { RdxNavigationMenuViewportDirective } from './src/navigation-menu-viewport.directive';\nimport { RdxNavigationMenuDirective } from './src/navigation-menu.directive';\n\nexport * from './src/navigation-menu-a11y.component';\nexport * from './src/navigation-menu-content.directive';\nexport * from './src/navigation-menu-indicator.directive';\nexport * from './src/navigation-menu-item.directive';\nexport * from './src/navigation-menu-link.directive';\nexport * from './src/navigation-menu-list.directive';\nexport * from './src/navigation-menu-sub.directive';\nexport * from './src/navigation-menu-trigger.directive';\nexport * from './src/navigation-menu-viewport.directive';\nexport * from './src/navigation-menu.directive';\nexport * from './src/navigation-menu.token';\nexport * from './src/navigation-menu.types';\n\nconst _imports = [\n RdxNavigationMenuDirective,\n RdxNavigationMenuSubDirective,\n RdxNavigationMenuListDirective,\n RdxNavigationMenuItemDirective,\n RdxNavigationMenuTriggerDirective,\n RdxNavigationMenuLinkDirective,\n RdxNavigationMenuIndicatorDirective,\n RdxNavigationMenuContentDirective,\n RdxNavigationMenuViewportDirective,\n RdxNavigationMenuFocusProxyComponent,\n RdxNavigationMenuAriaOwnsComponent\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxNavigationMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ROOT_CONTENT_DISMISS"],"mappings":";;;;;;;;;;;MAgBa,oCAAoC,CAAA;AAbjD,IAAA,WAAA,GAAA;QAca,IAAc,CAAA,cAAA,GAAuB,IAAI;QACzC,IAAc,CAAA,cAAA,GAAuB,IAAI;AACxC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAmB;AAW7D;AATG,IAAA,OAAO,CAAC,KAAiB,EAAA;AACrB,QAAA,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAmC;AACpE,QAAA,MAAM,iBAAiB,GAAG,kBAAkB,KAAK,IAAI,CAAC,cAAc;QACpE,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,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