@atlaskit/smart-card 26.33.2 → 26.34.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 +6 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/token.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +5 -5
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +5 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +4 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/token.js +5 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +5 -5
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +5 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +3 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/token.js +5 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +5 -5
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +5 -2
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +4 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/utils/token.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-button/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -0
- package/dist/types-ts4.5/utils/token.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-button/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +8 -0
- package/package.json +1 -3
- package/report.api.md +3 -0
- package/tmp/api-report-tmp.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#41278](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41278) [`abf3bed4cf2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/abf3bed4cf2) - Flexible-UI: add isDisabled option to action items to show disabled view and disable clicks on button
|
|
8
|
+
|
|
3
9
|
## 26.33.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.34.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/utils/token.js
CHANGED
|
@@ -4,6 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tokens = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-8175 Internal documentation for deprecation (no external access)}\
|
|
10
|
+
* @deprecated Use the token directly in the file
|
|
11
|
+
*/
|
|
7
12
|
var tokens = exports.tokens = {
|
|
8
13
|
actionIcon: "var(--ds-icon, #44546F)",
|
|
9
14
|
background: "var(--ds-surface-raised, #FFFFFF)",
|
|
@@ -41,7 +41,8 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
41
41
|
overrideCss = _ref.overrideCss,
|
|
42
42
|
size = _ref.size,
|
|
43
43
|
testId = _ref.testId,
|
|
44
|
-
tooltipMessage = _ref.tooltipMessage
|
|
44
|
+
tooltipMessage = _ref.tooltipMessage,
|
|
45
|
+
isDisabled = _ref.isDisabled;
|
|
45
46
|
var iconOnly = !content;
|
|
46
47
|
var onButtonClick = (0, _react.useCallback)(function (handler) {
|
|
47
48
|
return function (e) {
|
|
@@ -70,7 +71,8 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
70
71
|
iconBefore: iconBefore,
|
|
71
72
|
onClick: onButtonClick(onClick),
|
|
72
73
|
spacing: _utils.sizeToButtonSpacing[size],
|
|
73
|
-
testId: testId
|
|
74
|
+
testId: testId,
|
|
75
|
+
isDisabled: isDisabled
|
|
74
76
|
}, content)));
|
|
75
77
|
};
|
|
76
78
|
var _default = exports.default = ActionButton;
|
|
@@ -9,7 +9,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _constants = require("../../../../../../constants");
|
|
12
|
-
var _token = require("../../../../../../utils/token");
|
|
13
12
|
var _utils = require("../../../utils");
|
|
14
13
|
var _templateObject;
|
|
15
14
|
/** @jsx jsx */
|
|
@@ -24,15 +23,16 @@ var getIconWidth = function getIconWidth(size) {
|
|
|
24
23
|
return '1rem';
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
|
-
var getIconStyles = function getIconStyles(size) {
|
|
28
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n ", ";\n"])),
|
|
26
|
+
var getIconStyles = function getIconStyles(size, isDisabled) {
|
|
27
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n ", ";\n"])), isDisabled ? "var(--ds-text-disabled, #6B778C)" : "var(--ds-icon, #44546F)", (0, _utils.getIconSizeStyles)(getIconWidth(size)));
|
|
29
28
|
};
|
|
30
29
|
var ActionIcon = function ActionIcon(_ref) {
|
|
31
30
|
var size = _ref.size,
|
|
32
31
|
testId = _ref.testId,
|
|
33
|
-
icon = _ref.icon
|
|
32
|
+
icon = _ref.icon,
|
|
33
|
+
isDisabled = _ref.isDisabled;
|
|
34
34
|
return (0, _react2.jsx)("span", {
|
|
35
|
-
css: getIconStyles(size),
|
|
35
|
+
css: getIconStyles(size, isDisabled),
|
|
36
36
|
"data-testid": "".concat(testId, "-icon")
|
|
37
37
|
}, icon);
|
|
38
38
|
};
|
|
@@ -37,11 +37,13 @@ var Action = function Action(_ref) {
|
|
|
37
37
|
iconPosition = _ref$iconPosition === void 0 ? 'before' : _ref$iconPosition,
|
|
38
38
|
tooltipMessage = _ref.tooltipMessage,
|
|
39
39
|
asDropDownItem = _ref.asDropDownItem,
|
|
40
|
-
overrideCss = _ref.overrideCss
|
|
40
|
+
overrideCss = _ref.overrideCss,
|
|
41
|
+
isDisabled = _ref.isDisabled;
|
|
41
42
|
if (!onClick) {
|
|
42
43
|
return null;
|
|
43
44
|
}
|
|
44
45
|
var actionIcon = icon && (0, _react2.jsx)(_actionIcon.default, {
|
|
46
|
+
isDisabled: isDisabled,
|
|
45
47
|
icon: icon,
|
|
46
48
|
size: size,
|
|
47
49
|
testId: testId
|
|
@@ -68,7 +70,8 @@ var Action = function Action(_ref) {
|
|
|
68
70
|
overrideCss: overrideCss,
|
|
69
71
|
size: size,
|
|
70
72
|
testId: testId,
|
|
71
|
-
tooltipMessage: tooltipMessage || content
|
|
73
|
+
tooltipMessage: tooltipMessage || content,
|
|
74
|
+
isDisabled: isDisabled
|
|
72
75
|
});
|
|
73
76
|
}
|
|
74
77
|
};
|
package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var _react = require("@emotion/react");
|
|
|
13
13
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
14
14
|
var Actions = _interopRequireWildcard(require("../../../actions"));
|
|
15
15
|
var _utils = require("../../utils");
|
|
16
|
-
var _excluded = ["name", "hideContent", "hideIcon", "onClick"];
|
|
16
|
+
var _excluded = ["name", "hideContent", "hideIcon", "onClick", "isDisabled"];
|
|
17
17
|
/** @jsx jsx */
|
|
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; }
|
|
@@ -29,6 +29,7 @@ var ActionGroupItem = function ActionGroupItem(_ref) {
|
|
|
29
29
|
hideContent = item.hideContent,
|
|
30
30
|
hideIcon = item.hideIcon,
|
|
31
31
|
onClick = item.onClick,
|
|
32
|
+
isDisabled = item.isDisabled,
|
|
32
33
|
props = (0, _objectWithoutProperties2.default)(item, _excluded);
|
|
33
34
|
var handleOnClick = (0, _react2.useCallback)(function () {
|
|
34
35
|
if (onActionItemClick) {
|
|
@@ -54,7 +55,8 @@ var ActionGroupItem = function ActionGroupItem(_ref) {
|
|
|
54
55
|
asDropDownItem: asDropDownItems,
|
|
55
56
|
size: size,
|
|
56
57
|
appearance: appearance,
|
|
57
|
-
onClick: handleOnClick
|
|
58
|
+
onClick: handleOnClick,
|
|
59
|
+
isDisabled: isDisabled
|
|
58
60
|
}, actionProps));
|
|
59
61
|
if (!(0, _utils.isJSXElementNull)(action)) {
|
|
60
62
|
return action;
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.
|
|
21
|
+
packageVersion: "26.34.0",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.34.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-8175 Internal documentation for deprecation (no external access)}\
|
|
4
|
+
* @deprecated Use the token directly in the file
|
|
5
|
+
*/
|
|
1
6
|
export const tokens = {
|
|
2
7
|
actionIcon: "var(--ds-icon, #44546F)",
|
|
3
8
|
background: "var(--ds-surface-raised, #FFFFFF)",
|
|
@@ -55,7 +55,8 @@ const ActionButton = ({
|
|
|
55
55
|
overrideCss,
|
|
56
56
|
size,
|
|
57
57
|
testId,
|
|
58
|
-
tooltipMessage
|
|
58
|
+
tooltipMessage,
|
|
59
|
+
isDisabled
|
|
59
60
|
}) => {
|
|
60
61
|
const iconOnly = !content;
|
|
61
62
|
const onButtonClick = useCallback(handler => e => {
|
|
@@ -83,7 +84,8 @@ const ActionButton = ({
|
|
|
83
84
|
iconBefore: iconBefore,
|
|
84
85
|
onClick: onButtonClick(onClick),
|
|
85
86
|
spacing: sizeToButtonSpacing[size],
|
|
86
|
-
testId: testId
|
|
87
|
+
testId: testId,
|
|
88
|
+
isDisabled: isDisabled
|
|
87
89
|
}, content)));
|
|
88
90
|
};
|
|
89
91
|
export default ActionButton;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { SmartLinkSize } from '../../../../../../constants';
|
|
5
|
-
import { tokens } from '../../../../../../utils/token';
|
|
6
5
|
import { getIconSizeStyles } from '../../../utils';
|
|
7
6
|
const getIconWidth = size => {
|
|
8
7
|
switch (size) {
|
|
@@ -15,16 +14,17 @@ const getIconWidth = size => {
|
|
|
15
14
|
return '1rem';
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
|
-
const getIconStyles = size => css`
|
|
19
|
-
color: ${
|
|
17
|
+
const getIconStyles = (size, isDisabled) => css`
|
|
18
|
+
color: ${isDisabled ? "var(--ds-text-disabled, #6B778C)" : "var(--ds-icon, #44546F)"};
|
|
20
19
|
${getIconSizeStyles(getIconWidth(size))};
|
|
21
20
|
`;
|
|
22
21
|
const ActionIcon = ({
|
|
23
22
|
size,
|
|
24
23
|
testId,
|
|
25
|
-
icon
|
|
24
|
+
icon,
|
|
25
|
+
isDisabled
|
|
26
26
|
}) => jsx("span", {
|
|
27
|
-
css: getIconStyles(size),
|
|
27
|
+
css: getIconStyles(size, isDisabled),
|
|
28
28
|
"data-testid": `${testId}-icon`
|
|
29
29
|
}, icon);
|
|
30
30
|
export default ActionIcon;
|
|
@@ -25,12 +25,14 @@ const Action = ({
|
|
|
25
25
|
iconPosition = 'before',
|
|
26
26
|
tooltipMessage,
|
|
27
27
|
asDropDownItem,
|
|
28
|
-
overrideCss
|
|
28
|
+
overrideCss,
|
|
29
|
+
isDisabled
|
|
29
30
|
}) => {
|
|
30
31
|
if (!onClick) {
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
34
|
const actionIcon = icon && jsx(ActionIcon, {
|
|
35
|
+
isDisabled: isDisabled,
|
|
34
36
|
icon: icon,
|
|
35
37
|
size: size,
|
|
36
38
|
testId: testId
|
|
@@ -57,7 +59,8 @@ const Action = ({
|
|
|
57
59
|
overrideCss: overrideCss,
|
|
58
60
|
size: size,
|
|
59
61
|
testId: testId,
|
|
60
|
-
tooltipMessage: tooltipMessage || content
|
|
62
|
+
tooltipMessage: tooltipMessage || content,
|
|
63
|
+
isDisabled: isDisabled
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
66
|
};
|
package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js
CHANGED
|
@@ -16,6 +16,7 @@ const ActionGroupItem = ({
|
|
|
16
16
|
hideContent,
|
|
17
17
|
hideIcon,
|
|
18
18
|
onClick,
|
|
19
|
+
isDisabled,
|
|
19
20
|
...props
|
|
20
21
|
} = item;
|
|
21
22
|
const handleOnClick = useCallback(() => {
|
|
@@ -44,7 +45,8 @@ const ActionGroupItem = ({
|
|
|
44
45
|
asDropDownItem: asDropDownItems,
|
|
45
46
|
size: size,
|
|
46
47
|
appearance: appearance,
|
|
47
|
-
onClick: handleOnClick
|
|
48
|
+
onClick: handleOnClick,
|
|
49
|
+
isDisabled: isDisabled
|
|
48
50
|
}, actionProps));
|
|
49
51
|
if (!isJSXElementNull(action)) {
|
|
50
52
|
return action;
|
|
@@ -8,7 +8,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
const PACKAGE_DATA = {
|
|
10
10
|
packageName: "@atlaskit/smart-card",
|
|
11
|
-
packageVersion: "26.
|
|
11
|
+
packageVersion: "26.34.0",
|
|
12
12
|
componentName: 'linkUrl'
|
|
13
13
|
};
|
|
14
14
|
const Link = withLinkClickedEvent('a');
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.34.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/token.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-8175 Internal documentation for deprecation (no external access)}\
|
|
4
|
+
* @deprecated Use the token directly in the file
|
|
5
|
+
*/
|
|
1
6
|
export var tokens = {
|
|
2
7
|
actionIcon: "var(--ds-icon, #44546F)",
|
|
3
8
|
background: "var(--ds-surface-raised, #FFFFFF)",
|
|
@@ -31,7 +31,8 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
31
31
|
overrideCss = _ref.overrideCss,
|
|
32
32
|
size = _ref.size,
|
|
33
33
|
testId = _ref.testId,
|
|
34
|
-
tooltipMessage = _ref.tooltipMessage
|
|
34
|
+
tooltipMessage = _ref.tooltipMessage,
|
|
35
|
+
isDisabled = _ref.isDisabled;
|
|
35
36
|
var iconOnly = !content;
|
|
36
37
|
var onButtonClick = useCallback(function (handler) {
|
|
37
38
|
return function (e) {
|
|
@@ -60,7 +61,8 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
60
61
|
iconBefore: iconBefore,
|
|
61
62
|
onClick: onButtonClick(onClick),
|
|
62
63
|
spacing: sizeToButtonSpacing[size],
|
|
63
|
-
testId: testId
|
|
64
|
+
testId: testId,
|
|
65
|
+
isDisabled: isDisabled
|
|
64
66
|
}, content)));
|
|
65
67
|
};
|
|
66
68
|
export default ActionButton;
|
|
@@ -4,7 +4,6 @@ var _templateObject;
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { SmartLinkSize } from '../../../../../../constants';
|
|
7
|
-
import { tokens } from '../../../../../../utils/token';
|
|
8
7
|
import { getIconSizeStyles } from '../../../utils';
|
|
9
8
|
var getIconWidth = function getIconWidth(size) {
|
|
10
9
|
switch (size) {
|
|
@@ -17,15 +16,16 @@ var getIconWidth = function getIconWidth(size) {
|
|
|
17
16
|
return '1rem';
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
|
-
var getIconStyles = function getIconStyles(size) {
|
|
21
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n ", ";\n"])),
|
|
19
|
+
var getIconStyles = function getIconStyles(size, isDisabled) {
|
|
20
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n ", ";\n"])), isDisabled ? "var(--ds-text-disabled, #6B778C)" : "var(--ds-icon, #44546F)", getIconSizeStyles(getIconWidth(size)));
|
|
22
21
|
};
|
|
23
22
|
var ActionIcon = function ActionIcon(_ref) {
|
|
24
23
|
var size = _ref.size,
|
|
25
24
|
testId = _ref.testId,
|
|
26
|
-
icon = _ref.icon
|
|
25
|
+
icon = _ref.icon,
|
|
26
|
+
isDisabled = _ref.isDisabled;
|
|
27
27
|
return jsx("span", {
|
|
28
|
-
css: getIconStyles(size),
|
|
28
|
+
css: getIconStyles(size, isDisabled),
|
|
29
29
|
"data-testid": "".concat(testId, "-icon")
|
|
30
30
|
}, icon);
|
|
31
31
|
};
|
|
@@ -30,11 +30,13 @@ var Action = function Action(_ref) {
|
|
|
30
30
|
iconPosition = _ref$iconPosition === void 0 ? 'before' : _ref$iconPosition,
|
|
31
31
|
tooltipMessage = _ref.tooltipMessage,
|
|
32
32
|
asDropDownItem = _ref.asDropDownItem,
|
|
33
|
-
overrideCss = _ref.overrideCss
|
|
33
|
+
overrideCss = _ref.overrideCss,
|
|
34
|
+
isDisabled = _ref.isDisabled;
|
|
34
35
|
if (!onClick) {
|
|
35
36
|
return null;
|
|
36
37
|
}
|
|
37
38
|
var actionIcon = icon && jsx(ActionIcon, {
|
|
39
|
+
isDisabled: isDisabled,
|
|
38
40
|
icon: icon,
|
|
39
41
|
size: size,
|
|
40
42
|
testId: testId
|
|
@@ -61,7 +63,8 @@ var Action = function Action(_ref) {
|
|
|
61
63
|
overrideCss: overrideCss,
|
|
62
64
|
size: size,
|
|
63
65
|
testId: testId,
|
|
64
|
-
tooltipMessage: tooltipMessage || content
|
|
66
|
+
tooltipMessage: tooltipMessage || content,
|
|
67
|
+
isDisabled: isDisabled
|
|
65
68
|
});
|
|
66
69
|
}
|
|
67
70
|
};
|
package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["name", "hideContent", "hideIcon", "onClick"];
|
|
4
|
+
var _excluded = ["name", "hideContent", "hideIcon", "onClick", "isDisabled"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/** @jsx jsx */
|
|
@@ -19,6 +19,7 @@ var ActionGroupItem = function ActionGroupItem(_ref) {
|
|
|
19
19
|
hideContent = item.hideContent,
|
|
20
20
|
hideIcon = item.hideIcon,
|
|
21
21
|
onClick = item.onClick,
|
|
22
|
+
isDisabled = item.isDisabled,
|
|
22
23
|
props = _objectWithoutProperties(item, _excluded);
|
|
23
24
|
var handleOnClick = useCallback(function () {
|
|
24
25
|
if (onActionItemClick) {
|
|
@@ -44,7 +45,8 @@ var ActionGroupItem = function ActionGroupItem(_ref) {
|
|
|
44
45
|
asDropDownItem: asDropDownItems,
|
|
45
46
|
size: size,
|
|
46
47
|
appearance: appearance,
|
|
47
|
-
onClick: handleOnClick
|
|
48
|
+
onClick: handleOnClick,
|
|
49
|
+
isDisabled: isDisabled
|
|
48
50
|
}, actionProps));
|
|
49
51
|
if (!isJSXElementNull(action)) {
|
|
50
52
|
return action;
|
|
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
11
11
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
var PACKAGE_DATA = {
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "26.
|
|
14
|
+
packageVersion: "26.34.0",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-8175 Internal documentation for deprecation (no external access)}\
|
|
4
|
+
* @deprecated Use the token directly in the file
|
|
5
|
+
*/
|
|
1
6
|
export declare const tokens: {
|
|
2
7
|
actionIcon: "var(--ds-icon)";
|
|
3
8
|
background: "var(--ds-surface-raised)";
|
|
@@ -45,6 +45,10 @@ export type ActionProps = {
|
|
|
45
45
|
* serving as a hook for automated tests
|
|
46
46
|
*/
|
|
47
47
|
testId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Determines whether the button displays as disabled.
|
|
50
|
+
*/
|
|
51
|
+
isDisabled?: boolean;
|
|
48
52
|
};
|
|
49
53
|
/**
|
|
50
54
|
* The internal props that should only be controlled by internal components
|
|
@@ -99,6 +99,10 @@ export type BaseActionItem = {
|
|
|
99
99
|
* serving as a hook for automated tests
|
|
100
100
|
*/
|
|
101
101
|
testId?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Determines whether the button displays as disabled.
|
|
104
|
+
*/
|
|
105
|
+
isDisabled?: boolean;
|
|
102
106
|
};
|
|
103
107
|
/**
|
|
104
108
|
* Used to represent an Action which self-hydrates with data when passing props into Flexible UI.
|
|
@@ -136,6 +140,10 @@ export type BaseDataActionItem = {
|
|
|
136
140
|
* serving as a hook for automated tests
|
|
137
141
|
*/
|
|
138
142
|
testId?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Determines whether the button displays as disabled.
|
|
145
|
+
*/
|
|
146
|
+
isDisabled?: boolean;
|
|
139
147
|
};
|
|
140
148
|
/**
|
|
141
149
|
* This represents an action that will render based on the data provided from the Smart Link.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-8175 Internal documentation for deprecation (no external access)}\
|
|
4
|
+
* @deprecated Use the token directly in the file
|
|
5
|
+
*/
|
|
1
6
|
export declare const tokens: {
|
|
2
7
|
actionIcon: "var(--ds-icon)";
|
|
3
8
|
background: "var(--ds-surface-raised)";
|
|
@@ -45,6 +45,10 @@ export type ActionProps = {
|
|
|
45
45
|
* serving as a hook for automated tests
|
|
46
46
|
*/
|
|
47
47
|
testId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Determines whether the button displays as disabled.
|
|
50
|
+
*/
|
|
51
|
+
isDisabled?: boolean;
|
|
48
52
|
};
|
|
49
53
|
/**
|
|
50
54
|
* The internal props that should only be controlled by internal components
|
|
@@ -99,6 +99,10 @@ export type BaseActionItem = {
|
|
|
99
99
|
* serving as a hook for automated tests
|
|
100
100
|
*/
|
|
101
101
|
testId?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Determines whether the button displays as disabled.
|
|
104
|
+
*/
|
|
105
|
+
isDisabled?: boolean;
|
|
102
106
|
};
|
|
103
107
|
/**
|
|
104
108
|
* Used to represent an Action which self-hydrates with data when passing props into Flexible UI.
|
|
@@ -136,6 +140,10 @@ export type BaseDataActionItem = {
|
|
|
136
140
|
* serving as a hook for automated tests
|
|
137
141
|
*/
|
|
138
142
|
testId?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Determines whether the button displays as disabled.
|
|
145
|
+
*/
|
|
146
|
+
isDisabled?: boolean;
|
|
139
147
|
};
|
|
140
148
|
/**
|
|
141
149
|
* This represents an action that will render based on the data provided from the Smart Link.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.34.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -74,10 +74,8 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@af/visual-regression": "*",
|
|
76
76
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
77
|
-
"@atlaskit/avatar": "^21.4.0",
|
|
78
77
|
"@atlaskit/css-reset": "^6.5.0",
|
|
79
78
|
"@atlaskit/link-test-helpers": "^6.1.0",
|
|
80
|
-
"@atlaskit/lozenge": "^11.4.0",
|
|
81
79
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
82
80
|
"@atlaskit/visual-regression": "*",
|
|
83
81
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
package/report.api.md
CHANGED
|
@@ -86,6 +86,7 @@ type ActionProps = {
|
|
|
86
86
|
asDropDownItem?: boolean;
|
|
87
87
|
overrideCss?: SerializedStyles;
|
|
88
88
|
testId?: string;
|
|
89
|
+
isDisabled?: boolean;
|
|
89
90
|
};
|
|
90
91
|
|
|
91
92
|
// @public (undocumented)
|
|
@@ -182,6 +183,7 @@ type BaseActionItem = {
|
|
|
182
183
|
overrideCss?: SerializedStyles;
|
|
183
184
|
size?: SmartLinkSize;
|
|
184
185
|
testId?: string;
|
|
186
|
+
isDisabled?: boolean;
|
|
185
187
|
};
|
|
186
188
|
|
|
187
189
|
// @public
|
|
@@ -193,6 +195,7 @@ type BaseDataActionItem = {
|
|
|
193
195
|
overrideCss?: SerializedStyles;
|
|
194
196
|
size?: SmartLinkSize;
|
|
195
197
|
testId?: string;
|
|
198
|
+
isDisabled?: boolean;
|
|
196
199
|
};
|
|
197
200
|
|
|
198
201
|
export { BlockCardAdf };
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ type ActionProps = {
|
|
|
72
72
|
asDropDownItem?: boolean;
|
|
73
73
|
overrideCss?: SerializedStyles;
|
|
74
74
|
testId?: string;
|
|
75
|
+
isDisabled?: boolean;
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
// @public (undocumented)
|
|
@@ -135,6 +136,7 @@ type BaseActionItem = {
|
|
|
135
136
|
overrideCss?: SerializedStyles;
|
|
136
137
|
size?: SmartLinkSize;
|
|
137
138
|
testId?: string;
|
|
139
|
+
isDisabled?: boolean;
|
|
138
140
|
};
|
|
139
141
|
|
|
140
142
|
// @public
|
|
@@ -146,6 +148,7 @@ type BaseDataActionItem = {
|
|
|
146
148
|
overrideCss?: SerializedStyles;
|
|
147
149
|
size?: SmartLinkSize;
|
|
148
150
|
testId?: string;
|
|
151
|
+
isDisabled?: boolean;
|
|
149
152
|
};
|
|
150
153
|
|
|
151
154
|
export { BlockCardAdf }
|