@huin-core/react-navigation-menu 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/NavigationMenu.tsx", "../src/NavigationMenuSub.tsx", "../src/NavigationMenuItem.tsx", "../src/NavigationMenuLink.tsx", "../src/NavigationMenuContent.tsx", "../src/NavigationMenuViewport.tsx", "../src/NavigationMenuList.tsx", "../src/NavigationMenuTrigger.tsx", "../src/NavigationMenuIndicator.tsx"],
4
+ "sourcesContent": ["import * as React from \"react\";\nimport { createContextScope } from \"@huin-core/react-context\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { useControllableState } from \"@huin-core/react-use-controllable-state\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { useDirection } from \"@huin-core/react-direction\";\nimport { createCollection } from \"@huin-core/react-collection\";\nimport type { Scope } from \"@huin-core/react-context\";\nimport {\n NavigationMenuProvider,\n NavigationMenuProviderPrivateProps,\n NavigationMenuProviderProps,\n} from \"./NavigationMenuSub\";\nimport { NavigationMenuTriggerElement } from \"./NavigationMenuTrigger\";\nimport { FocusGroupItemElement } from \"./NavigationMenuLink\";\nimport {\n NavigationMenuContentElement,\n ViewportContentMounterElement,\n ViewportContentMounterProps,\n} from \"./NavigationMenuContent\";\nimport { NavigationMenuViewportElement } from \"./NavigationMenuViewport\";\nimport { FocusProxyElement, ITEM_NAME } from \"./NavigationMenuItem\";\n\nexport type Orientation = \"vertical\" | \"horizontal\";\nexport type Direction = \"ltr\" | \"rtl\";\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAVIGATION_MENU_NAME = \"NavigationMenu\";\n\nexport const [Collection, useCollection, createCollectionScope] =\n createCollection<NavigationMenuTriggerElement, { value: string }>(\n NAVIGATION_MENU_NAME\n );\n\nexport const [\n FocusGroupCollection,\n useFocusGroupCollection,\n createFocusGroupCollectionScope,\n] = createCollection<FocusGroupItemElement, {}>(NAVIGATION_MENU_NAME);\n\nexport type ScopedProps<P> = P & { __scopeNavigationMenu?: Scope };\nexport const [createNavigationMenuContext, createNavigationMenuScope] =\n createContextScope(NAVIGATION_MENU_NAME, [\n createCollectionScope,\n createFocusGroupCollectionScope,\n ]);\n\ntype NavigationMenuItemContextValue = {\n value: string;\n triggerRef: React.RefObject<NavigationMenuTriggerElement>;\n contentRef: React.RefObject<NavigationMenuContentElement>;\n focusProxyRef: React.RefObject<FocusProxyElement>;\n wasEscapeCloseRef: React.MutableRefObject<boolean>;\n onEntryKeyDown(): void;\n onFocusProxyEnter(side: \"start\" | \"end\"): void;\n onRootContentClose(): void;\n onContentFocusOutside(): void;\n};\n\nexport const [NavigationMenuItemContextProvider, useNavigationMenuItemContext] =\n createNavigationMenuContext<NavigationMenuItemContextValue>(ITEM_NAME);\n\nexport type ContentData = {\n ref?: React.Ref<ViewportContentMounterElement>;\n} & ViewportContentMounterProps;\n\ntype NavigationMenuContextValue = {\n isRootMenu: boolean;\n value: string;\n previousValue: string;\n baseId: string;\n dir: Direction;\n orientation: Orientation;\n rootNavigationMenu: NavigationMenuElement | null;\n indicatorTrack: HTMLDivElement | null;\n onIndicatorTrackChange(indicatorTrack: HTMLDivElement | null): void;\n viewport: NavigationMenuViewportElement | null;\n onViewportChange(viewport: NavigationMenuViewportElement | null): void;\n onViewportContentChange(contentValue: string, contentData: ContentData): 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};\n\nexport const [NavigationMenuProviderImpl, useNavigationMenuContext] =\n createNavigationMenuContext<NavigationMenuContextValue>(NAVIGATION_MENU_NAME);\n\nexport const [ViewportContentProvider, useViewportContentContext] =\n createNavigationMenuContext<{\n items: Map<string, ContentData>;\n }>(NAVIGATION_MENU_NAME);\n\nexport type NavigationMenuElement = React.ElementRef<typeof Primitive.nav>;\ntype PrimitiveNavProps = React.ComponentPropsWithoutRef<typeof Primitive.nav>;\ninterface NavigationMenuProps\n extends Omit<\n NavigationMenuProviderProps,\n keyof NavigationMenuProviderPrivateProps\n >,\n PrimitiveNavProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n dir?: Direction;\n orientation?: Orientation;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened.\n * @defaultValue 200\n */\n delayDuration?: number;\n /**\n * How much time a user has to enter another trigger without incurring a delay again.\n * @defaultValue 300\n */\n skipDelayDuration?: number;\n}\n\nconst NavigationMenu = React.forwardRef<\n NavigationMenuElement,\n NavigationMenuProps\n>((props: ScopedProps<NavigationMenuProps>, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value: valueProp,\n onValueChange,\n defaultValue,\n delayDuration = 200,\n skipDelayDuration = 300,\n orientation = \"horizontal\",\n dir,\n ...NavigationMenuProps\n } = props;\n const [navigationMenu, setNavigationMenu] =\n React.useState<NavigationMenuElement | null>(null);\n const composedRef = useComposedRefs(forwardedRef, (node) =>\n setNavigationMenu(node)\n );\n const direction = useDirection(dir);\n const openTimerRef = React.useRef(0);\n const closeTimerRef = React.useRef(0);\n const skipDelayTimerRef = React.useRef(0);\n const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);\n const [value = \"\", setValue] = useControllableState({\n prop: valueProp,\n onChange: (value) => {\n const isOpen = value !== \"\";\n const hasSkipDelayDuration = skipDelayDuration > 0;\n\n if (isOpen) {\n window.clearTimeout(skipDelayTimerRef.current);\n if (hasSkipDelayDuration) setIsOpenDelayed(false);\n } else {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => setIsOpenDelayed(true),\n skipDelayDuration\n );\n }\n\n onValueChange?.(value);\n },\n defaultProp: defaultValue,\n });\n\n const startCloseTimer = React.useCallback(() => {\n window.clearTimeout(closeTimerRef.current);\n closeTimerRef.current = window.setTimeout(() => setValue(\"\"), 150);\n }, [setValue]);\n\n const handleOpen = React.useCallback(\n (itemValue: string) => {\n window.clearTimeout(closeTimerRef.current);\n setValue(itemValue);\n },\n [setValue]\n );\n\n const handleDelayedOpen = React.useCallback(\n (itemValue: string) => {\n const isOpenItem = value === itemValue;\n if (isOpenItem) {\n // If the item is already open (e.g. we're transitioning from the content to the trigger)\n // then we want to clear the close timer immediately.\n window.clearTimeout(closeTimerRef.current);\n } else {\n openTimerRef.current = window.setTimeout(() => {\n window.clearTimeout(closeTimerRef.current);\n setValue(itemValue);\n }, delayDuration);\n }\n },\n [value, setValue, delayDuration]\n );\n\n React.useEffect(() => {\n return () => {\n window.clearTimeout(openTimerRef.current);\n window.clearTimeout(closeTimerRef.current);\n window.clearTimeout(skipDelayTimerRef.current);\n };\n }, []);\n\n return (\n <NavigationMenuProvider\n scope={__scopeNavigationMenu}\n isRootMenu={true}\n value={value}\n dir={direction}\n orientation={orientation}\n rootNavigationMenu={navigationMenu}\n onTriggerEnter={(itemValue) => {\n window.clearTimeout(openTimerRef.current);\n if (isOpenDelayed) handleDelayedOpen(itemValue);\n else handleOpen(itemValue);\n }}\n onTriggerLeave={() => {\n window.clearTimeout(openTimerRef.current);\n startCloseTimer();\n }}\n onContentEnter={() => window.clearTimeout(closeTimerRef.current)}\n onContentLeave={startCloseTimer}\n onItemSelect={(itemValue) => {\n setValue((prevValue) => (prevValue === itemValue ? \"\" : itemValue));\n }}\n onItemDismiss={() => setValue(\"\")}\n >\n <Primitive.nav\n aria-label=\"Main\"\n data-orientation={orientation}\n dir={direction}\n {...NavigationMenuProps}\n ref={composedRef}\n />\n </NavigationMenuProvider>\n );\n});\n\nNavigationMenu.displayName = NAVIGATION_MENU_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = NavigationMenu;\n\nexport { NavigationMenu, Root };\nexport type { NavigationMenuProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport {\n Collection,\n ContentData,\n Direction,\n NavigationMenuElement,\n NavigationMenuProviderImpl,\n Orientation,\n ScopedProps,\n useNavigationMenuContext,\n ViewportContentProvider,\n} from \"./NavigationMenu\";\nimport type { Scope } from \"@huin-core/react-context\";\n\nimport { useControllableState } from \"@huin-core/react-use-controllable-state\";\nimport { useId } from \"@huin-core/react-id\";\nimport { usePrevious } from \"@huin-core/react-use-previous\";\nimport { useCallbackRef } from \"@huin-core/react-use-callback-ref\";\nimport { NavigationMenuViewportElement } from \"./NavigationMenuViewport\";\n\nconst SUB_NAME = \"NavigationMenuSub\";\n\ntype NavigationMenuSubElement = React.ElementRef<typeof Primitive.div>;\nexport type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface NavigationMenuSubProps\n extends Omit<\n NavigationMenuProviderProps,\n keyof NavigationMenuProviderPrivateProps\n >,\n PrimitiveDivProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n orientation?: Orientation;\n}\n\nconst NavigationMenuSub = React.forwardRef<\n NavigationMenuSubElement,\n NavigationMenuSubProps\n>((props: ScopedProps<NavigationMenuSubProps>, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = \"horizontal\",\n ...subProps\n } = props;\n const context = useNavigationMenuContext(SUB_NAME, __scopeNavigationMenu);\n const [value = \"\", setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue,\n });\n\n return (\n <NavigationMenuProvider\n scope={__scopeNavigationMenu}\n isRootMenu={false}\n value={value}\n dir={context.dir}\n orientation={orientation}\n rootNavigationMenu={context.rootNavigationMenu}\n onTriggerEnter={(itemValue) => setValue(itemValue)}\n onItemSelect={(itemValue) => setValue(itemValue)}\n onItemDismiss={() => setValue(\"\")}\n >\n <Primitive.div\n data-orientation={orientation}\n {...subProps}\n ref={forwardedRef}\n />\n </NavigationMenuProvider>\n );\n});\n\nNavigationMenuSub.displayName = SUB_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport interface NavigationMenuProviderPrivateProps {\n isRootMenu: boolean;\n scope: Scope;\n children: React.ReactNode;\n orientation: Orientation;\n dir: Direction;\n rootNavigationMenu: NavigationMenuElement | null;\n value: string;\n onTriggerEnter(itemValue: string): void;\n onTriggerLeave?(): void;\n onContentEnter?(): void;\n onContentLeave?(): void;\n onItemSelect(itemValue: string): void;\n onItemDismiss(): void;\n}\n\nexport interface NavigationMenuProviderProps\n extends NavigationMenuProviderPrivateProps {}\n\nexport const NavigationMenuProvider: React.FC<NavigationMenuProviderProps> = (\n props: ScopedProps<NavigationMenuProviderProps>\n) => {\n const {\n scope,\n isRootMenu,\n rootNavigationMenu,\n dir,\n orientation,\n children,\n value,\n onItemSelect,\n onItemDismiss,\n onTriggerEnter,\n onTriggerLeave,\n onContentEnter,\n onContentLeave,\n } = props;\n const [viewport, setViewport] =\n React.useState<NavigationMenuViewportElement | null>(null);\n const [viewportContent, setViewportContent] = React.useState<\n Map<string, ContentData>\n >(new Map());\n const [indicatorTrack, setIndicatorTrack] =\n React.useState<HTMLDivElement | null>(null);\n\n return (\n <NavigationMenuProviderImpl\n scope={scope}\n isRootMenu={isRootMenu}\n rootNavigationMenu={rootNavigationMenu}\n value={value}\n previousValue={usePrevious(value)}\n baseId={useId()}\n dir={dir}\n orientation={orientation}\n viewport={viewport}\n onViewportChange={setViewport}\n indicatorTrack={indicatorTrack}\n onIndicatorTrackChange={setIndicatorTrack}\n onTriggerEnter={useCallbackRef(onTriggerEnter)}\n onTriggerLeave={useCallbackRef(onTriggerLeave)}\n onContentEnter={useCallbackRef(onContentEnter)}\n onContentLeave={useCallbackRef(onContentLeave)}\n onItemSelect={useCallbackRef(onItemSelect)}\n onItemDismiss={useCallbackRef(onItemDismiss)}\n onViewportContentChange={React.useCallback(\n (contentValue, contentData) => {\n setViewportContent((prevContent) => {\n prevContent.set(contentValue, contentData);\n return new Map(prevContent);\n });\n },\n []\n )}\n onViewportContentRemove={React.useCallback((contentValue) => {\n setViewportContent((prevContent) => {\n if (!prevContent.has(contentValue)) return prevContent;\n prevContent.delete(contentValue);\n return new Map(prevContent);\n });\n }, [])}\n >\n <Collection.Provider scope={scope}>\n <ViewportContentProvider scope={scope} items={viewportContent}>\n {children}\n </ViewportContentProvider>\n </Collection.Provider>\n </NavigationMenuProviderImpl>\n );\n};\n\nexport { NavigationMenuSub };\nexport type { NavigationMenuSubProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { NavigationMenuItemContextProvider, ScopedProps } from \"./NavigationMenu\";\nimport { NavigationMenuTriggerElement } from \"./NavigationMenuTrigger\";\nimport { NavigationMenuContentElement } from \"./NavigationMenuContent\";\nimport * as VisuallyHiddenPrimitive from \"@huin-core/react-visually-hidden\";\nimport { useId } from \"@huin-core/react-id\";\nimport { focusFirst } from \"./NavigationMenuLink\";\n\nexport const ITEM_NAME = \"NavigationMenuItem\";\n\nexport type FocusProxyElement = React.ElementRef<\n typeof VisuallyHiddenPrimitive.Root\n>;\n\ntype NavigationMenuItemElement = React.ElementRef<typeof Primitive.li>;\ntype PrimitiveListItemProps = React.ComponentPropsWithoutRef<\n typeof Primitive.li\n>;\ninterface NavigationMenuItemProps extends PrimitiveListItemProps {\n value?: string;\n}\n\nconst NavigationMenuItem = React.forwardRef<\n NavigationMenuItemElement,\n NavigationMenuItemProps\n>((props: ScopedProps<NavigationMenuItemProps>, forwardedRef) => {\n const { __scopeNavigationMenu, value: valueProp, ...itemProps } = props;\n const autoValue = useId();\n // We need to provide an initial deterministic value as `useId` will return\n // empty string on the first render and we don't want to match our internal \"closed\" value.\n const value = valueProp || autoValue || \"LEGACY_REACT_AUTO_VALUE\";\n const contentRef = React.useRef<NavigationMenuContentElement>(null);\n const triggerRef = React.useRef<NavigationMenuTriggerElement>(null);\n const focusProxyRef = React.useRef<FocusProxyElement>(null);\n const restoreContentTabOrderRef = React.useRef(() => {});\n const wasEscapeCloseRef = React.useRef(false);\n\n const handleContentEntry = React.useCallback((side = \"start\") => {\n if (contentRef.current) {\n restoreContentTabOrderRef.current();\n const candidates = getTabbableCandidates(contentRef.current);\n if (candidates.length)\n focusFirst(side === \"start\" ? candidates : candidates.reverse());\n }\n }, []);\n\n const handleContentExit = React.useCallback(() => {\n if (contentRef.current) {\n const candidates = getTabbableCandidates(contentRef.current);\n if (candidates.length)\n restoreContentTabOrderRef.current = removeFromTabOrder(candidates);\n }\n }, []);\n\n /**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\n \n\n return (\n <NavigationMenuItemContextProvider\n scope={__scopeNavigationMenu}\n value={value}\n triggerRef={triggerRef}\n contentRef={contentRef}\n focusProxyRef={focusProxyRef}\n wasEscapeCloseRef={wasEscapeCloseRef}\n onEntryKeyDown={handleContentEntry}\n onFocusProxyEnter={handleContentEntry}\n onRootContentClose={handleContentExit}\n onContentFocusOutside={handleContentExit}\n >\n <Primitive.li {...itemProps} ref={forwardedRef} />\n </NavigationMenuItemContextProvider>\n );\n});\n\nNavigationMenuItem.displayName = ITEM_NAME;\n\nexport function getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(\n container,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode: (node: any) => {\n const isHiddenInput =\n node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput)\n return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP;\n },\n }\n );\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\nfunction removeFromTabOrder(candidates: HTMLElement[]) {\n candidates.forEach((candidate) => {\n candidate.dataset.tabindex = candidate.getAttribute(\"tabindex\") || \"\";\n candidate.setAttribute(\"tabindex\", \"-1\");\n });\n return () => {\n candidates.forEach((candidate) => {\n const prevTabIndex = candidate.dataset.tabindex as string;\n candidate.setAttribute(\"tabindex\", prevTabIndex);\n });\n };\n}\n\nexport { NavigationMenuItem };\nexport type { NavigationMenuItemProps };\n", "import React from \"react\";\nimport { dispatchDiscreteCustomEvent, Primitive } from \"@huin-core/react-primitive\";\nimport {\n FocusGroupCollection,\n ScopedProps,\n useFocusGroupCollection,\n useNavigationMenuContext,\n} from \"./NavigationMenu\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\nimport { PrimitiveButtonProps } from \"./NavigationMenuTrigger\";\nimport { ROOT_CONTENT_DISMISS } from \"./NavigationMenuContent\";\n\nconst LINK_NAME = \"NavigationMenuLink\";\nconst LINK_SELECT = \"navigationMenu.linkSelect\";\n\ntype NavigationMenuLinkElement = React.ElementRef<typeof Primitive.a>;\ntype PrimitiveLinkProps = React.ComponentPropsWithoutRef<typeof Primitive.a>;\ninterface NavigationMenuLinkProps extends Omit<PrimitiveLinkProps, \"onSelect\"> {\n active?: boolean;\n onSelect?: (event: Event) => void;\n}\n\nconst NavigationMenuLink = React.forwardRef<\n NavigationMenuLinkElement,\n NavigationMenuLinkProps\n>((props: ScopedProps<NavigationMenuLinkProps>, forwardedRef) => {\n const { __scopeNavigationMenu, active, onSelect, ...linkProps } = props;\n\n return (\n <FocusGroupItem asChild>\n <Primitive.a\n data-active={active ? \"\" : undefined}\n aria-current={active ? \"page\" : undefined}\n {...linkProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(\n props.onClick,\n (event) => {\n const target = event.target as HTMLElement;\n const linkSelectEvent = new CustomEvent(LINK_SELECT, {\n bubbles: true,\n cancelable: true,\n });\n target.addEventListener(LINK_SELECT, (event) => onSelect?.(event), {\n once: true,\n });\n dispatchDiscreteCustomEvent(target, linkSelectEvent);\n\n if (!linkSelectEvent.defaultPrevented && !event.metaKey) {\n const rootContentDismissEvent = new CustomEvent(\n ROOT_CONTENT_DISMISS,\n {\n bubbles: true,\n cancelable: true,\n }\n );\n dispatchDiscreteCustomEvent(target, rootContentDismissEvent);\n }\n },\n { checkForDefaultPrevented: false }\n )}\n />\n </FocusGroupItem>\n );\n});\n\nNavigationMenuLink.displayName = LINK_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_KEYS = [\"ArrowRight\", \"ArrowLeft\", \"ArrowUp\", \"ArrowDown\"];\nconst FOCUS_GROUP_ITEM_NAME = \"FocusGroupItem\";\n\nexport type FocusGroupItemElement = React.ElementRef<typeof Primitive.button>;\ninterface FocusGroupItemProps extends PrimitiveButtonProps {}\n\nexport const FocusGroupItem = React.forwardRef<\n FocusGroupItemElement,\n FocusGroupItemProps\n>((props: ScopedProps<FocusGroupItemProps>, forwardedRef) => {\n const { __scopeNavigationMenu, ...groupProps } = props;\n const getItems = useFocusGroupCollection(__scopeNavigationMenu);\n const context = useNavigationMenuContext(\n FOCUS_GROUP_ITEM_NAME,\n __scopeNavigationMenu\n );\n\n return (\n <FocusGroupCollection.ItemSlot scope={__scopeNavigationMenu}>\n <Primitive.button\n {...groupProps}\n ref={forwardedRef}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isFocusNavigationKey = [\"Home\", \"End\", ...ARROW_KEYS].includes(\n event.key\n );\n if (isFocusNavigationKey) {\n let candidateNodes = getItems().map((item) => item.ref.current!);\n const prevItemKey =\n context.dir === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n const prevKeys = [prevItemKey, \"ArrowUp\", \"End\"];\n if (prevKeys.includes(event.key)) candidateNodes.reverse();\n if (ARROW_KEYS.includes(event.key)) {\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n\n // Prevent page scroll while navigating\n event.preventDefault();\n }\n })}\n />\n </FocusGroupCollection.ItemSlot>\n );\n});\n\nexport function focusFirst(candidates: HTMLElement[]) {\n const previouslyFocusedElement = document.activeElement;\n return candidates.some((candidate) => {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === previouslyFocusedElement) return true;\n candidate.focus();\n return document.activeElement !== previouslyFocusedElement;\n });\n}\n\nexport { NavigationMenuLink };\nexport type { NavigationMenuLinkProps };\n", "import React from \"react\";\nimport {\n FocusGroupCollection,\n ScopedProps,\n useCollection,\n useNavigationMenuContext,\n useNavigationMenuItemContext,\n} from \"./NavigationMenu\";\nimport { FocusProxyElement, getTabbableCandidates } from \"./NavigationMenuItem\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { DismissableLayer } from \"@huin-core/react-dismissable-layer\";\nimport { NavigationMenuTriggerElement } from \"./NavigationMenuTrigger\";\nimport { Presence } from \"@huin-core/react-presence\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\nimport { getOpenState, whenMouse } from \"./NavigationMenuViewport\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { PrimitiveDivProps } from \"./NavigationMenuSub\";\nimport { focusFirst } from \"./NavigationMenuLink\";\n\nexport const CONTENT_NAME = \"NavigationMenuContent\";\n\nexport type NavigationMenuContentElement = NavigationMenuContentImplElement;\ninterface NavigationMenuContentProps\n extends Omit<\n NavigationMenuContentImplProps,\n keyof NavigationMenuContentImplPrivateProps\n > {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuContent = React.forwardRef<\n NavigationMenuContentElement,\n NavigationMenuContentProps\n>((props: ScopedProps<NavigationMenuContentProps>, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useNavigationMenuContext(\n CONTENT_NAME,\n props.__scopeNavigationMenu\n );\n const itemContext = useNavigationMenuItemContext(\n CONTENT_NAME,\n props.__scopeNavigationMenu\n );\n const composedRefs = useComposedRefs(itemContext.contentRef, forwardedRef);\n const open = itemContext.value === context.value;\n\n const commonProps = {\n value: itemContext.value,\n triggerRef: itemContext.triggerRef,\n focusProxyRef: itemContext.focusProxyRef,\n wasEscapeCloseRef: itemContext.wasEscapeCloseRef,\n onContentFocusOutside: itemContext.onContentFocusOutside,\n onRootContentClose: itemContext.onRootContentClose,\n ...contentProps,\n };\n\n return !context.viewport ? (\n <Presence present={forceMount || open}>\n <NavigationMenuContentImpl\n data-state={getOpenState(open)}\n {...commonProps}\n ref={composedRefs}\n onPointerEnter={composeEventHandlers(\n props.onPointerEnter,\n context.onContentEnter\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse(context.onContentLeave)\n )}\n style={{\n // Prevent interaction when animating out\n pointerEvents: !open && context.isRootMenu ? \"none\" : undefined,\n ...commonProps.style,\n }}\n />\n </Presence>\n ) : (\n <ViewportContentMounter\n forceMount={forceMount}\n {...commonProps}\n ref={composedRefs}\n />\n );\n});\n\nNavigationMenuContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport type ViewportContentMounterElement = NavigationMenuContentImplElement;\nexport interface ViewportContentMounterProps\n extends NavigationMenuContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst ViewportContentMounter = React.forwardRef<\n ViewportContentMounterElement,\n ViewportContentMounterProps\n>((props: ScopedProps<ViewportContentMounterProps>, forwardedRef) => {\n const context = useNavigationMenuContext(\n CONTENT_NAME,\n props.__scopeNavigationMenu\n );\n const { onViewportContentChange, onViewportContentRemove } = context;\n\n useLayoutEffect(() => {\n onViewportContentChange(props.value, {\n ref: forwardedRef,\n ...props,\n });\n }, [props, forwardedRef, onViewportContentChange]);\n\n useLayoutEffect(() => {\n return () => onViewportContentRemove(props.value);\n }, [props.value, onViewportContentRemove]);\n\n // Content is proxied into the viewport\n return null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport const ROOT_CONTENT_DISMISS = \"navigationMenu.rootContentDismiss\";\n\ntype MotionAttribute = \"to-start\" | \"to-end\" | \"from-start\" | \"from-end\";\ntype NavigationMenuContentImplElement = React.ElementRef<\n typeof DismissableLayer\n>;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<\n typeof DismissableLayer\n>;\n\ninterface NavigationMenuContentImplPrivateProps {\n value: string;\n triggerRef: React.RefObject<NavigationMenuTriggerElement>;\n focusProxyRef: React.RefObject<FocusProxyElement>;\n wasEscapeCloseRef: React.MutableRefObject<boolean>;\n onContentFocusOutside(): void;\n onRootContentClose(): void;\n}\ninterface NavigationMenuContentImplProps\n extends Omit<\n DismissableLayerProps,\n \"onDismiss\" | \"disableOutsidePointerEvents\"\n >,\n NavigationMenuContentImplPrivateProps {}\n\nexport const NavigationMenuContentImpl = React.forwardRef<\n NavigationMenuContentImplElement,\n NavigationMenuContentImplProps\n>((props: ScopedProps<NavigationMenuContentImplProps>, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value,\n triggerRef,\n focusProxyRef,\n wasEscapeCloseRef,\n onRootContentClose,\n onContentFocusOutside,\n ...contentProps\n } = props;\n const context = useNavigationMenuContext(CONTENT_NAME, __scopeNavigationMenu);\n const ref = React.useRef<NavigationMenuContentImplElement>(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const getItems = useCollection(__scopeNavigationMenu);\n const prevMotionAttributeRef = React.useRef<MotionAttribute | null>(null);\n\n const { onItemDismiss } = context;\n\n React.useEffect(() => {\n const content = ref.current;\n\n // Bubble dismiss to the root content node and focus its trigger\n if (context.isRootMenu && content) {\n const handleClose = () => {\n onItemDismiss();\n onRootContentClose();\n if (content.contains(document.activeElement))\n triggerRef.current?.focus();\n };\n content.addEventListener(ROOT_CONTENT_DISMISS, handleClose);\n return () =>\n content.removeEventListener(ROOT_CONTENT_DISMISS, handleClose);\n }\n }, [\n context.isRootMenu,\n props.value,\n triggerRef,\n onItemDismiss,\n onRootContentClose,\n ]);\n\n const motionAttribute = React.useMemo(() => {\n const items = getItems();\n const values = items.map((item) => item.value);\n if (context.dir === \"rtl\") values.reverse();\n const index = values.indexOf(context.value);\n const prevIndex = values.indexOf(context.previousValue);\n const isSelected = value === context.value;\n const wasSelected = prevIndex === values.indexOf(value);\n\n // We only want to update selected and the last selected content\n // this avoids animations being interrupted outside of that range\n if (!isSelected && !wasSelected) return prevMotionAttributeRef.current;\n\n const attribute = (() => {\n // Don't provide a direction on the initial open\n if (index !== prevIndex) {\n // If we're moving to this item from another\n if (isSelected && prevIndex !== -1)\n return index > prevIndex ? \"from-end\" : \"from-start\";\n // If we're leaving this item for another\n if (wasSelected && index !== -1)\n return index > prevIndex ? \"to-start\" : \"to-end\";\n }\n // Otherwise we're entering from closed or leaving the list\n // entirely and should not animate in any direction\n return null;\n })();\n\n prevMotionAttributeRef.current = attribute;\n return attribute;\n }, [context.previousValue, context.value, context.dir, getItems, value]);\n\n return (\n <FocusGroup asChild>\n <DismissableLayer\n id={contentId}\n aria-labelledby={triggerId}\n data-motion={motionAttribute}\n data-orientation={context.orientation}\n {...contentProps}\n ref={composedRefs}\n disableOutsidePointerEvents={false}\n onDismiss={() => {\n const rootContentDismissEvent = new Event(ROOT_CONTENT_DISMISS, {\n bubbles: true,\n cancelable: true,\n });\n ref.current?.dispatchEvent(rootContentDismissEvent);\n }}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n onContentFocusOutside();\n const target = event.target as HTMLElement;\n // Only dismiss content when focus moves outside of the menu\n if (context.rootNavigationMenu?.contains(target))\n event.preventDefault();\n })}\n onPointerDownOutside={composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const target = event.target as HTMLElement;\n const isTrigger = getItems().some((item) =>\n item.ref.current?.contains(target)\n );\n const isRootViewport =\n context.isRootMenu && context.viewport?.contains(target);\n if (isTrigger || isRootViewport || !context.isRootMenu)\n event.preventDefault();\n }\n )}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n const isTabKey = event.key === \"Tab\" && !isMetaKey;\n if (isTabKey) {\n const candidates = getTabbableCandidates(event.currentTarget);\n const focusedElement = document.activeElement;\n const index = candidates.findIndex(\n (candidate) => candidate === focusedElement\n );\n const isMovingBackwards = event.shiftKey;\n const nextCandidates = isMovingBackwards\n ? candidates.slice(0, index).reverse()\n : candidates.slice(index + 1, candidates.length);\n\n if (focusFirst(nextCandidates)) {\n // prevent browser tab keydown because we've handled focus\n event.preventDefault();\n } else {\n // If we can't focus that means we're at the edges\n // so focus the proxy and let browser handle\n // tab/shift+tab keypress on the proxy instead\n focusProxyRef.current?.focus();\n }\n }\n })}\n onEscapeKeyDown={composeEventHandlers(\n props.onEscapeKeyDown,\n (event) => {\n // prevent the dropdown from reopening\n // after the escape key has been pressed\n wasEscapeCloseRef.current = true;\n }\n )}\n />\n </FocusGroup>\n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_GROUP_NAME = \"FocusGroup\";\n\ntype FocusGroupElement = React.ElementRef<typeof Primitive.div>;\ninterface FocusGroupProps extends PrimitiveDivProps {}\n\nexport const FocusGroup = React.forwardRef<FocusGroupElement, FocusGroupProps>(\n (props: ScopedProps<FocusGroupProps>, forwardedRef) => {\n const { __scopeNavigationMenu, ...groupProps } = props;\n const context = useNavigationMenuContext(\n FOCUS_GROUP_NAME,\n __scopeNavigationMenu\n );\n\n return (\n <FocusGroupCollection.Provider scope={__scopeNavigationMenu}>\n <FocusGroupCollection.Slot scope={__scopeNavigationMenu}>\n <Primitive.div dir={context.dir} {...groupProps} ref={forwardedRef} />\n </FocusGroupCollection.Slot>\n </FocusGroupCollection.Provider>\n );\n }\n);\n\nexport function makeTriggerId(baseId: string, value: string) {\n return `${baseId}-trigger-${value}`;\n}\n\nexport function makeContentId(baseId: string, value: string) {\n return `${baseId}-content-${value}`;\n}\n\nexport { NavigationMenuContent };\nexport type { NavigationMenuContentProps };\n", "import React from \"react\";\nimport {\n ScopedProps,\n useNavigationMenuContext,\n useViewportContentContext,\n} from \"./NavigationMenu\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { Presence } from \"@huin-core/react-presence\";\nimport { useCallbackRef } from \"@huin-core/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\nimport { composeRefs, useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\nimport { PrimitiveDivProps } from \"./NavigationMenuSub\";\nimport {\n CONTENT_NAME,\n NavigationMenuContentElement,\n NavigationMenuContentImpl,\n} from \"./NavigationMenuContent\";\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuViewport\n * -----------------------------------------------------------------------------------------------*/\n\nconst VIEWPORT_NAME = \"NavigationMenuViewport\";\n\nexport type NavigationMenuViewportElement = NavigationMenuViewportImplElement;\ninterface NavigationMenuViewportProps\n extends Omit<\n NavigationMenuViewportImplProps,\n \"children\" | \"activeContentValue\"\n > {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuViewport = React.forwardRef<\n NavigationMenuViewportElement,\n NavigationMenuViewportProps\n>((props: ScopedProps<NavigationMenuViewportProps>, forwardedRef) => {\n const { forceMount, ...viewportProps } = props;\n const context = useNavigationMenuContext(\n VIEWPORT_NAME,\n props.__scopeNavigationMenu\n );\n const open = Boolean(context.value);\n\n return (\n <Presence present={forceMount || open}>\n <NavigationMenuViewportImpl {...viewportProps} ref={forwardedRef} />\n </Presence>\n );\n});\n\nNavigationMenuViewport.displayName = VIEWPORT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype NavigationMenuViewportImplElement = React.ElementRef<typeof Primitive.div>;\ninterface NavigationMenuViewportImplProps extends PrimitiveDivProps {}\n\nconst NavigationMenuViewportImpl = React.forwardRef<\n NavigationMenuViewportImplElement,\n NavigationMenuViewportImplProps\n>((props: ScopedProps<NavigationMenuViewportImplProps>, forwardedRef) => {\n const { __scopeNavigationMenu, ...viewportImplProps } = props;\n const context = useNavigationMenuContext(\n VIEWPORT_NAME,\n __scopeNavigationMenu\n );\n const composedRefs = useComposedRefs(forwardedRef, context.onViewportChange);\n const viewportContentContext = useViewportContentContext(\n CONTENT_NAME,\n props.__scopeNavigationMenu\n );\n const [size, setSize] = React.useState<{\n width: number;\n height: number;\n } | null>(null);\n const [content, setContent] =\n React.useState<NavigationMenuContentElement | null>(null);\n const viewportWidth = size ? size?.width + \"px\" : undefined;\n const viewportHeight = size ? size?.height + \"px\" : undefined;\n const open = Boolean(context.value);\n // We persist the last active content value as the viewport may be animating out\n // and we want the content to remain mounted for the lifecycle of the viewport.\n const activeContentValue = open ? context.value : context.previousValue;\n\n /**\n * Update viewport size to match the active content node.\n * We prefer offset dimensions over `getBoundingClientRect` as the latter respects CSS transform.\n * For example, if content animates in from `scale(0.5)` the dimensions would be anything\n * from `0.5` to `1` of the intended size.\n */\n const handleSizeChange = () => {\n if (content)\n setSize({ width: content.offsetWidth, height: content.offsetHeight });\n };\n useResizeObserver(content, handleSizeChange);\n\n return (\n <Primitive.div\n data-state={getOpenState(open)}\n data-orientation={context.orientation}\n {...viewportImplProps}\n ref={composedRefs}\n style={{\n // Prevent interaction when animating out\n pointerEvents: !open && context.isRootMenu ? \"none\" : undefined,\n [\"--huin-core-navigation-menu-viewport-width\" as any]: viewportWidth,\n [\"--huin-core-navigation-menu-viewport-height\" as any]: viewportHeight,\n ...viewportImplProps.style,\n }}\n onPointerEnter={composeEventHandlers(\n props.onPointerEnter,\n context.onContentEnter\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse(context.onContentLeave)\n )}\n >\n {Array.from(viewportContentContext.items).map(\n ([value, { ref, forceMount, ...props }]) => {\n const isActive = activeContentValue === value;\n return (\n <Presence key={value} present={forceMount || isActive}>\n <NavigationMenuContentImpl\n {...props}\n ref={composeRefs(ref, (node) => {\n // We only want to update the stored node when another is available\n // as we need to smoothly transition between them.\n if (isActive && node) setContent(node);\n })}\n />\n </Presence>\n );\n }\n )}\n </Primitive.div>\n );\n});\n\nexport function useResizeObserver(\n element: HTMLElement | null,\n onResize: () => void\n) {\n const handleResize = useCallbackRef(onResize);\n useLayoutEffect(() => {\n let rAF = 0;\n if (element) {\n /**\n * Resize Observer will throw an often benign error that says `ResizeObserver loop\n * completed with undelivered notifications`. This means that ResizeObserver was not\n * able to deliver all observations within a single animation frame, so we use\n * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.\n * Further reading: https://github.com/WICG/resize-observer/issues/38\n */\n const resizeObserver = new ResizeObserver(() => {\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return () => {\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [element, handleResize]);\n}\n\nexport function getOpenState(open: boolean) {\n return open ? \"open\" : \"closed\";\n}\n\nexport function whenMouse<E>(\n handler: React.PointerEventHandler<E>\n): React.PointerEventHandler<E> {\n return (event) =>\n event.pointerType === \"mouse\" ? handler(event) : undefined;\n}\n\nexport { NavigationMenuViewport };\nexport type { NavigationMenuViewportProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport {\n Collection,\n ScopedProps,\n useNavigationMenuContext,\n} from \"./NavigationMenu\";\nimport { FocusGroup } from \"./NavigationMenuContent\";\n\nconst LIST_NAME = \"NavigationMenuList\";\n\ntype NavigationMenuListElement = React.ElementRef<typeof Primitive.ul>;\ntype PrimitiveUnorderedListProps = React.ComponentPropsWithoutRef<\n typeof Primitive.ul\n>;\ninterface NavigationMenuListProps extends PrimitiveUnorderedListProps {}\n\nconst NavigationMenuList = React.forwardRef<\n NavigationMenuListElement,\n NavigationMenuListProps\n>((props: ScopedProps<NavigationMenuListProps>, forwardedRef) => {\n const { __scopeNavigationMenu, ...listProps } = props;\n const context = useNavigationMenuContext(LIST_NAME, __scopeNavigationMenu);\n\n const list = (\n <Primitive.ul\n data-orientation={context.orientation}\n {...listProps}\n ref={forwardedRef}\n />\n );\n\n return (\n <Primitive.div\n style={{ position: \"relative\" }}\n ref={context.onIndicatorTrackChange}\n >\n <Collection.Slot scope={__scopeNavigationMenu}>\n {context.isRootMenu ? <FocusGroup asChild>{list}</FocusGroup> : list}\n </Collection.Slot>\n </Primitive.div>\n );\n});\n\nNavigationMenuList.displayName = LIST_NAME;\n\nexport { NavigationMenuList };\nexport type { NavigationMenuListProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport {\n Collection,\n ScopedProps,\n useNavigationMenuContext,\n useNavigationMenuItemContext,\n} from \"./NavigationMenu\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\nimport { makeContentId, makeTriggerId } from \"./NavigationMenuContent\";\nimport { FocusGroupItem } from \"./NavigationMenuLink\";\nimport { getOpenState, whenMouse } from \"./NavigationMenuViewport\";\nimport * as VisuallyHiddenPrimitive from \"@huin-core/react-visually-hidden\";\n\nconst TRIGGER_NAME = \"NavigationMenuTrigger\";\n\nexport type NavigationMenuTriggerElement = React.ElementRef<\n typeof Primitive.button\n>;\nexport type PrimitiveButtonProps = React.ComponentPropsWithoutRef<\n typeof Primitive.button\n>;\ninterface NavigationMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst NavigationMenuTrigger = React.forwardRef<\n NavigationMenuTriggerElement,\n NavigationMenuTriggerProps\n>((props: ScopedProps<NavigationMenuTriggerProps>, forwardedRef) => {\n const { __scopeNavigationMenu, disabled, ...triggerProps } = props;\n\n const context = useNavigationMenuContext(\n TRIGGER_NAME,\n props.__scopeNavigationMenu\n );\n const itemContext = useNavigationMenuItemContext(\n TRIGGER_NAME,\n props.__scopeNavigationMenu\n );\n const ref = React.useRef<NavigationMenuTriggerElement>(null);\n const composedRefs = useComposedRefs(\n ref,\n itemContext.triggerRef,\n forwardedRef\n );\n const triggerId = makeTriggerId(context.baseId, itemContext.value);\n const contentId = makeContentId(context.baseId, itemContext.value);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const wasClickCloseRef = React.useRef(false);\n const open = itemContext.value === context.value;\n\n return (\n <>\n <Collection.ItemSlot\n scope={__scopeNavigationMenu}\n value={itemContext.value}\n >\n <FocusGroupItem asChild>\n <Primitive.button\n id={triggerId}\n disabled={disabled}\n data-disabled={disabled ? \"\" : undefined}\n data-state={getOpenState(open)}\n aria-expanded={open}\n aria-controls={contentId}\n {...triggerProps}\n ref={composedRefs}\n onPointerEnter={composeEventHandlers(props.onPointerEnter, () => {\n wasClickCloseRef.current = false;\n itemContext.wasEscapeCloseRef.current = false;\n })}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse(() => {\n if (\n disabled ||\n wasClickCloseRef.current ||\n itemContext.wasEscapeCloseRef.current ||\n hasPointerMoveOpenedRef.current\n )\n return;\n context.onTriggerEnter(itemContext.value);\n hasPointerMoveOpenedRef.current = true;\n })\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse(() => {\n if (disabled) return;\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n })\n )}\n onClick={composeEventHandlers(props.onClick, () => {\n context.onItemSelect(itemContext.value);\n wasClickCloseRef.current = open;\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const verticalEntryKey =\n context.dir === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const entryKey = {\n horizontal: \"ArrowDown\",\n vertical: verticalEntryKey,\n }[context.orientation];\n if (open && event.key === entryKey) {\n itemContext.onEntryKeyDown();\n // Prevent FocusGroupItem from handling the event\n event.preventDefault();\n }\n })}\n />\n </FocusGroupItem>\n </Collection.ItemSlot>\n\n {/* Proxy tab order between trigger and content */}\n {open && (\n <>\n <VisuallyHiddenPrimitive.Root\n aria-hidden\n tabIndex={0}\n ref={itemContext.focusProxyRef}\n onFocus={(event) => {\n const content = itemContext.contentRef.current;\n const prevFocusedElement =\n event.relatedTarget as HTMLElement | null;\n const wasTriggerFocused = prevFocusedElement === ref.current;\n const wasFocusFromContent = content?.contains(prevFocusedElement);\n\n if (wasTriggerFocused || !wasFocusFromContent) {\n itemContext.onFocusProxyEnter(\n wasTriggerFocused ? \"start\" : \"end\"\n );\n }\n }}\n />\n\n {/* Restructure a11y tree to make content accessible to screen reader when using the viewport */}\n {context.viewport && <span aria-owns={contentId} />}\n </>\n )}\n </>\n );\n});\n\nNavigationMenuTrigger.displayName = TRIGGER_NAME;\n\nexport { NavigationMenuTrigger };\nexport type { NavigationMenuTriggerProps };\n", "import React from \"react\";\nimport {\n ScopedProps,\n useCollection,\n useNavigationMenuContext,\n} from \"./NavigationMenu\";\nimport { Presence } from \"@huin-core/react-presence\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { PrimitiveDivProps } from \"./NavigationMenuSub\";\nimport { NavigationMenuTriggerElement } from \"./NavigationMenuTrigger\";\nimport { useResizeObserver } from \"./NavigationMenuViewport\";\n\nconst INDICATOR_NAME = \"NavigationMenuIndicator\";\n\ntype NavigationMenuIndicatorElement = NavigationMenuIndicatorImplElement;\ninterface NavigationMenuIndicatorProps\n extends NavigationMenuIndicatorImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuIndicator = React.forwardRef<\n NavigationMenuIndicatorElement,\n NavigationMenuIndicatorProps\n>((props: ScopedProps<NavigationMenuIndicatorProps>, forwardedRef) => {\n const { forceMount, ...indicatorProps } = props;\n const context = useNavigationMenuContext(\n INDICATOR_NAME,\n props.__scopeNavigationMenu\n );\n const isVisible = Boolean(context.value);\n\n return context.indicatorTrack\n ? ReactDOM.createPortal(\n <Presence present={forceMount || isVisible}>\n <NavigationMenuIndicatorImpl {...indicatorProps} ref={forwardedRef} />\n </Presence>,\n context.indicatorTrack\n )\n : null;\n});\n\nNavigationMenuIndicator.displayName = INDICATOR_NAME;\n\ntype NavigationMenuIndicatorImplElement = React.ElementRef<\n typeof Primitive.div\n>;\ninterface NavigationMenuIndicatorImplProps extends PrimitiveDivProps {}\n\nconst NavigationMenuIndicatorImpl = React.forwardRef<\n NavigationMenuIndicatorImplElement,\n NavigationMenuIndicatorImplProps\n>((props: ScopedProps<NavigationMenuIndicatorImplProps>, forwardedRef) => {\n const { __scopeNavigationMenu, ...indicatorProps } = props;\n const context = useNavigationMenuContext(\n INDICATOR_NAME,\n __scopeNavigationMenu\n );\n const getItems = useCollection(__scopeNavigationMenu);\n const [activeTrigger, setActiveTrigger] =\n React.useState<NavigationMenuTriggerElement | null>(null);\n const [position, setPosition] = React.useState<{\n size: number;\n offset: number;\n } | null>(null);\n const isHorizontal = context.orientation === \"horizontal\";\n const isVisible = Boolean(context.value);\n\n React.useEffect(() => {\n const items = getItems();\n const triggerNode = items.find((item) => item.value === context.value)?.ref\n .current;\n if (triggerNode) setActiveTrigger(triggerNode);\n }, [getItems, context.value]);\n\n /**\n * Update position when the indicator or parent track size changes\n */\n const handlePositionChange = () => {\n if (activeTrigger) {\n setPosition({\n size: isHorizontal\n ? activeTrigger.offsetWidth\n : activeTrigger.offsetHeight,\n offset: isHorizontal\n ? activeTrigger.offsetLeft\n : activeTrigger.offsetTop,\n });\n }\n };\n useResizeObserver(activeTrigger, handlePositionChange);\n useResizeObserver(context.indicatorTrack, handlePositionChange);\n\n // We need to wait for the indicator position to be available before rendering to\n // snap immediately into position rather than transitioning from initial\n return position ? (\n <Primitive.div\n aria-hidden\n data-state={isVisible ? \"visible\" : \"hidden\"}\n data-orientation={context.orientation}\n {...indicatorProps}\n ref={forwardedRef}\n style={{\n position: \"absolute\",\n ...(isHorizontal\n ? {\n left: 0,\n width: position.size + \"px\",\n transform: `translateX(${position.offset}px)`,\n }\n : {\n top: 0,\n height: position.size + \"px\",\n transform: `translateY(${position.offset}px)`,\n }),\n ...indicatorProps.style,\n }}\n />\n ) : null;\n});\n\nexport { NavigationMenuIndicator };\nexport type { NavigationMenuIndicatorProps };\n"],
5
+ "mappings": ";;;AAAA,YAAYA,YAAW;AACvB,SAAS,0BAA0B;AACnC,SAAS,aAAAC,kBAAiB;AAC1B,SAAS,wBAAAC,6BAA4B;AACrC,SAAS,mBAAAC,wBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;;;ACNjC,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAc1B,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAkDzB;AA/CN,IAAM,WAAW;AAgBjB,IAAM,oBAAoB,MAAM,WAG9B,CAAC,OAA4C,iBAAiB;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,UAAU,yBAAyB,UAAU,qBAAqB;AACxE,QAAM,CAAC,QAAQ,IAAI,QAAQ,IAAI,qBAAqB;AAAA,IAClD,MAAM;AAAA,IACN,UAAU;AAAA,IACV,aAAa;AAAA,EACf,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,YAAY;AAAA,MACZ;AAAA,MACA,KAAK,QAAQ;AAAA,MACb;AAAA,MACA,oBAAoB,QAAQ;AAAA,MAC5B,gBAAgB,CAAC,cAAc,SAAS,SAAS;AAAA,MACjD,cAAc,CAAC,cAAc,SAAS,SAA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AAM,CAAC,eAAe,gBAAgB,IACpCA,OAAM,SAA8C,IAAI;AAC1D,QAAM,CAAC,UAAU,WAAW,IAAIA,OAAM,SAG5B,IAAI;AACd,QAAM,eAAe,QAAQ,gBAAgB;AAC7C,QAAM,YAAY,QAAQ,QAAQ,KAAK;AAEvC,EAAAA,OAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,SAAS;AACvB,UAAM,cAAc,MAAM,KAAK,CAAC,SAAS,KAAK,UAAU,QAAQ,KAAK,GAAG,IACrE;AACH,QAAI,YAAa,kBAAiB,WAAW;AAAA,EAC/C,GAAG,CAAC,UAAU,QAAQ,KAAK,CAAC;AAK5B,QAAM,uBAAuB,MAAM;AACjC,QAAI,eAAe;AACjB,kBAAY;AAAA,QACV,MAAM,eACF,cAAc,cACd,cAAc;AAAA,QAClB,QAAQ,eACJ,cAAc,aACd,cAAc;AAAA,MACpB,CAAC;AAAA,IACH;AAAA,EACF;AACA,oBAAkB,eAAe,oBAAoB;AACrD,oBAAkB,QAAQ,gBAAgB,oBAAoB;AAI9D,SAAO,WACL,gBAAAD;AAAA,IAACG,WAAU;AAAA,IAAV;AAAA,MACC,eAAW;AAAA,MACX,cAAY,YAAY,YAAY;AAAA,MACpC,oBAAkB,QAAQ;AAAA,MACzB,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,OAAO;AAAA,QACL,UAAU;AAAA,QACV,GAAI,eACA;AAAA,UACE,MAAM;AAAA,UACN,OAAO,SAAS,OAAO;AAAA,UACvB,WAAW,cAAc,SAAS,MAAM;AAAA,QAC1C,IACA;AAAA,UACE,KAAK;AAAA,UACL,QAAQ,SAAS,OAAO;AAAA,UACxB,WAAW,cAAc,SAAS,MAAM;AAAA,QAC1C;AAAA,QACJ,GAAG,eAAe;AAAA,MACpB;AAAA;AAAA,EACF,IACE;AACN,CAAC;",
6
+ "names": ["React", "Primitive", "useControllableState", "useComposedRefs", "React", "Primitive", "useId", "React", "Primitive", "composeEventHandlers", "React", "useComposedRefs", "Presence", "composeEventHandlers", "useLayoutEffect", "React", "Primitive", "useCallbackRef", "jsx", "React", "Primitive", "props", "useCallbackRef", "Primitive", "jsx", "React", "useComposedRefs", "Presence", "composeEventHandlers", "useLayoutEffect", "Primitive", "jsx", "React", "Primitive", "composeEventHandlers", "event", "jsx", "React", "useId", "Primitive", "jsx", "useComposedRefs", "useControllableState", "value", "Primitive", "React", "Primitive", "jsx", "React", "Primitive", "React", "Primitive", "useComposedRefs", "composeEventHandlers", "jsx", "React", "useComposedRefs", "Primitive", "composeEventHandlers", "React", "Presence", "Primitive", "jsx", "React", "Presence", "Primitive"]
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huin-core/react-navigation-menu",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -28,20 +28,20 @@
28
28
  "version": "yarn version"
