@atlaskit/dropdown-menu 11.10.0 → 11.10.2
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 +12 -0
- package/dist/cjs/dropdown-menu-item.js +5 -4
- package/dist/cjs/internal/components/menu-wrapper.js +5 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/dropdown-menu-item.js +4 -3
- package/dist/es2019/internal/components/menu-wrapper.js +6 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/dropdown-menu-item.js +5 -4
- package/dist/esm/internal/components/menu-wrapper.js +6 -5
- package/dist/esm/version.json +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 11.10.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 11.10.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`a07c7d8af4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a07c7d8af4f) - Apply `box-sizing: border-box` to menu wrapper when loading spinner is visible.
|
|
14
|
+
|
|
3
15
|
## 11.10.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -14,7 +14,7 @@ var _buttonItem = _interopRequireDefault(require("@atlaskit/menu/button-item"));
|
|
|
14
14
|
var _customItem = _interopRequireDefault(require("@atlaskit/menu/custom-item"));
|
|
15
15
|
var _linkItem = _interopRequireDefault(require("@atlaskit/menu/link-item"));
|
|
16
16
|
var _useRegisterItemWithFocusManager = _interopRequireDefault(require("./internal/hooks/use-register-item-with-focus-manager"));
|
|
17
|
-
var _excluded = ["component", "elemBefore", "elemAfter", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
17
|
+
var _excluded = ["component", "elemBefore", "elemAfter", "shouldTitleWrap", "shouldDescriptionWrap", "children"];
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
20
|
/**
|
|
@@ -34,6 +34,7 @@ var DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
34
34
|
shouldTitleWrap = _props$shouldTitleWra === void 0 ? true : _props$shouldTitleWra,
|
|
35
35
|
_props$shouldDescript = props.shouldDescriptionWrap,
|
|
36
36
|
shouldDescriptionWrap = _props$shouldDescript === void 0 ? true : _props$shouldDescript,
|
|
37
|
+
children = props.children,
|
|
37
38
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
38
39
|
var itemRef = (0, _useRegisterItemWithFocusManager.default)();
|
|
39
40
|
if (component) {
|
|
@@ -43,7 +44,7 @@ var DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
43
44
|
iconAfter: elemAfter,
|
|
44
45
|
shouldTitleWrap: shouldTitleWrap,
|
|
45
46
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
46
|
-
}, rest));
|
|
47
|
+
}, rest), children);
|
|
47
48
|
} else if (props.href) {
|
|
48
49
|
return /*#__PURE__*/_react.default.createElement(_linkItem.default, (0, _extends2.default)({
|
|
49
50
|
href: props.href,
|
|
@@ -53,7 +54,7 @@ var DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
53
54
|
ref: (0, _mergeRefs.default)([ref, itemRef]),
|
|
54
55
|
shouldTitleWrap: shouldTitleWrap,
|
|
55
56
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
56
|
-
}, rest));
|
|
57
|
+
}, rest), children);
|
|
57
58
|
} else {
|
|
58
59
|
return /*#__PURE__*/_react.default.createElement(_buttonItem.default, (0, _extends2.default)({
|
|
59
60
|
role: "menuitem",
|
|
@@ -62,7 +63,7 @@ var DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
62
63
|
ref: (0, _mergeRefs.default)([ref, itemRef]),
|
|
63
64
|
shouldTitleWrap: shouldTitleWrap,
|
|
64
65
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
65
|
-
}, rest));
|
|
66
|
+
}, rest), children);
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
var _default = DropdownMenuItem;
|
|
@@ -10,6 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _menuGroup = _interopRequireDefault(require("@atlaskit/menu/menu-group"));
|
|
13
|
+
var _primitives = require("@atlaskit/primitives");
|
|
13
14
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
14
15
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
15
16
|
var _focusManager = require("../components/focus-manager");
|
|
@@ -17,17 +18,17 @@ var _isCheckboxItem = _interopRequireDefault(require("../utils/is-checkbox-item"
|
|
|
17
18
|
var _isRadioItem = _interopRequireDefault(require("../utils/is-radio-item"));
|
|
18
19
|
var _excluded = ["onClose", "onUpdate", "isLoading", "statusLabel", "setInitialFocusRef", "children"];
|
|
19
20
|
/** @jsx jsx */
|
|
20
|
-
var spinnerContainerStyles = (0,
|
|
21
|
+
var spinnerContainerStyles = (0, _primitives.xcss)({
|
|
21
22
|
display: 'flex',
|
|
22
23
|
minWidth: '160px',
|
|
23
|
-
padding:
|
|
24
|
+
padding: 'space.250',
|
|
24
25
|
justifyContent: 'center'
|
|
25
26
|
});
|
|
26
27
|
var LoadingIndicator = function LoadingIndicator(_ref) {
|
|
27
28
|
var _ref$statusLabel = _ref.statusLabel,
|
|
28
29
|
statusLabel = _ref$statusLabel === void 0 ? 'Loading' : _ref$statusLabel;
|
|
29
|
-
return (0, _react2.jsx)(
|
|
30
|
-
|
|
30
|
+
return (0, _react2.jsx)(_primitives.Box, {
|
|
31
|
+
xcss: spinnerContainerStyles
|
|
31
32
|
}, (0, _react2.jsx)(_spinner.default, {
|
|
32
33
|
size: "small"
|
|
33
34
|
}), (0, _react2.jsx)(_visuallyHidden.default, {
|
package/dist/cjs/version.json
CHANGED
|
@@ -21,6 +21,7 @@ const DropdownMenuItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
21
21
|
elemAfter,
|
|
22
22
|
shouldTitleWrap = true,
|
|
23
23
|
shouldDescriptionWrap = true,
|
|
24
|
+
children,
|
|
24
25
|
...rest
|
|
25
26
|
} = props;
|
|
26
27
|
const itemRef = useRegisterItemWithFocusManager();
|
|
@@ -31,7 +32,7 @@ const DropdownMenuItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
31
32
|
iconAfter: elemAfter,
|
|
32
33
|
shouldTitleWrap: shouldTitleWrap,
|
|
33
34
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
34
|
-
}, rest));
|
|
35
|
+
}, rest), children);
|
|
35
36
|
} else if (props.href) {
|
|
36
37
|
return /*#__PURE__*/React.createElement(LinkItem, _extends({
|
|
37
38
|
href: props.href,
|
|
@@ -41,7 +42,7 @@ const DropdownMenuItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41
42
|
ref: mergeRefs([ref, itemRef]),
|
|
42
43
|
shouldTitleWrap: shouldTitleWrap,
|
|
43
44
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
44
|
-
}, rest));
|
|
45
|
+
}, rest), children);
|
|
45
46
|
} else {
|
|
46
47
|
return /*#__PURE__*/React.createElement(ButtonItem, _extends({
|
|
47
48
|
role: "menuitem",
|
|
@@ -50,7 +51,7 @@ const DropdownMenuItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
50
51
|
ref: mergeRefs([ref, itemRef]),
|
|
51
52
|
shouldTitleWrap: shouldTitleWrap,
|
|
52
53
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
53
|
-
}, rest));
|
|
54
|
+
}, rest), children);
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
57
|
export default DropdownMenuItem;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { useContext, useEffect, useLayoutEffect } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
5
|
import MenuGroup from '@atlaskit/menu/menu-group';
|
|
6
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
7
|
import Spinner from '@atlaskit/spinner';
|
|
7
8
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
8
9
|
import { FocusManagerContext } from '../components/focus-manager';
|
|
9
10
|
import isCheckboxItem from '../utils/is-checkbox-item';
|
|
10
11
|
import isRadioItem from '../utils/is-radio-item';
|
|
11
|
-
const spinnerContainerStyles =
|
|
12
|
+
const spinnerContainerStyles = xcss({
|
|
12
13
|
display: 'flex',
|
|
13
14
|
minWidth: '160px',
|
|
14
|
-
padding:
|
|
15
|
+
padding: 'space.250',
|
|
15
16
|
justifyContent: 'center'
|
|
16
17
|
});
|
|
17
18
|
const LoadingIndicator = ({
|
|
18
19
|
statusLabel = 'Loading'
|
|
19
|
-
}) => jsx(
|
|
20
|
-
|
|
20
|
+
}) => jsx(Box, {
|
|
21
|
+
xcss: spinnerContainerStyles
|
|
21
22
|
}, jsx(Spinner, {
|
|
22
23
|
size: "small"
|
|
23
24
|
}), jsx(VisuallyHidden, {
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["component", "elemBefore", "elemAfter", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
3
|
+
var _excluded = ["component", "elemBefore", "elemAfter", "shouldTitleWrap", "shouldDescriptionWrap", "children"];
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
6
6
|
import ButtonItem from '@atlaskit/menu/button-item';
|
|
@@ -24,6 +24,7 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
24
24
|
shouldTitleWrap = _props$shouldTitleWra === void 0 ? true : _props$shouldTitleWra,
|
|
25
25
|
_props$shouldDescript = props.shouldDescriptionWrap,
|
|
26
26
|
shouldDescriptionWrap = _props$shouldDescript === void 0 ? true : _props$shouldDescript,
|
|
27
|
+
children = props.children,
|
|
27
28
|
rest = _objectWithoutProperties(props, _excluded);
|
|
28
29
|
var itemRef = useRegisterItemWithFocusManager();
|
|
29
30
|
if (component) {
|
|
@@ -33,7 +34,7 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
33
34
|
iconAfter: elemAfter,
|
|
34
35
|
shouldTitleWrap: shouldTitleWrap,
|
|
35
36
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
36
|
-
}, rest));
|
|
37
|
+
}, rest), children);
|
|
37
38
|
} else if (props.href) {
|
|
38
39
|
return /*#__PURE__*/React.createElement(LinkItem, _extends({
|
|
39
40
|
href: props.href,
|
|
@@ -43,7 +44,7 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
43
44
|
ref: mergeRefs([ref, itemRef]),
|
|
44
45
|
shouldTitleWrap: shouldTitleWrap,
|
|
45
46
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
46
|
-
}, rest));
|
|
47
|
+
}, rest), children);
|
|
47
48
|
} else {
|
|
48
49
|
return /*#__PURE__*/React.createElement(ButtonItem, _extends({
|
|
49
50
|
role: "menuitem",
|
|
@@ -52,7 +53,7 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
52
53
|
ref: mergeRefs([ref, itemRef]),
|
|
53
54
|
shouldTitleWrap: shouldTitleWrap,
|
|
54
55
|
shouldDescriptionWrap: shouldDescriptionWrap
|
|
55
|
-
}, rest));
|
|
56
|
+
}, rest), children);
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
59
|
export default DropdownMenuItem;
|
|
@@ -3,24 +3,25 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["onClose", "onUpdate", "isLoading", "statusLabel", "setInitialFocusRef", "children"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { useContext, useEffect, useLayoutEffect } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
7
|
import MenuGroup from '@atlaskit/menu/menu-group';
|
|
8
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
9
|
import Spinner from '@atlaskit/spinner';
|
|
9
10
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
10
11
|
import { FocusManagerContext } from '../components/focus-manager';
|
|
11
12
|
import isCheckboxItem from '../utils/is-checkbox-item';
|
|
12
13
|
import isRadioItem from '../utils/is-radio-item';
|
|
13
|
-
var spinnerContainerStyles =
|
|
14
|
+
var spinnerContainerStyles = xcss({
|
|
14
15
|
display: 'flex',
|
|
15
16
|
minWidth: '160px',
|
|
16
|
-
padding:
|
|
17
|
+
padding: 'space.250',
|
|
17
18
|
justifyContent: 'center'
|
|
18
19
|
});
|
|
19
20
|
var LoadingIndicator = function LoadingIndicator(_ref) {
|
|
20
21
|
var _ref$statusLabel = _ref.statusLabel,
|
|
21
22
|
statusLabel = _ref$statusLabel === void 0 ? 'Loading' : _ref$statusLabel;
|
|
22
|
-
return jsx(
|
|
23
|
-
|
|
23
|
+
return jsx(Box, {
|
|
24
|
+
xcss: spinnerContainerStyles
|
|
24
25
|
}, jsx(Spinner, {
|
|
25
26
|
size: "small"
|
|
26
27
|
}), jsx(VisuallyHidden, {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "11.10.
|
|
3
|
+
"version": "11.10.2",
|
|
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/"
|
|
@@ -35,12 +35,13 @@
|
|
|
35
35
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
36
36
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
37
37
|
"@atlaskit/icon": "^21.12.0",
|
|
38
|
-
"@atlaskit/menu": "^1.
|
|
38
|
+
"@atlaskit/menu": "^1.9.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
40
|
-
"@atlaskit/popup": "^1.
|
|
40
|
+
"@atlaskit/popup": "^1.8.0",
|
|
41
|
+
"@atlaskit/primitives": "^0.15.0",
|
|
41
42
|
"@atlaskit/spinner": "^15.5.0",
|
|
42
43
|
"@atlaskit/theme": "^12.5.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.10.0",
|
|
44
45
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
45
46
|
"@babel/runtime": "^7.0.0",
|
|
46
47
|
"@emotion/react": "^11.7.1",
|
|
@@ -57,7 +58,6 @@
|
|
|
57
58
|
"@atlaskit/heading": "^1.3.0",
|
|
58
59
|
"@atlaskit/lozenge": "11.4.2",
|
|
59
60
|
"@atlaskit/modal-dialog": "^12.6.0",
|
|
60
|
-
"@atlaskit/primitives": "^0.13.0",
|
|
61
61
|
"@atlaskit/section-message": "^6.4.0",
|
|
62
62
|
"@atlaskit/visual-regression": "*",
|
|
63
63
|
"@atlaskit/webdriver-runner": "*",
|