@radix-ui/react-navigation-menu 0.0.0-20250116175529

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.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # `react-navigation-menu`
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ $ yarn add @radix-ui/react-navigation-menu
7
+ # or
8
+ $ npm install @radix-ui/react-navigation-menu
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ View docs [here](https://radix-ui.com/primitives/docs/components/navigation-menu).
@@ -0,0 +1,126 @@
1
+ import * as _radix_ui_react_context from '@radix-ui/react-context';
2
+ import { Scope } from '@radix-ui/react-context';
3
+ import * as React from 'react';
4
+ import { Primitive } from '@radix-ui/react-primitive';
5
+ import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
6
+ import * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';
7
+
8
+ type Orientation = 'vertical' | 'horizontal';
9
+ type Direction = 'ltr' | 'rtl';
10
+ declare const createNavigationMenuScope: _radix_ui_react_context.CreateScope;
11
+ type NavigationMenuElement = React.ElementRef<typeof Primitive.nav>;
12
+ type PrimitiveNavProps = React.ComponentPropsWithoutRef<typeof Primitive.nav>;
13
+ interface NavigationMenuProps extends Omit<NavigationMenuProviderProps, keyof NavigationMenuProviderPrivateProps>, PrimitiveNavProps {
14
+ value?: string;
15
+ defaultValue?: string;
16
+ onValueChange?: (value: string) => void;
17
+ dir?: Direction;
18
+ orientation?: Orientation;
19
+ /**
20
+ * The duration from when the pointer enters the trigger until the tooltip gets opened.
21
+ * @defaultValue 200
22
+ */
23
+ delayDuration?: number;
24
+ /**
25
+ * How much time a user has to enter another trigger without incurring a delay again.
26
+ * @defaultValue 300
27
+ */
28
+ skipDelayDuration?: number;
29
+ }
30
+ declare const NavigationMenu: React.ForwardRefExoticComponent<NavigationMenuProps & React.RefAttributes<HTMLElement>>;
31
+ type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
32
+ interface NavigationMenuSubProps extends Omit<NavigationMenuProviderProps, keyof NavigationMenuProviderPrivateProps>, PrimitiveDivProps {
33
+ value?: string;
34
+ defaultValue?: string;
35
+ onValueChange?: (value: string) => void;
36
+ orientation?: Orientation;
37
+ }
38
+ declare const NavigationMenuSub: React.ForwardRefExoticComponent<NavigationMenuSubProps & React.RefAttributes<HTMLDivElement>>;
39
+ interface NavigationMenuProviderPrivateProps {
40
+ isRootMenu: boolean;
41
+ scope: Scope;
42
+ children: React.ReactNode;
43
+ orientation: Orientation;
44
+ dir: Direction;
45
+ rootNavigationMenu: NavigationMenuElement | null;
46
+ value: string;
47
+ onTriggerEnter(itemValue: string): void;
48
+ onTriggerLeave?(): void;
49
+ onContentEnter?(): void;
50
+ onContentLeave?(): void;
51
+ onItemSelect(itemValue: string): void;
52
+ onItemDismiss(): void;
53
+ }
54
+ interface NavigationMenuProviderProps extends NavigationMenuProviderPrivateProps {
55
+ }
56
+ type PrimitiveUnorderedListProps = React.ComponentPropsWithoutRef<typeof Primitive.ul>;
57
+ interface NavigationMenuListProps extends PrimitiveUnorderedListProps {
58
+ }
59
+ declare const NavigationMenuList: React.ForwardRefExoticComponent<NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
60
+ type FocusProxyElement = React.ElementRef<typeof VisuallyHiddenPrimitive.Root>;
61
+ type PrimitiveListItemProps = React.ComponentPropsWithoutRef<typeof Primitive.li>;
62
+ interface NavigationMenuItemProps extends PrimitiveListItemProps {
63
+ value?: string;
64
+ }
65
+ declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
66
+ type NavigationMenuTriggerElement = React.ElementRef<typeof Primitive.button>;
67
+ type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
68
+ interface NavigationMenuTriggerProps extends PrimitiveButtonProps {
69
+ }
70
+ declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
71
+ type PrimitiveLinkProps = React.ComponentPropsWithoutRef<typeof Primitive.a>;
72
+ interface NavigationMenuLinkProps extends Omit<PrimitiveLinkProps, 'onSelect'> {
73
+ active?: boolean;
74
+ onSelect?: (event: Event) => void;
75
+ }
76
+ declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
77
+ interface NavigationMenuIndicatorProps extends NavigationMenuIndicatorImplProps {
78
+ /**
79
+ * Used to force mounting when more control is needed. Useful when
80
+ * controlling animation with React animation libraries.
81
+ */
82
+ forceMount?: true;
83
+ }
84
+ declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>>;
85
+ interface NavigationMenuIndicatorImplProps extends PrimitiveDivProps {
86
+ }
87
+ interface NavigationMenuContentProps extends Omit<NavigationMenuContentImplProps, keyof NavigationMenuContentImplPrivateProps> {
88
+ /**
89
+ * Used to force mounting when more control is needed. Useful when
90
+ * controlling animation with React animation libraries.
91
+ */
92
+ forceMount?: true;
93
+ }
94
+ declare const NavigationMenuContent: React.ForwardRefExoticComponent<NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>>;
95
+ type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
96
+ interface NavigationMenuContentImplPrivateProps {
97
+ value: string;
98
+ triggerRef: React.RefObject<NavigationMenuTriggerElement | null>;
99
+ focusProxyRef: React.RefObject<FocusProxyElement | null>;
100
+ wasEscapeCloseRef: React.MutableRefObject<boolean>;
101
+ onContentFocusOutside(): void;
102
+ onRootContentClose(): void;
103
+ }
104
+ interface NavigationMenuContentImplProps extends Omit<DismissableLayerProps, 'onDismiss' | 'disableOutsidePointerEvents'>, NavigationMenuContentImplPrivateProps {
105
+ }
106
+ interface NavigationMenuViewportProps extends Omit<NavigationMenuViewportImplProps, 'activeContentValue'> {
107
+ /**
108
+ * Used to force mounting when more control is needed. Useful when
109
+ * controlling animation with React animation libraries.
110
+ */
111
+ forceMount?: true;
112
+ }
113
+ declare const NavigationMenuViewport: React.ForwardRefExoticComponent<NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>>;
114
+ interface NavigationMenuViewportImplProps extends PrimitiveDivProps {
115
+ }
116
+ declare const Root: React.ForwardRefExoticComponent<NavigationMenuProps & React.RefAttributes<HTMLElement>>;
117
+ declare const Sub: React.ForwardRefExoticComponent<NavigationMenuSubProps & React.RefAttributes<HTMLDivElement>>;
118
+ declare const List: React.ForwardRefExoticComponent<NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
119
+ declare const Item: React.ForwardRefExoticComponent<NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
120
+ declare const Trigger: React.ForwardRefExoticComponent<NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
121
+ declare const Link: React.ForwardRefExoticComponent<NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
122
+ declare const Indicator: React.ForwardRefExoticComponent<NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>>;
123
+ declare const Content: React.ForwardRefExoticComponent<NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>>;
124
+ declare const Viewport: React.ForwardRefExoticComponent<NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>>;
125
+
126
+ export { Content, Indicator, Item, Link, List, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuSub, type NavigationMenuSubProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, Root, Sub, Trigger, Viewport, createNavigationMenuScope };
@@ -0,0 +1,126 @@
1
+ import * as _radix_ui_react_context from '@radix-ui/react-context';
2
+ import { Scope } from '@radix-ui/react-context';
3
+ import * as React from 'react';
4
+ import { Primitive } from '@radix-ui/react-primitive';
5
+ import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
6
+ import * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';
7
+
8
+ type Orientation = 'vertical' | 'horizontal';
9
+ type Direction = 'ltr' | 'rtl';
10
+ declare const createNavigationMenuScope: _radix_ui_react_context.CreateScope;
11
+ type NavigationMenuElement = React.ElementRef<typeof Primitive.nav>;
12
+ type PrimitiveNavProps = React.ComponentPropsWithoutRef<typeof Primitive.nav>;
13
+ interface NavigationMenuProps extends Omit<NavigationMenuProviderProps, keyof NavigationMenuProviderPrivateProps>, PrimitiveNavProps {
14
+ value?: string;
15
+ defaultValue?: string;
16
+ onValueChange?: (value: string) => void;
17
+ dir?: Direction;
18
+ orientation?: Orientation;
19
+ /**
20
+ * The duration from when the pointer enters the trigger until the tooltip gets opened.
21
+ * @defaultValue 200
22
+ */
23
+ delayDuration?: number;
24
+ /**
25
+ * How much time a user has to enter another trigger without incurring a delay again.
26
+ * @defaultValue 300
27
+ */
28
+ skipDelayDuration?: number;
29
+ }
30
+ declare const NavigationMenu: React.ForwardRefExoticComponent<NavigationMenuProps & React.RefAttributes<HTMLElement>>;
31
+ type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
32
+ interface NavigationMenuSubProps extends Omit<NavigationMenuProviderProps, keyof NavigationMenuProviderPrivateProps>, PrimitiveDivProps {
33
+ value?: string;
34
+ defaultValue?: string;
35
+ onValueChange?: (value: string) => void;
36
+ orientation?: Orientation;
37
+ }
38
+ declare const NavigationMenuSub: React.ForwardRefExoticComponent<NavigationMenuSubProps & React.RefAttributes<HTMLDivElement>>;
39
+ interface NavigationMenuProviderPrivateProps {
40
+ isRootMenu: boolean;
41
+ scope: Scope;
42
+ children: React.ReactNode;
43
+ orientation: Orientation;
44
+ dir: Direction;
45
+ rootNavigationMenu: NavigationMenuElement | null;
46
+ value: string;
47
+ onTriggerEnter(itemValue: string): void;
48
+ onTriggerLeave?(): void;
49
+ onContentEnter?(): void;
50
+ onContentLeave?(): void;
51
+ onItemSelect(itemValue: string): void;
52
+ onItemDismiss(): void;
53
+ }
54
+ interface NavigationMenuProviderProps extends NavigationMenuProviderPrivateProps {
55
+ }
56
+ type PrimitiveUnorderedListProps = React.ComponentPropsWithoutRef<typeof Primitive.ul>;
57
+ interface NavigationMenuListProps extends PrimitiveUnorderedListProps {
58
+ }
59
+ declare const NavigationMenuList: React.ForwardRefExoticComponent<NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
60
+ type FocusProxyElement = React.ElementRef<typeof VisuallyHiddenPrimitive.Root>;
61
+ type PrimitiveListItemProps = React.ComponentPropsWithoutRef<typeof Primitive.li>;
62
+ interface NavigationMenuItemProps extends PrimitiveListItemProps {
63
+ value?: string;
64
+ }
65
+ declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
66
+ type NavigationMenuTriggerElement = React.ElementRef<typeof Primitive.button>;
67
+ type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
68
+ interface NavigationMenuTriggerProps extends PrimitiveButtonProps {
69
+ }
70
+ declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
71
+ type PrimitiveLinkProps = React.ComponentPropsWithoutRef<typeof Primitive.a>;
72
+ interface NavigationMenuLinkProps extends Omit<PrimitiveLinkProps, 'onSelect'> {
73
+ active?: boolean;
74
+ onSelect?: (event: Event) => void;
75
+ }
76
+ declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
77
+ interface NavigationMenuIndicatorProps extends NavigationMenuIndicatorImplProps {
78
+ /**
79
+ * Used to force mounting when more control is needed. Useful when
80
+ * controlling animation with React animation libraries.
81
+ */
82
+ forceMount?: true;
83
+ }
84
+ declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>>;
85
+ interface NavigationMenuIndicatorImplProps extends PrimitiveDivProps {
86
+ }
87
+ interface NavigationMenuContentProps extends Omit<NavigationMenuContentImplProps, keyof NavigationMenuContentImplPrivateProps> {
88
+ /**
89
+ * Used to force mounting when more control is needed. Useful when
90
+ * controlling animation with React animation libraries.
91
+ */
92
+ forceMount?: true;
93
+ }
94
+ declare const NavigationMenuContent: React.ForwardRefExoticComponent<NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>>;
95
+ type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
96
+ interface NavigationMenuContentImplPrivateProps {
97
+ value: string;
98
+ triggerRef: React.RefObject<NavigationMenuTriggerElement | null>;
99
+ focusProxyRef: React.RefObject<FocusProxyElement | null>;
100
+ wasEscapeCloseRef: React.MutableRefObject<boolean>;
101
+ onContentFocusOutside(): void;
102
+ onRootContentClose(): void;
103
+ }
104
+ interface NavigationMenuContentImplProps extends Omit<DismissableLayerProps, 'onDismiss' | 'disableOutsidePointerEvents'>, NavigationMenuContentImplPrivateProps {
105
+ }
106
+ interface NavigationMenuViewportProps extends Omit<NavigationMenuViewportImplProps, 'activeContentValue'> {
107
+ /**
108
+ * Used to force mounting when more control is needed. Useful when
109
+ * controlling animation with React animation libraries.
110
+ */
111
+ forceMount?: true;
112
+ }
113
+ declare const NavigationMenuViewport: React.ForwardRefExoticComponent<NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>>;
114
+ interface NavigationMenuViewportImplProps extends PrimitiveDivProps {
115
+ }
116
+ declare const Root: React.ForwardRefExoticComponent<NavigationMenuProps & React.RefAttributes<HTMLElement>>;
117
+ declare const Sub: React.ForwardRefExoticComponent<NavigationMenuSubProps & React.RefAttributes<HTMLDivElement>>;
118
+ declare const List: React.ForwardRefExoticComponent<NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
119
+ declare const Item: React.ForwardRefExoticComponent<NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
120
+ declare const Trigger: React.ForwardRefExoticComponent<NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
121
+ declare const Link: React.ForwardRefExoticComponent<NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
122
+ declare const Indicator: React.ForwardRefExoticComponent<NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>>;
123
+ declare const Content: React.ForwardRefExoticComponent<NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>>;
124
+ declare const Viewport: React.ForwardRefExoticComponent<NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>>;
125
+
126
+ export { Content, Indicator, Item, Link, List, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuSub, type NavigationMenuSubProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, Root, Sub, Trigger, Viewport, createNavigationMenuScope };