@radix-ui/react-menu 0.1.7-rc.3 → 0.1.7-rc.30
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.ts +36 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1012 -1
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +993 -1
- package/dist/index.module.js.map +1 -1
- package/package.json +17 -17
package/dist/index.d.ts
CHANGED
|
@@ -8,20 +8,19 @@ import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
|
8
8
|
import * as RovingFocusGroup from "@radix-ui/react-roving-focus";
|
|
9
9
|
type Direction = 'ltr' | 'rtl';
|
|
10
10
|
export const createMenuScope: import("@radix-ui/react-context").CreateScope;
|
|
11
|
+
type RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;
|
|
11
12
|
export interface MenuProps {
|
|
13
|
+
children?: React.ReactNode;
|
|
12
14
|
open?: boolean;
|
|
13
15
|
onOpenChange?(open: boolean): void;
|
|
14
16
|
dir?: Direction;
|
|
15
17
|
modal?: boolean;
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @see https://github.com/theKashey/react-remove-scroll#usage
|
|
20
|
+
*/
|
|
21
|
+
allowPinchZoom?: RemoveScrollProps['allowPinchZoom'];
|
|
17
22
|
}
|
|
18
23
|
export const Menu: React.FC<MenuProps>;
|
|
19
|
-
export interface MenuSubProps {
|
|
20
|
-
open?: boolean;
|
|
21
|
-
onOpenChange?(open: boolean): void;
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
}
|
|
24
|
-
export const MenuSub: React.FC<MenuSubProps>;
|
|
25
24
|
type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
26
25
|
export interface MenuAnchorProps extends PopperAnchorProps {
|
|
27
26
|
}
|
|
@@ -31,7 +30,7 @@ export const MenuAnchor: React.ForwardRefExoticComponent<MenuAnchorProps & React
|
|
|
31
30
|
* they have conflicting prop types. We agreed that we would allow MenuSubContent to
|
|
32
31
|
* accept props that it would just ignore.
|
|
33
32
|
*/
|
|
34
|
-
export interface MenuContentProps extends
|
|
33
|
+
export interface MenuContentProps extends MenuRootContentTypeProps {
|
|
35
34
|
/**
|
|
36
35
|
* Used to force mounting when more control is needed. Useful when
|
|
37
36
|
* controlling animation with React animation libraries.
|
|
@@ -39,11 +38,8 @@ export interface MenuContentProps extends MenuRootContentProps {
|
|
|
39
38
|
forceMount?: true;
|
|
40
39
|
}
|
|
41
40
|
export const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
-
interface
|
|
43
|
-
}
|
|
44
|
-
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents' | 'disableOutsideScroll'> {
|
|
41
|
+
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {
|
|
45
42
|
}
|
|
46
|
-
type RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;
|
|
47
43
|
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
48
44
|
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
49
45
|
type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
@@ -51,27 +47,24 @@ type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.
|
|
|
51
47
|
type MenuContentImplPrivateProps = {
|
|
52
48
|
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
53
49
|
onDismiss?: DismissableLayerProps['onDismiss'];
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];
|
|
51
|
+
/**
|
|
52
|
+
* Whether scrolling outside the `MenuContent` should be prevented
|
|
53
|
+
* (default: `false`)
|
|
54
|
+
*/
|
|
55
|
+
disableOutsideScroll?: boolean;
|
|
56
56
|
/**
|
|
57
57
|
* Whether focus should be trapped within the `MenuContent`
|
|
58
58
|
* (default: false)
|
|
59
59
|
*/
|
|
60
60
|
trapFocus?: FocusScopeProps['trapped'];
|
|
61
|
+
};
|
|
62
|
+
interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperContentProps, 'dir'> {
|
|
61
63
|
/**
|
|
62
64
|
* Event handler called when auto-focusing on close.
|
|
63
65
|
* Can be prevented.
|
|
64
66
|
*/
|
|
65
67
|
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
66
|
-
/**
|
|
67
|
-
* @see https://github.com/theKashey/react-remove-scroll#usage
|
|
68
|
-
*/
|
|
69
|
-
allowPinchZoom?: RemoveScrollProps['allowPinchZoom'];
|
|
70
|
-
/**
|
|
71
|
-
* Whether scrolling outside the `MenuContent` should be prevented
|
|
72
|
-
* (default: `false`)
|
|
73
|
-
*/
|
|
74
|
-
disableOutsideScroll?: boolean;
|
|
75
68
|
/**
|
|
76
69
|
* Whether keyboard navigation should loop around
|
|
77
70
|
* @defaultValue false
|
|
@@ -82,7 +75,6 @@ interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperC
|
|
|
82
75
|
* (default: `true`)
|
|
83
76
|
*/
|
|
84
77
|
portalled?: boolean;
|
|
85
|
-
disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];
|
|
86
78
|
onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
|
|
87
79
|
onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
|
|
88
80
|
onFocusOutside?: DismissableLayerProps['onFocusOutside'];
|
|
@@ -99,9 +91,6 @@ export interface MenuItemProps extends Omit<MenuItemImplProps, 'onSelect'> {
|
|
|
99
91
|
onSelect?: (event: Event) => void;
|
|
100
92
|
}
|
|
101
93
|
export const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
102
|
-
export interface MenuSubTriggerProps extends MenuItemImplProps {
|
|
103
|
-
}
|
|
104
|
-
export const MenuSubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
105
94
|
interface MenuItemImplProps extends PrimitiveDivProps {
|
|
106
95
|
disabled?: boolean;
|
|
107
96
|
textValue?: string;
|
|
@@ -136,10 +125,25 @@ type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Ar
|
|
|
136
125
|
export interface MenuArrowProps extends PopperArrowProps {
|
|
137
126
|
}
|
|
138
127
|
export const MenuArrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
128
|
+
export interface MenuSubProps {
|
|
129
|
+
children?: React.ReactNode;
|
|
130
|
+
open?: boolean;
|
|
131
|
+
onOpenChange?(open: boolean): void;
|
|
132
|
+
}
|
|
133
|
+
export const MenuSub: React.FC<MenuSubProps>;
|
|
134
|
+
export interface MenuSubTriggerProps extends MenuItemImplProps {
|
|
135
|
+
}
|
|
136
|
+
export const MenuSubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
137
|
+
export interface MenuSubContentProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'portalled' | 'side' | 'align'> {
|
|
138
|
+
/**
|
|
139
|
+
* Used to force mounting when more control is needed. Useful when
|
|
140
|
+
* controlling animation with React animation libraries.
|
|
141
|
+
*/
|
|
142
|
+
forceMount?: true;
|
|
143
|
+
}
|
|
144
|
+
export const MenuSubContent: React.ForwardRefExoticComponent<MenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
139
145
|
export const Root: React.FC<MenuProps>;
|
|
140
|
-
export const Sub: React.FC<MenuSubProps>;
|
|
141
146
|
export const Anchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
142
|
-
export const SubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
143
147
|
export const Content: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
144
148
|
export const Group: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
145
149
|
export const Label: React.ForwardRefExoticComponent<MenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -150,5 +154,8 @@ export const RadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & Rea
|
|
|
150
154
|
export const ItemIndicator: React.ForwardRefExoticComponent<MenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
151
155
|
export const Separator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
152
156
|
export const Arrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
157
|
+
export const Sub: React.FC<MenuSubProps>;
|
|
158
|
+
export const SubTrigger: React.ForwardRefExoticComponent<MenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
159
|
+
export const SubContent: React.ForwardRefExoticComponent<MenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
153
160
|
|
|
154
161
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;AAwBA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AA4B/B,OAAA,sFAIE,CAAC;AAuBH,yBAAyB,MAAM,cAAc,CAAC,mBAAmB,CAAC,CAAC;AACnE;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,GAAG,CAAC,EAAE,SAAS,CAAC;I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AACxC,OAAA,MAAM,oGAAyB,CAAC;AAChC,OAAA,MAAM,2FAAiB,CAAC;AACxB,OAAA,MAAM,2BAAa,CAAC;AACpB,OAAA,MAAM,sGAA2B,CAAC;AAClC,OAAA,MAAM,sGAA2B,CAAC","sources":["packages/react/menu/src/packages/react/menu/src/Menu.tsx","packages/react/menu/src/packages/react/menu/src/index.ts","packages/react/menu/src/index.ts"],"sourcesContent":[null,null,"export * from './Menu';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|