@instructure/ui-menu 8.26.3 → 8.26.4-snapshot-3
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/CHANGELOG.md +11 -0
- package/package.json +20 -20
- package/src/Menu/MenuItem/index.tsx +4 -3
- package/src/Menu/MenuItem/props.ts +5 -3
- package/src/Menu/MenuItemGroup/index.tsx +2 -1
- package/src/Menu/MenuItemGroup/props.ts +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Menu/MenuItem/index.d.ts +4 -3
- package/types/Menu/MenuItem/index.d.ts.map +1 -1
- package/types/Menu/MenuItem/props.d.ts +3 -2
- package/types/Menu/MenuItem/props.d.ts.map +1 -1
- package/types/Menu/MenuItemGroup/index.d.ts +5 -4
- package/types/Menu/MenuItemGroup/index.d.ts.map +1 -1
- package/types/Menu/MenuItemGroup/props.d.ts +2 -1
- package/types/Menu/MenuItemGroup/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.26.4-snapshot-3](https://github.com/instructure/instructure-ui/compare/v8.26.3...v8.26.4-snapshot-3) (2022-07-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support React 18 ([0a2bf0c](https://github.com/instructure/instructure-ui/commit/0a2bf0cdd4d8bcec6e42a7ccf28a787e4a35bc40))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [8.26.3](https://github.com/instructure/instructure-ui/compare/v8.26.2...v8.26.3) (2022-07-14)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @instructure/ui-menu
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-menu",
|
|
3
|
-
"version": "8.26.3",
|
|
3
|
+
"version": "8.26.4-snapshot-3",
|
|
4
4
|
"description": "A dropdown menu component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,32 +23,32 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.26.3",
|
|
27
|
-
"@instructure/ui-color-utils": "8.26.3",
|
|
28
|
-
"@instructure/ui-test-locator": "8.26.3",
|
|
29
|
-
"@instructure/ui-test-queries": "8.26.3",
|
|
30
|
-
"@instructure/ui-test-utils": "8.26.3",
|
|
31
|
-
"@instructure/ui-themes": "8.26.3"
|
|
26
|
+
"@instructure/ui-babel-preset": "8.26.4-snapshot-3",
|
|
27
|
+
"@instructure/ui-color-utils": "8.26.4-snapshot-3",
|
|
28
|
+
"@instructure/ui-test-locator": "8.26.4-snapshot-3",
|
|
29
|
+
"@instructure/ui-test-queries": "8.26.4-snapshot-3",
|
|
30
|
+
"@instructure/ui-test-utils": "8.26.4-snapshot-3",
|
|
31
|
+
"@instructure/ui-themes": "8.26.4-snapshot-3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/console": "8.26.3",
|
|
36
|
-
"@instructure/emotion": "8.26.3",
|
|
37
|
-
"@instructure/shared-types": "8.26.3",
|
|
38
|
-
"@instructure/ui-a11y-utils": "8.26.3",
|
|
39
|
-
"@instructure/ui-dom-utils": "8.26.3",
|
|
40
|
-
"@instructure/ui-icons": "8.26.3",
|
|
41
|
-
"@instructure/ui-popover": "8.26.3",
|
|
42
|
-
"@instructure/ui-position": "8.26.3",
|
|
43
|
-
"@instructure/ui-prop-types": "8.26.3",
|
|
44
|
-
"@instructure/ui-react-utils": "8.26.3",
|
|
45
|
-
"@instructure/ui-testable": "8.26.3",
|
|
46
|
-
"@instructure/ui-utils": "8.26.3",
|
|
35
|
+
"@instructure/console": "8.26.4-snapshot-3",
|
|
36
|
+
"@instructure/emotion": "8.26.4-snapshot-3",
|
|
37
|
+
"@instructure/shared-types": "8.26.4-snapshot-3",
|
|
38
|
+
"@instructure/ui-a11y-utils": "8.26.4-snapshot-3",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.26.4-snapshot-3",
|
|
40
|
+
"@instructure/ui-icons": "8.26.4-snapshot-3",
|
|
41
|
+
"@instructure/ui-popover": "8.26.4-snapshot-3",
|
|
42
|
+
"@instructure/ui-position": "8.26.4-snapshot-3",
|
|
43
|
+
"@instructure/ui-prop-types": "8.26.4-snapshot-3",
|
|
44
|
+
"@instructure/ui-react-utils": "8.26.4-snapshot-3",
|
|
45
|
+
"@instructure/ui-testable": "8.26.4-snapshot-3",
|
|
46
|
+
"@instructure/ui-utils": "8.26.4-snapshot-3",
|
|
47
47
|
"keycode": "^2",
|
|
48
48
|
"prop-types": "^15"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"react": ">=16.8 <=
|
|
51
|
+
"react": ">=16.8 <=18"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
/** @jsx jsx */
|
|
25
|
-
import React, { Component } from 'react'
|
|
25
|
+
import React, { Component, MouseEventHandler } from 'react'
|
|
26
26
|
import keycode from 'keycode'
|
|
27
27
|
|
|
28
28
|
import { IconCheckSolid, IconArrowOpenEndSolid } from '@instructure/ui-icons'
|
|
@@ -43,6 +43,7 @@ import generateComponentTheme from './theme'
|
|
|
43
43
|
|
|
44
44
|
import { propTypes, allowedProps } from './props'
|
|
45
45
|
import type { MenuItemProps, MenuItemState } from './props'
|
|
46
|
+
import type { ViewOwnProps } from '@instructure/ui-view'
|
|
46
47
|
|
|
47
48
|
/**
|
|
48
49
|
---
|
|
@@ -115,7 +116,7 @@ class MenuItem extends Component<MenuItemProps, MenuItemState> {
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
handleClick = (e: React.MouseEvent) => {
|
|
119
|
+
handleClick = (e: React.MouseEvent<ViewOwnProps>) => {
|
|
119
120
|
const { onSelect, onClick, disabled, value } = this.props
|
|
120
121
|
const selected = !this.selected
|
|
121
122
|
|
|
@@ -254,7 +255,7 @@ class MenuItem extends Component<MenuItemProps, MenuItemState> {
|
|
|
254
255
|
: 'false'
|
|
255
256
|
: undefined
|
|
256
257
|
}
|
|
257
|
-
onClick={this.handleClick}
|
|
258
|
+
onClick={this.handleClick as MouseEventHandler}
|
|
258
259
|
onKeyUp={createChainedFunction(onKeyUp, this.handleKeyUp)}
|
|
259
260
|
onKeyDown={createChainedFunction(onKeyDown, this.handleKeyDown)}
|
|
260
261
|
ref={this.handleRef}
|
|
@@ -35,9 +35,10 @@ import type {
|
|
|
35
35
|
} from '@instructure/shared-types'
|
|
36
36
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
37
37
|
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
38
|
+
import type { ViewOwnProps } from '@instructure/ui-view'
|
|
38
39
|
|
|
39
40
|
type OnMenuItemSelect = (
|
|
40
|
-
e: React.MouseEvent
|
|
41
|
+
e: React.MouseEvent<ViewOwnProps>,
|
|
41
42
|
value: MenuItemOwnProps['value'],
|
|
42
43
|
selected: MenuItemOwnProps['selected'],
|
|
43
44
|
args: MenuItem
|
|
@@ -60,7 +61,7 @@ type MenuItemOwnProps = {
|
|
|
60
61
|
* when used with the `selected` prop, the component will not control its own state
|
|
61
62
|
*/
|
|
62
63
|
onSelect?: OnMenuItemSelect
|
|
63
|
-
onClick?: (e: React.MouseEvent) => void
|
|
64
|
+
onClick?: (e: React.MouseEvent<ViewOwnProps>) => void
|
|
64
65
|
onKeyDown?: (e: React.KeyboardEvent) => void
|
|
65
66
|
onKeyUp?: (e: React.KeyboardEvent) => void
|
|
66
67
|
onMouseOver?: (e: React.MouseEvent, args: MenuItem) => void
|
|
@@ -84,7 +85,8 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
|
84
85
|
|
|
85
86
|
type MenuItemProps = MenuItemOwnProps &
|
|
86
87
|
WithStyleProps<MenuItemTheme, MenuItemStyle> &
|
|
87
|
-
OtherHTMLAttributes<MenuItemOwnProps> &
|
|
88
|
+
OtherHTMLAttributes<MenuItemOwnProps> &
|
|
89
|
+
WithDeterministicIdProps
|
|
88
90
|
|
|
89
91
|
type MenuItemStyle = ComponentStyle<'menuItem' | 'icon' | 'label'>
|
|
90
92
|
|
|
@@ -45,6 +45,7 @@ import generateComponentTheme from './theme'
|
|
|
45
45
|
|
|
46
46
|
import { propTypes, allowedProps } from './props'
|
|
47
47
|
import type { MenuGroupProps, MenuGroupState } from './props'
|
|
48
|
+
import type { ViewOwnProps } from '@instructure/ui-view'
|
|
48
49
|
|
|
49
50
|
type MenuItemChild = React.ComponentElement<MenuItemProps, MenuItem>
|
|
50
51
|
type MenuSeparatorChild = React.ComponentElement<
|
|
@@ -126,7 +127,7 @@ class MenuItemGroup extends Component<MenuGroupProps, MenuGroupState> {
|
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
updateSelected = (
|
|
129
|
-
e: React.MouseEvent
|
|
130
|
+
e: React.MouseEvent<ViewOwnProps>,
|
|
130
131
|
value: MenuItemProps['value'],
|
|
131
132
|
items: MenuGroupState['selected'],
|
|
132
133
|
selected: MenuItemProps['selected'],
|
|
@@ -41,6 +41,7 @@ import type {
|
|
|
41
41
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
42
42
|
import type { MenuItemProps } from '../MenuItem/props'
|
|
43
43
|
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
44
|
+
import type { ViewOwnProps } from '@instructure/ui-view'
|
|
44
45
|
|
|
45
46
|
type MenuGroupOwnProps = {
|
|
46
47
|
label: React.ReactNode
|
|
@@ -61,7 +62,7 @@ type MenuGroupOwnProps = {
|
|
|
61
62
|
* call this function when a menu item is selected
|
|
62
63
|
*/
|
|
63
64
|
onSelect?: (
|
|
64
|
-
e: React.MouseEvent
|
|
65
|
+
e: React.MouseEvent<ViewOwnProps>,
|
|
65
66
|
updated: MenuItemProps['value'][],
|
|
66
67
|
selected: MenuItemProps['selected'],
|
|
67
68
|
item: MenuItem
|