29
29
  },
30
30
  "dependencies": {
31
- "@huin-core/primitive": "workspace:*",
32
- "@huin-core/react-collection": "workspace:*",
33
- "@huin-core/react-compose-refs": "workspace:*",
34
- "@huin-core/react-context": "workspace:*",
35
- "@huin-core/react-direction": "workspace:*",
36
- "@huin-core/react-dismissable-layer": "workspace:*",
37
- "@huin-core/react-id": "workspace:*",
38
- "@huin-core/react-presence": "workspace:*",
39
- "@huin-core/react-primitive": "workspace:*",
40
- "@huin-core/react-use-callback-ref": "workspace:*",
41
- "@huin-core/react-use-controllable-state": "workspace:*",
42
- "@huin-core/react-use-layout-effect": "workspace:*",
43
- "@huin-core/react-use-previous": "workspace:*",
44
- "@huin-core/react-visually-hidden": "workspace:*"
31
+ "@huin-core/primitive": "latest",
32
+ "@huin-core/react-collection": "latest",
33
+ "@huin-core/react-compose-refs": "latest",
34
+ "@huin-core/react-context": "latest",
35
+ "@huin-core/react-direction": "latest",
36
+ "@huin-core/react-dismissable-layer": "latest",
37
+ "@huin-core/react-id": "latest",
38
+ "@huin-core/react-presence": "latest",
39
+ "@huin-core/react-primitive": "latest",
40
+ "@huin-core/react-use-callback-ref": "latest",
41
+ "@huin-core/react-use-controllable-state": "latest",
42
+ "@huin-core/react-use-layout-effect": "latest",
43
+ "@huin-core/react-use-previous": "latest",
44
+ "@huin-core/react-visually-hidden": "latest"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@types/react": "*",