@radix-ui/react-menu 2.1.0-rc.2 → 2.1.0-rc.4
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 +14 -15
- package/dist/index.d.ts +14 -15
- package/dist/index.js +862 -826
- package/dist/index.js.map +4 -4
- package/dist/index.mjs.map +2 -2
- package/package.json +19 -19
package/dist/index.d.mts
CHANGED
|
@@ -3,14 +3,13 @@ import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
|
3
3
|
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
4
4
|
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
5
5
|
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
6
|
-
import * as Radix from '@radix-ui/react-primitive';
|
|
7
6
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
8
7
|
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
type Scope<C = any> = {
|
|
11
10
|
[scopeName: string]: React.Context<C>[];
|
|
12
11
|
} | undefined;
|
|
13
|
-
|
|
12
|
+
type ScopeHook = (scope: Scope) => {
|
|
14
13
|
[__scopeProp: string]: Scope;
|
|
15
14
|
};
|
|
16
15
|
interface CreateScope {
|
|
@@ -18,7 +17,7 @@ interface CreateScope {
|
|
|
18
17
|
(): ScopeHook;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
type Direction = 'ltr' | 'rtl';
|
|
22
21
|
declare const createMenuScope: CreateScope;
|
|
23
22
|
interface MenuProps {
|
|
24
23
|
children?: React.ReactNode;
|
|
@@ -28,11 +27,11 @@ interface MenuProps {
|
|
|
28
27
|
modal?: boolean;
|
|
29
28
|
}
|
|
30
29
|
declare const Menu: React.FC<MenuProps>;
|
|
31
|
-
|
|
30
|
+
type PopperAnchorProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
32
31
|
interface MenuAnchorProps extends PopperAnchorProps {
|
|
33
32
|
}
|
|
34
33
|
declare const MenuAnchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
-
|
|
34
|
+
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
36
35
|
interface MenuPortalProps {
|
|
37
36
|
children?: React.ReactNode;
|
|
38
37
|
/**
|
|
@@ -61,11 +60,11 @@ interface MenuContentProps extends MenuRootContentTypeProps {
|
|
|
61
60
|
declare const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
61
|
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
type FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
64
|
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
65
|
+
type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
66
|
+
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
67
|
+
type MenuContentImplPrivateProps = {
|
|
69
68
|
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
70
69
|
onDismiss?: DismissableLayerProps['onDismiss'];
|
|
71
70
|
disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];
|
|
@@ -97,7 +96,7 @@ interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperC
|
|
|
97
96
|
onFocusOutside?: DismissableLayerProps['onFocusOutside'];
|
|
98
97
|
onInteractOutside?: DismissableLayerProps['onInteractOutside'];
|
|
99
98
|
}
|
|
100
|
-
|
|
99
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
101
100
|
interface MenuGroupProps extends PrimitiveDivProps {
|
|
102
101
|
}
|
|
103
102
|
declare const MenuGroup: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -112,7 +111,7 @@ interface MenuItemImplProps extends PrimitiveDivProps {
|
|
|
112
111
|
disabled?: boolean;
|
|
113
112
|
textValue?: string;
|
|
114
113
|
}
|
|
115
|
-
|
|
114
|
+
type CheckedState = boolean | 'indeterminate';
|
|
116
115
|
interface MenuCheckboxItemProps extends MenuItemProps {
|
|
117
116
|
checked?: CheckedState;
|
|
118
117
|
onCheckedChange?: (checked: boolean) => void;
|
|
@@ -127,7 +126,7 @@ interface MenuRadioItemProps extends MenuItemProps {
|
|
|
127
126
|
value: string;
|
|
128
127
|
}
|
|
129
128
|
declare const MenuRadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
130
|
-
|
|
129
|
+
type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
131
130
|
interface MenuItemIndicatorProps extends PrimitiveSpanProps {
|
|
132
131
|
/**
|
|
133
132
|
* Used to force mounting when more control is needed. Useful when
|
|
@@ -139,7 +138,7 @@ declare const MenuItemIndicator: React.ForwardRefExoticComponent<MenuItemIndicat
|
|
|
139
138
|
interface MenuSeparatorProps extends PrimitiveDivProps {
|
|
140
139
|
}
|
|
141
140
|
declare const MenuSeparator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
142
|
-
|
|
141
|
+
type PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
143
142
|
interface MenuArrowProps extends PopperArrowProps {
|
|
144
143
|
}
|
|
145
144
|
declare const MenuArrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,13 @@ import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
|
3
3
|
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
4
4
|
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
5
5
|
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
6
|
-
import * as Radix from '@radix-ui/react-primitive';
|
|
7
6
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
8
7
|
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
type Scope<C = any> = {
|
|
11
10
|
[scopeName: string]: React.Context<C>[];
|
|
12
11
|
} | undefined;
|
|
13
|
-
|
|
12
|
+
type ScopeHook = (scope: Scope) => {
|
|
14
13
|
[__scopeProp: string]: Scope;
|
|
15
14
|
};
|
|
16
15
|
interface CreateScope {
|
|
@@ -18,7 +17,7 @@ interface CreateScope {
|
|
|
18
17
|
(): ScopeHook;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
type Direction = 'ltr' | 'rtl';
|
|
22
21
|
declare const createMenuScope: CreateScope;
|
|
23
22
|
interface MenuProps {
|
|
24
23
|
children?: React.ReactNode;
|
|
@@ -28,11 +27,11 @@ interface MenuProps {
|
|
|
28
27
|
modal?: boolean;
|
|
29
28
|
}
|
|
30
29
|
declare const Menu: React.FC<MenuProps>;
|
|
31
|
-
|
|
30
|
+
type PopperAnchorProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
32
31
|
interface MenuAnchorProps extends PopperAnchorProps {
|
|
33
32
|
}
|
|
34
33
|
declare const MenuAnchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
-
|
|
34
|
+
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
36
35
|
interface MenuPortalProps {
|
|
37
36
|
children?: React.ReactNode;
|
|
38
37
|
/**
|
|
@@ -61,11 +60,11 @@ interface MenuContentProps extends MenuRootContentTypeProps {
|
|
|
61
60
|
declare const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
61
|
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
type FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
64
|
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
65
|
+
type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
66
|
+
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
67
|
+
type MenuContentImplPrivateProps = {
|
|
69
68
|
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
70
69
|
onDismiss?: DismissableLayerProps['onDismiss'];
|
|
71
70
|
disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];
|
|
@@ -97,7 +96,7 @@ interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperC
|
|
|
97
96
|
onFocusOutside?: DismissableLayerProps['onFocusOutside'];
|
|
98
97
|
onInteractOutside?: DismissableLayerProps['onInteractOutside'];
|
|
99
98
|
}
|
|
100
|
-
|
|
99
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
101
100
|
interface MenuGroupProps extends PrimitiveDivProps {
|
|
102
101
|
}
|
|
103
102
|
declare const MenuGroup: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -112,7 +111,7 @@ interface MenuItemImplProps extends PrimitiveDivProps {
|
|
|
112
111
|
disabled?: boolean;
|
|
113
112
|
textValue?: string;
|
|
114
113
|
}
|
|
115
|
-
|
|
114
|
+
type CheckedState = boolean | 'indeterminate';
|
|
116
115
|
interface MenuCheckboxItemProps extends MenuItemProps {
|
|
117
116
|
checked?: CheckedState;
|
|
118
117
|
onCheckedChange?: (checked: boolean) => void;
|
|
@@ -127,7 +126,7 @@ interface MenuRadioItemProps extends MenuItemProps {
|
|
|
127
126
|
value: string;
|
|
128
127
|
}
|
|
129
128
|
declare const MenuRadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
130
|
-
|
|
129
|
+
type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
131
130
|
interface MenuItemIndicatorProps extends PrimitiveSpanProps {
|
|
132
131
|
/**
|
|
133
132
|
* Used to force mounting when more control is needed. Useful when
|
|
@@ -139,7 +138,7 @@ declare const MenuItemIndicator: React.ForwardRefExoticComponent<MenuItemIndicat
|
|
|
139
138
|
interface MenuSeparatorProps extends PrimitiveDivProps {
|
|
140
139
|
}
|
|
141
140
|
declare const MenuSeparator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
142
|
-
|
|
141
|
+
type PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
143
142
|
interface MenuArrowProps extends PopperArrowProps {
|
|
144
143
|
}
|
|
145
144
|
declare const MenuArrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|