@atlaskit/smart-card 17.6.0 → 17.7.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 +11 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/components/ActionList.js +33 -30
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/components/ActionList.js +22 -17
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/components/ActionList.js +25 -26
- package/package.json +6 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 17.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`924aa854655`](https://bitbucket.org/atlassian/atlassian-frontend/commits/924aa854655) - Replaced deprecated dependency with @atlaskit/droplist and @atlaskit/item with @atlaskit/dropdown-menu in block card actions list
|
|
8
|
+
- [`fb15a8a421c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fb15a8a421c) - move smart-card views and helpers from media-ui into smart-card
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 17.6.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/cjs/version.json
CHANGED
|
@@ -2,40 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.ActionList = void 0;
|
|
9
11
|
|
|
10
|
-
var
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
15
|
|
|
14
16
|
var _core = require("@emotion/core");
|
|
15
17
|
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var _item = _interopRequireDefault(require("@atlaskit/item"));
|
|
18
|
+
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _more = _interopRequireDefault(require("@atlaskit/icon/glyph/more"));
|
|
25
25
|
|
|
26
26
|
var _Action = require("./Action");
|
|
27
27
|
|
|
28
28
|
var _utils = require("../utils");
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
var _excluded = ["triggerRef"];
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
36
|
-
isOpen = _useState2[0],
|
|
37
|
-
setOpen = _useState2[1];
|
|
34
|
+
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; }
|
|
38
35
|
|
|
36
|
+
var ActionList = function ActionList(_ref) {
|
|
37
|
+
var items = _ref.items;
|
|
39
38
|
var actionsToShow = items.slice(0, 2);
|
|
40
39
|
var actionsToList = items.slice(2, items.length);
|
|
41
40
|
return (0, _core.jsx)("div", {
|
|
@@ -51,25 +50,29 @@ var ActionList = function ActionList(_ref) {
|
|
|
51
50
|
css: {
|
|
52
51
|
marginLeft: (0, _utils.gs)(0.5)
|
|
53
52
|
}
|
|
54
|
-
}, (0, _core.jsx)(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
}, (0, _core.jsx)(_dropdownMenu.default, {
|
|
54
|
+
trigger: function trigger(_ref2) {
|
|
55
|
+
var triggerRef = _ref2.triggerRef,
|
|
56
|
+
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
57
|
+
return (0, _core.jsx)(_standardButton.default, (0, _extends2.default)({}, props, {
|
|
58
|
+
iconBefore: (0, _core.jsx)(_more.default, {
|
|
59
|
+
label: "more"
|
|
60
|
+
}),
|
|
61
|
+
ref: triggerRef,
|
|
62
|
+
css: {
|
|
63
|
+
height: 'auto'
|
|
64
|
+
},
|
|
65
|
+
testId: "dropdown-trigger"
|
|
66
|
+
}));
|
|
63
67
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, "...")
|
|
68
|
+
placement: "right-start"
|
|
69
|
+
}, (0, _core.jsx)(_dropdownMenu.DropdownItemGroup, {
|
|
70
|
+
testId: "dropdown-menu"
|
|
68
71
|
}, actionsToList.map(function (actionToList) {
|
|
69
|
-
return (0, _core.jsx)(
|
|
72
|
+
return (0, _core.jsx)(_dropdownMenu.DropdownItem, {
|
|
70
73
|
key: actionToList.id
|
|
71
74
|
}, actionToList.text);
|
|
72
|
-
}))) : null);
|
|
75
|
+
})))) : null);
|
|
73
76
|
};
|
|
74
77
|
|
|
75
78
|
exports.ActionList = ActionList;
|
package/dist/es2019/version.json
CHANGED
|
@@ -2,17 +2,15 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { jsx } from '@emotion/core';
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
import Item from '@atlaskit/item';
|
|
7
|
-
import DropList from '@atlaskit/droplist';
|
|
8
5
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
9
|
-
import Button from '@atlaskit/button/
|
|
6
|
+
import Button from '@atlaskit/button/standard-button';
|
|
7
|
+
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
8
|
+
import MoreIcon from '@atlaskit/icon/glyph/more';
|
|
10
9
|
import { Action } from './Action';
|
|
11
10
|
import { gs, mq } from '../utils';
|
|
12
11
|
export const ActionList = ({
|
|
13
12
|
items
|
|
14
13
|
}) => {
|
|
15
|
-
const [isOpen, setOpen] = useState(false);
|
|
16
14
|
const actionsToShow = items.slice(0, 2);
|
|
17
15
|
const actionsToList = items.slice(2, items.length);
|
|
18
16
|
return jsx("div", {
|
|
@@ -26,17 +24,24 @@ export const ActionList = ({
|
|
|
26
24
|
css: {
|
|
27
25
|
marginLeft: gs(0.5)
|
|
28
26
|
}
|
|
29
|
-
}, jsx(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
}, jsx(DropdownMenu, {
|
|
28
|
+
trigger: ({
|
|
29
|
+
triggerRef,
|
|
30
|
+
...props
|
|
31
|
+
}) => jsx(Button, _extends({}, props, {
|
|
32
|
+
iconBefore: jsx(MoreIcon, {
|
|
33
|
+
label: "more"
|
|
34
|
+
}),
|
|
35
|
+
ref: triggerRef,
|
|
36
|
+
css: {
|
|
37
|
+
height: 'auto'
|
|
38
|
+
},
|
|
39
|
+
testId: "dropdown-trigger"
|
|
40
|
+
})),
|
|
41
|
+
placement: "right-start"
|
|
42
|
+
}, jsx(DropdownItemGroup, {
|
|
43
|
+
testId: "dropdown-menu"
|
|
44
|
+
}, actionsToList.map(actionToList => jsx(DropdownItem, {
|
|
40
45
|
key: actionToList.id
|
|
41
|
-
}, actionToList.text)))) : null);
|
|
46
|
+
}, actionToList.text))))) : null);
|
|
42
47
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
+
var _excluded = ["triggerRef"];
|
|
3
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { jsx } from '@emotion/core';
|
|
6
|
-
import { useState } from 'react';
|
|
7
|
-
import Item from '@atlaskit/item';
|
|
8
|
-
import DropList from '@atlaskit/droplist';
|
|
9
7
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
10
|
-
import Button from '@atlaskit/button/
|
|
8
|
+
import Button from '@atlaskit/button/standard-button';
|
|
9
|
+
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
10
|
+
import MoreIcon from '@atlaskit/icon/glyph/more';
|
|
11
11
|
import { Action } from './Action';
|
|
12
12
|
import { gs, mq } from '../utils';
|
|
13
13
|
export var ActionList = function ActionList(_ref) {
|
|
14
14
|
var items = _ref.items;
|
|
15
|
-
|
|
16
|
-
var _useState = useState(false),
|
|
17
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
-
isOpen = _useState2[0],
|
|
19
|
-
setOpen = _useState2[1];
|
|
20
|
-
|
|
21
15
|
var actionsToShow = items.slice(0, 2);
|
|
22
16
|
var actionsToList = items.slice(2, items.length);
|
|
23
17
|
return jsx("div", {
|
|
@@ -33,23 +27,28 @@ export var ActionList = function ActionList(_ref) {
|
|
|
33
27
|
css: {
|
|
34
28
|
marginLeft: gs(0.5)
|
|
35
29
|
}
|
|
36
|
-
}, jsx(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
}, jsx(DropdownMenu, {
|
|
31
|
+
trigger: function trigger(_ref2) {
|
|
32
|
+
var triggerRef = _ref2.triggerRef,
|
|
33
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
34
|
+
|
|
35
|
+
return jsx(Button, _extends({}, props, {
|
|
36
|
+
iconBefore: jsx(MoreIcon, {
|
|
37
|
+
label: "more"
|
|
38
|
+
}),
|
|
39
|
+
ref: triggerRef,
|
|
40
|
+
css: {
|
|
41
|
+
height: 'auto'
|
|
42
|
+
},
|
|
43
|
+
testId: "dropdown-trigger"
|
|
44
|
+
}));
|
|
45
45
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, "...")
|
|
46
|
+
placement: "right-start"
|
|
47
|
+
}, jsx(DropdownItemGroup, {
|
|
48
|
+
testId: "dropdown-menu"
|
|
50
49
|
}, actionsToList.map(function (actionToList) {
|
|
51
|
-
return jsx(
|
|
50
|
+
return jsx(DropdownItem, {
|
|
52
51
|
key: actionToList.id
|
|
53
52
|
}, actionToList.text);
|
|
54
|
-
}))) : null);
|
|
53
|
+
})))) : null);
|
|
55
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.7.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,24 +26,22 @@
|
|
|
26
26
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
27
27
|
"@atlaskit/avatar": "^20.5.0",
|
|
28
28
|
"@atlaskit/avatar-group": "^8.5.5",
|
|
29
|
-
"@atlaskit/button": "^16.
|
|
29
|
+
"@atlaskit/button": "^16.2.0",
|
|
30
30
|
"@atlaskit/dropdown-menu": "^11.1.0",
|
|
31
|
-
"@atlaskit/droplist": "^11.0.0",
|
|
32
31
|
"@atlaskit/icon": "^21.10.0",
|
|
33
32
|
"@atlaskit/icon-file-type": "^6.3.0",
|
|
34
33
|
"@atlaskit/icon-object": "^6.2.0",
|
|
35
34
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
36
35
|
"@atlaskit/in-product-testing": "^0.1.0",
|
|
37
|
-
"@atlaskit/item": "^12.0.0",
|
|
38
36
|
"@atlaskit/logo": "^13.5.0",
|
|
39
37
|
"@atlaskit/lozenge": "^11.1.0",
|
|
40
|
-
"@atlaskit/media-common": "^2.
|
|
41
|
-
"@atlaskit/media-ui": "^
|
|
38
|
+
"@atlaskit/media-common": "^2.11.0",
|
|
39
|
+
"@atlaskit/media-ui": "^20.0.0",
|
|
42
40
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
43
41
|
"@atlaskit/outbound-auth-flow-client": "^3.3.0",
|
|
44
42
|
"@atlaskit/spinner": "^15.1.0",
|
|
45
43
|
"@atlaskit/theme": "^12.1.0",
|
|
46
|
-
"@atlaskit/tokens": "^0.
|
|
44
|
+
"@atlaskit/tokens": "^0.7.0",
|
|
47
45
|
"@atlaskit/tooltip": "^17.5.2",
|
|
48
46
|
"@atlaskit/ufo": "^0.1.0",
|
|
49
47
|
"@babel/runtime": "^7.0.0",
|
|
@@ -78,7 +76,7 @@
|
|
|
78
76
|
"@atlaskit/inline-message": "^11.2.0",
|
|
79
77
|
"@atlaskit/lozenge": "^11.1.0",
|
|
80
78
|
"@atlaskit/media-integration-test-helpers": "^2.5.0",
|
|
81
|
-
"@atlaskit/media-test-helpers": "^29.
|
|
79
|
+
"@atlaskit/media-test-helpers": "^29.2.0",
|
|
82
80
|
"@atlaskit/page": "^12.1.0",
|
|
83
81
|
"@atlaskit/radio": "^5.3.0",
|
|
84
82
|
"@atlaskit/range": "^6.0.0",
|