@atlaskit/dropdown-menu 11.3.1 → 11.5.0
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 +22 -0
- package/dist/cjs/dropdown-menu.js +9 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/dropdown-menu.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/dropdown-menu.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/dropdown-menu.d.ts +2 -2
- package/dist/types/types.d.ts +4 -4
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 11.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7f7e4a0709b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f7e4a0709b) - Fixes the types of the CustomTrigger to be generic rather than set as HTMLElement. This allows improved type inference for custom triggers.
|
|
8
|
+
|
|
9
|
+
## 11.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`00fc216bd94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/00fc216bd94) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 11.3.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
24
|
+
|
|
3
25
|
## 11.3.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -17,7 +17,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
17
17
|
|
|
18
18
|
var _react = require("react");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _react2 = require("@emotion/react");
|
|
21
21
|
|
|
22
22
|
var _bindEventListener = require("bind-event-listener");
|
|
23
23
|
|
|
@@ -56,7 +56,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
56
56
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
57
57
|
|
|
58
58
|
var gridSize = (0, _constants.gridSize)();
|
|
59
|
-
var spinnerContainerStyles = (0,
|
|
59
|
+
var spinnerContainerStyles = (0, _react2.css)({
|
|
60
60
|
display: 'flex',
|
|
61
61
|
minWidth: "".concat(gridSize * 20, "px"),
|
|
62
62
|
padding: "".concat(gridSize * 2.5, "px"),
|
|
@@ -200,7 +200,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
200
200
|
});
|
|
201
201
|
}, [isFocused, isLocalOpen, handleTriggerClicked]);
|
|
202
202
|
var id = (0, _useGeneratedId.default)();
|
|
203
|
-
return (0,
|
|
203
|
+
return (0, _react2.jsx)(_selectionStore.default, null, (0, _react2.jsx)(_popup.default, {
|
|
204
204
|
id: isLocalOpen ? id : undefined,
|
|
205
205
|
shouldFlip: shouldFlip,
|
|
206
206
|
isOpen: isLocalOpen,
|
|
@@ -222,13 +222,13 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
222
222
|
}));
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
return (0,
|
|
225
|
+
return (0, _react2.jsx)(_standardButton.default, (0, _extends2.default)({}, bindFocus, {
|
|
226
226
|
ref: triggerProps.ref,
|
|
227
227
|
"aria-controls": triggerProps['aria-controls'],
|
|
228
228
|
"aria-expanded": triggerProps['aria-expanded'],
|
|
229
229
|
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
230
230
|
isSelected: isLocalOpen,
|
|
231
|
-
iconAfter: (0,
|
|
231
|
+
iconAfter: (0, _react2.jsx)(_chevronDown.default, {
|
|
232
232
|
size: "medium",
|
|
233
233
|
label: ""
|
|
234
234
|
}),
|
|
@@ -238,16 +238,16 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
238
238
|
},
|
|
239
239
|
content: function content(_ref) {
|
|
240
240
|
var setInitialFocusRef = _ref.setInitialFocusRef;
|
|
241
|
-
return (0,
|
|
241
|
+
return (0, _react2.jsx)(_focusManager.default, null, (0, _react2.jsx)(_menuWrapper.default, {
|
|
242
242
|
maxHeight: MAX_HEIGHT,
|
|
243
243
|
maxWidth: 800,
|
|
244
244
|
onClose: handleOnClose,
|
|
245
245
|
setInitialFocusRef: isTriggeredUsingKeyboard || autoFocus ? setInitialFocusRef : undefined
|
|
246
|
-
}, isLoading ? (0,
|
|
246
|
+
}, isLoading ? (0, _react2.jsx)("div", {
|
|
247
247
|
css: spinnerContainerStyles
|
|
248
|
-
}, (0,
|
|
248
|
+
}, (0, _react2.jsx)(_spinner.default, {
|
|
249
249
|
size: "small"
|
|
250
|
-
}), (0,
|
|
250
|
+
}), (0, _react2.jsx)(_visuallyHidden.default, {
|
|
251
251
|
role: "status"
|
|
252
252
|
}, statusLabel)) : children));
|
|
253
253
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { bind } from 'bind-event-listener';
|
|
7
7
|
import Button from '@atlaskit/button/standard-button';
|
|
8
8
|
import { KEY_DOWN } from '@atlaskit/ds-lib/keycodes';
|
package/dist/es2019/version.json
CHANGED
|
@@ -10,7 +10,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
10
10
|
|
|
11
11
|
/** @jsx jsx */
|
|
12
12
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13
|
-
import { css, jsx } from '@emotion/
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { bind } from 'bind-event-listener';
|
|
15
15
|
import Button from '@atlaskit/button/standard-button';
|
|
16
16
|
import { KEY_DOWN } from '@atlaskit/ds-lib/keycodes';
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { DropdownMenuProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* __Dropdown menu__
|
|
@@ -9,5 +9,5 @@ import type { DropdownMenuProps } from './types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/dropdown-menu/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/dropdown-menu/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const DropdownMenu: (props: DropdownMenuProps) => JSX.Element;
|
|
12
|
+
declare const DropdownMenu: <T extends HTMLElement = HTMLElement>(props: DropdownMenuProps<T>) => jsx.JSX.Element;
|
|
13
13
|
export default DropdownMenu;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ export declare type FocusItem = {
|
|
|
15
15
|
itemNode: HTMLElement;
|
|
16
16
|
};
|
|
17
17
|
export declare type Behaviors = 'checkbox' | 'radio' | 'menuitemcheckbox' | 'menuitemradio';
|
|
18
|
-
export interface CustomTriggerProps extends Omit<TriggerProps, 'ref'> {
|
|
18
|
+
export interface CustomTriggerProps<TriggerElement extends HTMLElement = HTMLElement> extends Omit<TriggerProps, 'ref'> {
|
|
19
19
|
/**
|
|
20
20
|
* Ref that should be applied to the trigger. This is used to calculate the menu position.
|
|
21
21
|
*/
|
|
22
|
-
triggerRef: Ref<
|
|
22
|
+
triggerRef: Ref<TriggerElement>;
|
|
23
23
|
/**
|
|
24
24
|
* Makes the trigger appear selected.
|
|
25
25
|
*/
|
|
@@ -49,7 +49,7 @@ export interface MenuWrapperProps extends MenuGroupProps {
|
|
|
49
49
|
}
|
|
50
50
|
export interface DropdownMenuGroupProps extends SectionProps {
|
|
51
51
|
}
|
|
52
|
-
export interface DropdownMenuProps {
|
|
52
|
+
export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElement> {
|
|
53
53
|
/**
|
|
54
54
|
* Controls the appearance of the menu.
|
|
55
55
|
* Default menu has scroll after its height exceeds the pre-defined amount.
|
|
@@ -93,7 +93,7 @@ export interface DropdownMenuProps {
|
|
|
93
93
|
* Content which will trigger the dropdown menu to open and close. Use with `triggerType`
|
|
94
94
|
* to easily get a button trigger.
|
|
95
95
|
*/
|
|
96
|
-
trigger?: string | ((triggerButtonProps: CustomTriggerProps) => ReactElement);
|
|
96
|
+
trigger?: string | ((triggerButtonProps: CustomTriggerProps<TriggerElement>) => ReactElement);
|
|
97
97
|
/**
|
|
98
98
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
99
99
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.0",
|
|
4
4
|
"description": "A dropdown menu displays a list of actions or options to a user.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@atlaskit/menu": "^1.3.0",
|
|
31
31
|
"@atlaskit/popup": "^1.4.0",
|
|
32
32
|
"@atlaskit/spinner": "^15.0.0",
|
|
33
|
-
"@atlaskit/theme": "^12.
|
|
33
|
+
"@atlaskit/theme": "^12.2.0",
|
|
34
34
|
"@atlaskit/tokens": "^0.10.0",
|
|
35
|
-
"@atlaskit/visually-hidden": "^1.
|
|
35
|
+
"@atlaskit/visually-hidden": "^1.1.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
|
-
"@emotion/
|
|
37
|
+
"@emotion/react": "^11.7.1",
|
|
38
38
|
"bind-event-listener": "^2.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@atlaskit/avatar": "^21.0.0",
|
|
46
46
|
"@atlaskit/docs": "*",
|
|
47
|
-
"@atlaskit/lozenge": "11.
|
|
48
|
-
"@atlaskit/modal-dialog": "^12.
|
|
49
|
-
"@atlaskit/section-message": "^6.
|
|
47
|
+
"@atlaskit/lozenge": "11.2.0",
|
|
48
|
+
"@atlaskit/modal-dialog": "^12.3.0",
|
|
49
|
+
"@atlaskit/section-message": "^6.2.0",
|
|
50
50
|
"@atlaskit/ssr": "*",
|
|
51
51
|
"@atlaskit/tooltip": "^17.5.0",
|
|
52
52
|
"@atlaskit/visual-regression": "*",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"react-dom": "^16.8.0",
|
|
61
61
|
"storybook-addon-performance": "^0.16.0",
|
|
62
62
|
"tiny-invariant": "^1.2.0",
|
|
63
|
-
"typescript": "4.
|
|
63
|
+
"typescript": "4.3.5"
|
|
64
64
|
},
|
|
65
65
|
"keywords": [
|
|
66
66
|
"atlaskit",
|