@radix-ui/react-menu 2.0.7-rc.8 → 2.1.0-rc.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.
- package/dist/index.d.mts +82 -70
- package/dist/index.d.ts +82 -70
- package/dist/index.js +806 -974
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +801 -927
- package/dist/index.mjs.map +7 -1
- package/package.json +17 -18
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { DismissableLayer } from
|
|
3
|
-
import { FocusScope } from
|
|
4
|
-
import * as PopperPrimitive from
|
|
5
|
-
import { Portal as
|
|
6
|
-
import * as Radix from
|
|
7
|
-
import { Primitive } from
|
|
8
|
-
import * as RovingFocusGroup from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
3
|
+
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
4
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
5
|
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
6
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
7
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
8
|
+
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
|
9
|
+
|
|
10
|
+
declare type Scope<C = any> = {
|
|
11
|
+
[scopeName: string]: React.Context<C>[];
|
|
12
|
+
} | undefined;
|
|
13
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
14
|
+
[__scopeProp: string]: Scope;
|
|
15
|
+
};
|
|
16
|
+
interface CreateScope {
|
|
17
|
+
scopeName: string;
|
|
18
|
+
(): ScopeHook;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare type Direction = 'ltr' | 'rtl';
|
|
22
|
+
declare const createMenuScope: CreateScope;
|
|
23
|
+
interface MenuProps {
|
|
12
24
|
children?: React.ReactNode;
|
|
13
25
|
open?: boolean;
|
|
14
26
|
onOpenChange?(open: boolean): void;
|
|
15
27
|
dir?: Direction;
|
|
16
28
|
modal?: boolean;
|
|
17
29
|
}
|
|
18
|
-
|
|
19
|
-
type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
20
|
-
|
|
30
|
+
declare const Menu: React.FC<MenuProps>;
|
|
31
|
+
declare type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
32
|
+
interface MenuAnchorProps extends PopperAnchorProps {
|
|
21
33
|
}
|
|
22
|
-
|
|
23
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
24
|
-
|
|
34
|
+
declare const MenuAnchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
36
|
+
interface MenuPortalProps {
|
|
25
37
|
children?: React.ReactNode;
|
|
26
38
|
/**
|
|
27
39
|
* Specify a container element to portal the content into.
|
|
@@ -33,27 +45,27 @@ export interface MenuPortalProps {
|
|
|
33
45
|
*/
|
|
34
46
|
forceMount?: true;
|
|
35
47
|
}
|
|
36
|
-
|
|
48
|
+
declare const MenuPortal: React.FC<MenuPortalProps>;
|
|
37
49
|
/**
|
|
38
50
|
* We purposefully don't union MenuRootContent and MenuSubContent props here because
|
|
39
51
|
* they have conflicting prop types. We agreed that we would allow MenuSubContent to
|
|
40
52
|
* accept props that it would just ignore.
|
|
41
53
|
*/
|
|
42
|
-
|
|
54
|
+
interface MenuContentProps extends MenuRootContentTypeProps {
|
|
43
55
|
/**
|
|
44
56
|
* Used to force mounting when more control is needed. Useful when
|
|
45
57
|
* controlling animation with React animation libraries.
|
|
46
58
|
*/
|
|
47
59
|
forceMount?: true;
|
|
48
60
|
}
|
|
49
|
-
|
|
61
|
+
declare const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
50
62
|
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {
|
|
51
63
|
}
|
|
52
|
-
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
53
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
54
|
-
type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
55
|
-
type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
56
|
-
type MenuContentImplPrivateProps = {
|
|
64
|
+
declare type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
65
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
66
|
+
declare type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
67
|
+
declare type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
68
|
+
declare type MenuContentImplPrivateProps = {
|
|
57
69
|
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
58
70
|
onDismiss?: DismissableLayerProps['onDismiss'];
|
|
59
71
|
disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];
|
|
@@ -85,84 +97,84 @@ interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperC
|
|
|
85
97
|
onFocusOutside?: DismissableLayerProps['onFocusOutside'];
|
|
86
98
|
onInteractOutside?: DismissableLayerProps['onInteractOutside'];
|
|
87
99
|
}
|
|
88
|
-
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
89
|
-
|
|
100
|
+
declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
101
|
+
interface MenuGroupProps extends PrimitiveDivProps {
|
|
90
102
|
}
|
|
91
|
-
|
|
92
|
-
|
|
103
|
+
declare const MenuGroup: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
104
|
+
interface MenuLabelProps extends PrimitiveDivProps {
|
|
93
105
|
}
|
|
94
|
-
|
|
95
|
-
|
|
106
|
+
declare const MenuLabel: React.ForwardRefExoticComponent<MenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
107
|
+
interface MenuItemProps extends Omit<MenuItemImplProps, 'onSelect'> {
|
|
96
108
|
onSelect?: (event: Event) => void;
|
|
97
109
|
}
|
|
98
|
-
|
|
110
|
+
declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
99
111
|
interface MenuItemImplProps extends PrimitiveDivProps {
|
|
100
112
|
disabled?: boolean;
|
|
101
113
|
textValue?: string;
|
|
102
114
|
}
|
|
103
|
-
type CheckedState = boolean | 'indeterminate';
|
|
104
|
-
|
|
115
|
+
declare type CheckedState = boolean | 'indeterminate';
|
|
116
|
+
interface MenuCheckboxItemProps extends MenuItemProps {
|
|
105
117
|
checked?: CheckedState;
|
|
106
118
|
onCheckedChange?: (checked: boolean) => void;
|
|
107
119
|
}
|
|
108
|
-
|
|
109
|
-
|
|
120
|
+
declare const MenuCheckboxItem: React.ForwardRefExoticComponent<MenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
121
|
+
interface MenuRadioGroupProps extends MenuGroupProps {
|
|
110
122
|
value?: string;
|
|
111
123
|
onValueChange?: (value: string) => void;
|
|
112
124
|
}
|
|
113
|
-
|
|
114
|
-
|
|
125
|
+
declare const MenuRadioGroup: React.ForwardRefExoticComponent<MenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
126
|
+
interface MenuRadioItemProps extends MenuItemProps {
|
|
115
127
|
value: string;
|
|
116
128
|
}
|
|
117
|
-
|
|
118
|
-
type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
119
|
-
|
|
129
|
+
declare const MenuRadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
130
|
+
declare type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
131
|
+
interface MenuItemIndicatorProps extends PrimitiveSpanProps {
|
|
120
132
|
/**
|
|
121
133
|
* Used to force mounting when more control is needed. Useful when
|
|
122
134
|
* controlling animation with React animation libraries.
|
|
123
135
|
*/
|
|
124
136
|
forceMount?: true;
|
|
125
137
|
}
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
declare const MenuItemIndicator: React.ForwardRefExoticComponent<MenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
139
|
+
interface MenuSeparatorProps extends PrimitiveDivProps {
|
|
128
140
|
}
|
|
129
|
-
|
|
130
|
-
type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
131
|
-
|
|
141
|
+
declare const MenuSeparator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
142
|
+
declare type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
143
|
+
interface MenuArrowProps extends PopperArrowProps {
|
|
132
144
|
}
|
|
133
|
-
|
|
134
|
-
|
|
145
|
+
declare const MenuArrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
146
|
+
interface MenuSubProps {
|
|
135
147
|
children?: React.ReactNode;
|
|
136
148
|
open?: boolean;
|
|
137
149
|
onOpenChange?(open: boolean): void;
|
|
138
150
|
}
|
|
139
|
-
|
|
140
|
-
|
|
151
|
+
declare const MenuSub: React.FC<MenuSubProps>;
|
|
152
|
+
interface MenuSubTriggerProps extends MenuItemImplProps {
|
|
141
153
|
}
|
|
142
|
-
|
|
143
|
-
|
|
154
|
+
declare const MenuSubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
155
|
+
interface MenuSubContentProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'onEntryFocus' | 'side' | 'align'> {
|
|
144
156
|
/**
|
|
145
157
|
* Used to force mounting when more control is needed. Useful when
|
|
146
158
|
* controlling animation with React animation libraries.
|
|
147
159
|
*/
|
|
148
160
|
forceMount?: true;
|
|
149
161
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
declare const MenuSubContent: React.ForwardRefExoticComponent<MenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
163
|
+
declare const Root: React.FC<MenuProps>;
|
|
164
|
+
declare const Anchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
165
|
+
declare const Portal: React.FC<MenuPortalProps>;
|
|
166
|
+
declare const Content: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
167
|
+
declare const Group: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
168
|
+
declare const Label: React.ForwardRefExoticComponent<MenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
169
|
+
declare const Item: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
170
|
+
declare const CheckboxItem: React.ForwardRefExoticComponent<MenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
171
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<MenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
declare const RadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
173
|
+
declare const ItemIndicator: React.ForwardRefExoticComponent<MenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
174
|
+
declare const Separator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
175
|
+
declare const Arrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
176
|
+
declare const Sub: React.FC<MenuSubProps>;
|
|
177
|
+
declare const SubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
178
|
+
declare const SubContent: React.ForwardRefExoticComponent<MenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
167
179
|
|
|
168
|
-
|
|
180
|
+
export { Anchor, Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Menu, MenuAnchor, type MenuAnchorProps, MenuArrow, type MenuArrowProps, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuGroup, type MenuGroupProps, MenuItem, MenuItemIndicator, type MenuItemIndicatorProps, type MenuItemProps, MenuLabel, type MenuLabelProps, MenuPortal, type MenuPortalProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuSub, MenuSubContent, type MenuSubContentProps, type MenuSubProps, MenuSubTrigger, type MenuSubTriggerProps, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, createMenuScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { DismissableLayer } from
|
|
3
|
-
import { FocusScope } from
|
|
4
|
-
import * as PopperPrimitive from
|
|
5
|
-
import { Portal as
|
|
6
|
-
import * as Radix from
|
|
7
|
-
import { Primitive } from
|
|
8
|
-
import * as RovingFocusGroup from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
3
|
+
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
4
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
5
|
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
6
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
7
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
8
|
+
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
|
9
|
+
|
|
10
|
+
declare type Scope<C = any> = {
|
|
11
|
+
[scopeName: string]: React.Context<C>[];
|
|
12
|
+
} | undefined;
|
|
13
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
14
|
+
[__scopeProp: string]: Scope;
|
|
15
|
+
};
|
|
16
|
+
interface CreateScope {
|
|
17
|
+
scopeName: string;
|
|
18
|
+
(): ScopeHook;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare type Direction = 'ltr' | 'rtl';
|
|
22
|
+
declare const createMenuScope: CreateScope;
|
|
23
|
+
interface MenuProps {
|
|
12
24
|
children?: React.ReactNode;
|
|
13
25
|
open?: boolean;
|
|
14
26
|
onOpenChange?(open: boolean): void;
|
|
15
27
|
dir?: Direction;
|
|
16
28
|
modal?: boolean;
|
|
17
29
|
}
|
|
18
|
-
|
|
19
|
-
type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
20
|
-
|
|
30
|
+
declare const Menu: React.FC<MenuProps>;
|
|
31
|
+
declare type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
32
|
+
interface MenuAnchorProps extends PopperAnchorProps {
|
|
21
33
|
}
|
|
22
|
-
|
|
23
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
24
|
-
|
|
34
|
+
declare const MenuAnchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
36
|
+
interface MenuPortalProps {
|
|
25
37
|
children?: React.ReactNode;
|
|
26
38
|
/**
|
|
27
39
|
* Specify a container element to portal the content into.
|
|
@@ -33,27 +45,27 @@ export interface MenuPortalProps {
|
|
|
33
45
|
*/
|
|
34
46
|
forceMount?: true;
|
|
35
47
|
}
|
|
36
|
-
|
|
48
|
+
declare const MenuPortal: React.FC<MenuPortalProps>;
|
|
37
49
|
/**
|
|
38
50
|
* We purposefully don't union MenuRootContent and MenuSubContent props here because
|
|
39
51
|
* they have conflicting prop types. We agreed that we would allow MenuSubContent to
|
|
40
52
|
* accept props that it would just ignore.
|
|
41
53
|
*/
|
|
42
|
-
|
|
54
|
+
interface MenuContentProps extends MenuRootContentTypeProps {
|
|
43
55
|
/**
|
|
44
56
|
* Used to force mounting when more control is needed. Useful when
|
|
45
57
|
* controlling animation with React animation libraries.
|
|
46
58
|
*/
|
|
47
59
|
forceMount?: true;
|
|
48
60
|
}
|
|
49
|
-
|
|
61
|
+
declare const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
50
62
|
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {
|
|
51
63
|
}
|
|
52
|
-
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
53
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
54
|
-
type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
55
|
-
type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
56
|
-
type MenuContentImplPrivateProps = {
|
|
64
|
+
declare type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
65
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
66
|
+
declare type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
67
|
+
declare type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
68
|
+
declare type MenuContentImplPrivateProps = {
|
|
57
69
|
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
58
70
|
onDismiss?: DismissableLayerProps['onDismiss'];
|
|
59
71
|
disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];
|
|
@@ -85,84 +97,84 @@ interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperC
|
|
|
85
97
|
onFocusOutside?: DismissableLayerProps['onFocusOutside'];
|
|
86
98
|
onInteractOutside?: DismissableLayerProps['onInteractOutside'];
|
|
87
99
|
}
|
|
88
|
-
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
89
|
-
|
|
100
|
+
declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
101
|
+
interface MenuGroupProps extends PrimitiveDivProps {
|
|
90
102
|
}
|
|
91
|
-
|
|
92
|
-
|
|
103
|
+
declare const MenuGroup: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
104
|
+
interface MenuLabelProps extends PrimitiveDivProps {
|
|
93
105
|
}
|
|
94
|
-
|
|
95
|
-
|
|
106
|
+
declare const MenuLabel: React.ForwardRefExoticComponent<MenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
107
|
+
interface MenuItemProps extends Omit<MenuItemImplProps, 'onSelect'> {
|
|
96
108
|
onSelect?: (event: Event) => void;
|
|
97
109
|
}
|
|
98
|
-
|
|
110
|
+
declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
99
111
|
interface MenuItemImplProps extends PrimitiveDivProps {
|
|
100
112
|
disabled?: boolean;
|
|
101
113
|
textValue?: string;
|
|
102
114
|
}
|
|
103
|
-
type CheckedState = boolean | 'indeterminate';
|
|
104
|
-
|
|
115
|
+
declare type CheckedState = boolean | 'indeterminate';
|
|
116
|
+
interface MenuCheckboxItemProps extends MenuItemProps {
|
|
105
117
|
checked?: CheckedState;
|
|
106
118
|
onCheckedChange?: (checked: boolean) => void;
|
|
107
119
|
}
|
|
108
|
-
|
|
109
|
-
|
|
120
|
+
declare const MenuCheckboxItem: React.ForwardRefExoticComponent<MenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
121
|
+
interface MenuRadioGroupProps extends MenuGroupProps {
|
|
110
122
|
value?: string;
|
|
111
123
|
onValueChange?: (value: string) => void;
|
|
112
124
|
}
|
|
113
|
-
|
|
114
|
-
|
|
125
|
+
declare const MenuRadioGroup: React.ForwardRefExoticComponent<MenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
126
|
+
interface MenuRadioItemProps extends MenuItemProps {
|
|
115
127
|
value: string;
|
|
116
128
|
}
|
|
117
|
-
|
|
118
|
-
type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
119
|
-
|
|
129
|
+
declare const MenuRadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
130
|
+
declare type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
131
|
+
interface MenuItemIndicatorProps extends PrimitiveSpanProps {
|
|
120
132
|
/**
|
|
121
133
|
* Used to force mounting when more control is needed. Useful when
|
|
122
134
|
* controlling animation with React animation libraries.
|
|
123
135
|
*/
|
|
124
136
|
forceMount?: true;
|
|
125
137
|
}
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
declare const MenuItemIndicator: React.ForwardRefExoticComponent<MenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
139
|
+
interface MenuSeparatorProps extends PrimitiveDivProps {
|
|
128
140
|
}
|
|
129
|
-
|
|
130
|
-
type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
131
|
-
|
|
141
|
+
declare const MenuSeparator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
142
|
+
declare type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
143
|
+
interface MenuArrowProps extends PopperArrowProps {
|
|
132
144
|
}
|
|
133
|
-
|
|
134
|
-
|
|
145
|
+
declare const MenuArrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
146
|
+
interface MenuSubProps {
|
|
135
147
|
children?: React.ReactNode;
|
|
136
148
|
open?: boolean;
|
|
137
149
|
onOpenChange?(open: boolean): void;
|
|
138
150
|
}
|
|
139
|
-
|
|
140
|
-
|
|
151
|
+
declare const MenuSub: React.FC<MenuSubProps>;
|
|
152
|
+
interface MenuSubTriggerProps extends MenuItemImplProps {
|
|
141
153
|
}
|
|
142
|
-
|
|
143
|
-
|
|
154
|
+
declare const MenuSubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
155
|
+
interface MenuSubContentProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'onEntryFocus' | 'side' | 'align'> {
|
|
144
156
|
/**
|
|
145
157
|
* Used to force mounting when more control is needed. Useful when
|
|
146
158
|
* controlling animation with React animation libraries.
|
|
147
159
|
*/
|
|
148
160
|
forceMount?: true;
|
|
149
161
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
declare const MenuSubContent: React.ForwardRefExoticComponent<MenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
163
|
+
declare const Root: React.FC<MenuProps>;
|
|
164
|
+
declare const Anchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
165
|
+
declare const Portal: React.FC<MenuPortalProps>;
|
|
166
|
+
declare const Content: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
167
|
+
declare const Group: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
168
|
+
declare const Label: React.ForwardRefExoticComponent<MenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
169
|
+
declare const Item: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
170
|
+
declare const CheckboxItem: React.ForwardRefExoticComponent<MenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
171
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<MenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
172
|
+
declare const RadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
173
|
+
declare const ItemIndicator: React.ForwardRefExoticComponent<MenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
174
|
+
declare const Separator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
175
|
+
declare const Arrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
176
|
+
declare const Sub: React.FC<MenuSubProps>;
|
|
177
|
+
declare const SubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
178
|
+
declare const SubContent: React.ForwardRefExoticComponent<MenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
167
179
|
|
|
168
|
-
|
|
180
|
+
export { Anchor, Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Menu, MenuAnchor, type MenuAnchorProps, MenuArrow, type MenuArrowProps, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuGroup, type MenuGroupProps, MenuItem, MenuItemIndicator, type MenuItemIndicatorProps, type MenuItemProps, MenuLabel, type MenuLabelProps, MenuPortal, type MenuPortalProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuSub, MenuSubContent, type MenuSubContentProps, type MenuSubProps, MenuSubTrigger, type MenuSubTriggerProps, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, createMenuScope };
|