@instructure/ui-menu 8.13.1-snapshot.26 → 8.13.1-snapshot.36
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/es/Menu/MenuItem/index.js +28 -21
- package/es/Menu/MenuItem/props.js +0 -23
- package/es/Menu/MenuItemGroup/index.js +17 -13
- package/es/Menu/MenuItemGroup/props.js +1 -30
- package/es/Menu/MenuItemSeparator/index.js +6 -2
- package/es/Menu/index.js +56 -52
- package/es/Menu/props.js +1 -113
- package/es/MenuContext.js +3 -3
- package/lib/Menu/MenuItem/index.js +28 -21
- package/lib/Menu/MenuItem/props.js +0 -23
- package/lib/Menu/MenuItemGroup/index.js +17 -13
- package/lib/Menu/MenuItemGroup/props.js +1 -30
- package/lib/Menu/MenuItemSeparator/index.js +6 -2
- package/lib/Menu/index.js +58 -52
- package/lib/Menu/props.js +1 -113
- package/lib/MenuContext.js +2 -2
- package/package.json +21 -21
- package/src/Menu/MenuItem/index.tsx +24 -34
- package/src/Menu/MenuItem/props.ts +36 -27
- package/src/Menu/MenuItemGroup/index.tsx +28 -48
- package/src/Menu/MenuItemGroup/props.ts +37 -30
- package/src/Menu/MenuItemSeparator/index.tsx +2 -4
- package/src/Menu/index.tsx +79 -133
- package/src/Menu/props.ts +76 -84
- package/src/MenuContext.ts +3 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Menu/MenuItem/index.d.ts +24 -23
- package/types/Menu/MenuItem/index.d.ts.map +1 -1
- package/types/Menu/MenuItem/props.d.ts +30 -7
- package/types/Menu/MenuItem/props.d.ts.map +1 -1
- package/types/Menu/MenuItemGroup/index.d.ts +22 -22
- package/types/Menu/MenuItemGroup/index.d.ts.map +1 -1
- package/types/Menu/MenuItemGroup/props.d.ts +33 -8
- package/types/Menu/MenuItemGroup/props.d.ts.map +1 -1
- package/types/Menu/MenuItemSeparator/index.d.ts.map +1 -1
- package/types/Menu/index.d.ts +57 -67
- package/types/Menu/index.d.ts.map +1 -1
- package/types/Menu/props.d.ts +94 -16
- package/types/Menu/props.d.ts.map +1 -1
- package/types/MenuContext.d.ts +3 -2
- package/types/MenuContext.d.ts.map +1 -1
package/types/Menu/props.d.ts
CHANGED
|
@@ -1,40 +1,118 @@
|
|
|
1
|
-
|
|
2
|
-
import type { PropValidators, MenuTheme } from '@instructure/shared-types';
|
|
1
|
+
import type { Menu } from './index';
|
|
2
|
+
import type { PropValidators, MenuTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
3
3
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
import type { PlacementPropValues, PositionConstraint, PositionMountNode } from '@instructure/ui-position';
|
|
5
|
+
import type { OnMenuItemSelect } from './MenuItem/props';
|
|
6
|
+
import type { Popover } from '@instructure/ui-popover';
|
|
7
|
+
import React from 'react';
|
|
5
8
|
declare type MenuOwnProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Children of type `Menu.Item`, `Menu.Group`, `Menu.Separator`, or `Menu`
|
|
11
|
+
*/
|
|
6
12
|
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Description of the `<Menu />`
|
|
15
|
+
*/
|
|
7
16
|
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Is the `<Menu />` disabled
|
|
19
|
+
*/
|
|
8
20
|
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The trigger element, if the `<Menu />` is to render as a popover
|
|
23
|
+
*/
|
|
9
24
|
trigger?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* If a trigger is supplied, where should the `<Menu />` be placed (relative to the trigger)
|
|
27
|
+
*/
|
|
10
28
|
placement?: PlacementPropValues;
|
|
29
|
+
/**
|
|
30
|
+
* Should the `<Menu />` be open for the initial render
|
|
31
|
+
*/
|
|
11
32
|
defaultShow?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Is the `<Menu />` open (should be accompanied by `onToggle`)
|
|
35
|
+
*/
|
|
36
|
+
show?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Callback fired when the `<Menu />` is toggled open/closed. When used with `show`,
|
|
39
|
+
* the component will not control its own state.
|
|
40
|
+
*/
|
|
41
|
+
onToggle?: (show: boolean, menu: Menu) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Callback fired when an item within the `<Menu />` is selected
|
|
44
|
+
*/
|
|
45
|
+
onSelect?: OnMenuItemSelect;
|
|
46
|
+
/**
|
|
47
|
+
* If a trigger is supplied, callback fired when the `<Menu />` is closed
|
|
48
|
+
*/
|
|
49
|
+
onDismiss?: (event: Event, documentClick: boolean) => void;
|
|
50
|
+
/**
|
|
51
|
+
* If a trigger is supplied, callback fired when the `<Menu />` trigger is focused
|
|
52
|
+
*/
|
|
53
|
+
onFocus?: (event: Event) => void;
|
|
54
|
+
/**
|
|
55
|
+
* If a trigger is supplied, callback fired onMouseOver for the `<Menu />` trigger
|
|
56
|
+
*/
|
|
57
|
+
onMouseOver?: (event: Event) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Callback fired on the onKeyDown of the `<Menu />`
|
|
60
|
+
*/
|
|
61
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Callback fired on the onKeyUp of the `<Menu />`
|
|
64
|
+
*/
|
|
65
|
+
onKeyUp?: (event: React.KeyboardEvent<HTMLUListElement>) => void;
|
|
66
|
+
/**
|
|
67
|
+
* A function that returns a reference to the `<Menu />`
|
|
68
|
+
*/
|
|
69
|
+
menuRef?: (el: HTMLUListElement | null) => void;
|
|
70
|
+
/**
|
|
71
|
+
* A function that returns a reference to the `<Popover />`
|
|
72
|
+
*/
|
|
73
|
+
popoverRef?: (el: Popover | null) => void;
|
|
74
|
+
/**
|
|
75
|
+
* If a trigger is supplied, an element or a function returning an element to use as the mount node
|
|
76
|
+
* for the `<Menu />` (defaults to `document.body`)
|
|
77
|
+
*/
|
|
23
78
|
mountNode?: PositionMountNode;
|
|
79
|
+
/**
|
|
80
|
+
* The parent in which to constrain the menu.
|
|
81
|
+
* One of: 'window', 'scroll-parent', 'parent', 'none', an element,
|
|
82
|
+
* or a function returning an element
|
|
83
|
+
*/
|
|
24
84
|
constrain?: PositionConstraint;
|
|
25
|
-
|
|
26
|
-
|
|
85
|
+
/**
|
|
86
|
+
* If a trigger is supplied, should the `<Menu />` hide when an item is selected
|
|
87
|
+
*/
|
|
27
88
|
shouldHideOnSelect?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* If a trigger is supplied, should the `<Menu />` focus the trigger on after closing
|
|
91
|
+
*/
|
|
28
92
|
shouldFocusTriggerOnClose?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The type of `<Menu />`
|
|
95
|
+
*/
|
|
29
96
|
type?: 'flyout';
|
|
30
97
|
id?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Whether or not an arrow pointing to the trigger should be rendered
|
|
100
|
+
*/
|
|
31
101
|
withArrow?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* The horizontal offset for the positioned content.
|
|
104
|
+
* Works only if `trigger` is provided.
|
|
105
|
+
*/
|
|
32
106
|
offsetX?: string | number;
|
|
107
|
+
/**
|
|
108
|
+
* The vertical offset for the positioned content.
|
|
109
|
+
* Works only if `trigger` is provided.
|
|
110
|
+
*/
|
|
33
111
|
offsetY?: string | number;
|
|
34
112
|
};
|
|
35
113
|
declare type PropKeys = keyof MenuOwnProps;
|
|
36
114
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
37
|
-
declare type MenuProps = MenuOwnProps & WithStyleProps<MenuTheme, MenuStyle>;
|
|
115
|
+
declare type MenuProps = MenuOwnProps & WithStyleProps<MenuTheme, MenuStyle> & OtherHTMLAttributes<MenuOwnProps>;
|
|
38
116
|
declare type MenuStyle = ComponentStyle<'menu'>;
|
|
39
117
|
declare const propTypes: PropValidators<PropKeys>;
|
|
40
118
|
declare const allowedProps: AllowedPropKeys;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Menu/props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Menu/props.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,aAAK,YAAY,GAAG;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9C;;OAEG;IACH,QAAQ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AAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,SAAS,GAAG,YAAY,GAC3B,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,GACpC,mBAAmB,CAAC,YAAY,CAAC,CAAA;AAEnC,aAAK,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAEvC,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA+BvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eA0BnB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/MenuContext.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MenuItem } from './Menu/MenuItem';
|
|
2
3
|
/**
|
|
3
4
|
---
|
|
4
5
|
private: true
|
|
@@ -6,8 +7,8 @@ private: true
|
|
|
6
7
|
@module MenuContext
|
|
7
8
|
**/
|
|
8
9
|
declare const MenuContext: import("react").Context<{
|
|
9
|
-
registerMenuItem: () => void;
|
|
10
|
-
removeMenuItem: () => void;
|
|
10
|
+
registerMenuItem: (_value: MenuItem) => void;
|
|
11
|
+
removeMenuItem: (_value: MenuItem) => void;
|
|
11
12
|
}>;
|
|
12
13
|
export default MenuContext;
|
|
13
14
|
export { MenuContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../src/MenuContext.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../src/MenuContext.ts"],"names":[],"mappings":";AAyBA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,QAAA,MAAM,WAAW;+BACY,QAAQ;6BACV,QAAQ;EACjC,CAAA;AAEF,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|