@radix-ui/react-menu 0.1.7-rc.2 → 0.1.7-rc.22
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 +31 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1011 -1
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +992 -1
- package/dist/index.module.js.map +1 -1
- package/package.json +17 -17
package/dist/index.d.ts
CHANGED
|
@@ -9,19 +9,13 @@ 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
11
|
export interface MenuProps {
|
|
12
|
+
children?: React.ReactNode;
|
|
12
13
|
open?: boolean;
|
|
13
14
|
onOpenChange?(open: boolean): void;
|
|
14
15
|
dir?: Direction;
|
|
15
16
|
modal?: boolean;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
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
19
|
type PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;
|
|
26
20
|
export interface MenuAnchorProps extends PopperAnchorProps {
|
|
27
21
|
}
|
|
@@ -31,7 +25,7 @@ export const MenuAnchor: React.ForwardRefExoticComponent<MenuAnchorProps & React
|
|
|
31
25
|
* they have conflicting prop types. We agreed that we would allow MenuSubContent to
|
|
32
26
|
* accept props that it would just ignore.
|
|
33
27
|
*/
|
|
34
|
-
export interface MenuContentProps extends
|
|
28
|
+
export interface MenuContentProps extends MenuRootContentTypeProps {
|
|
35
29
|
/**
|
|
36
30
|
* Used to force mounting when more control is needed. Useful when
|
|
37
31
|
* controlling animation with React animation libraries.
|
|
@@ -39,9 +33,7 @@ export interface MenuContentProps extends MenuRootContentProps {
|
|
|
39
33
|
forceMount?: true;
|
|
40
34
|
}
|
|
41
35
|
export const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
-
interface
|
|
43
|
-
}
|
|
44
|
-
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents' | 'disableOutsideScroll'> {
|
|
36
|
+
interface MenuRootContentTypeProps extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {
|
|
45
37
|
}
|
|
46
38
|
type RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;
|
|
47
39
|
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
@@ -51,13 +43,19 @@ type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.
|
|
|
51
43
|
type MenuContentImplPrivateProps = {
|
|
52
44
|
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
53
45
|
onDismiss?: DismissableLayerProps['onDismiss'];
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];
|
|
47
|
+
/**
|
|
48
|
+
* Whether scrolling outside the `MenuContent` should be prevented
|
|
49
|
+
* (default: `false`)
|
|
50
|
+
*/
|
|
51
|
+
disableOutsideScroll?: boolean;
|
|
56
52
|
/**
|
|
57
53
|
* Whether focus should be trapped within the `MenuContent`
|
|
58
54
|
* (default: false)
|
|
59
55
|
*/
|
|
60
56
|
trapFocus?: FocusScopeProps['trapped'];
|
|
57
|
+
};
|
|
58
|
+
interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperContentProps, 'dir'> {
|
|
61
59
|
/**
|
|
62
60
|
* Event handler called when auto-focusing on close.
|
|
63
61
|
* Can be prevented.
|
|
@@ -67,11 +65,6 @@ interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit<PopperC
|
|
|
67
65
|
* @see https://github.com/theKashey/react-remove-scroll#usage
|
|
68
66
|
*/
|
|
69
67
|
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;AAsBH;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;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,OAAA,MAAM,MAAM,MAAM,EAAE,CAAC,SAAS,CA8C7B,CAAC;AAWF,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,gBAAgB,MAAM,CAAC,CAAC;AACvF,gCAA0B,SAAQ,iBAAiB;CAAG;AAEtD,OAAA,MAAM,kGAML,CAAC;AAsBF;;;;GAIG;AACH,iCAA2B,SAAQ,wBAAwB;IACzD;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED,OAAA,MAAM,oGAoBL,CAAC;AAKF,kCACE,SAAQ,IAAI,CAAC,oBAAo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C;AACrF,+BAAyB,SAAQ,gBAAgB;CAAG;AAEpD,OAAA,MAAM,+FAML,CAAC;AAmBF;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CACpC;AAED,OAAA,MAAM,SAAS,MAAM,EAAE,CAAC,YAAY,CAmCnC,CAAC;AAWF,oCAA8B,SAAQ,iBAAiB;CAAG;AAE1D,OAAA,MAAM,0GAuHL,CAAC;AAWF,oCACE,SAAQ,IAAI,CACV,oBAAoB,EACpB,MAAM,2BAA2B,GAAG,kBAAkB,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CACxF;IACD;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED,OAAA,MAAM,0GAuDL,CAAC;AAgGF,OAAA,MAAM,yBAAW,CAAC;AAClB,OAAA,MAAM,8FAAmB,CAAC;AAC1B,OAAA,MAAM,gGAAqB,CAAC;AAC5B,OAAA,MAAM,4FAAiB,CAAC;AACxB,OAAA,MAAM,4FAAiB,CAAC;AACxB,OAAA,MAAM,0FAAe,CAAC;AACtB,OAAA,MAAM,0GAA+B,CAAC;AACtC,OAAA,MAAM,sGAA2B,CAAC;AAClC,OAAA,MAAM,oGAAyB,CAAC;AAChC,OAAA,MAAM,6GAAiC,CAAC;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"}
|