@atlaskit/smart-card 26.33.2 → 26.34.1

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/utils/mocks.js +6 -1
  4. package/dist/cjs/utils/token.js +5 -0
  5. package/dist/cjs/view/EmbedCard/index.js +15 -1
  6. package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +4 -0
  7. package/dist/cjs/view/EmbedCard/views/forbidden-view/index.js +4 -4
  8. package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +100 -0
  9. package/dist/cjs/view/EmbedCard/views/unauthorized-view/types.js +5 -0
  10. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +4 -2
  11. package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +5 -5
  12. package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +5 -2
  13. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +4 -2
  14. package/dist/cjs/view/LinkUrl/index.js +1 -1
  15. package/dist/es2019/utils/analytics/analytics.js +1 -1
  16. package/dist/es2019/utils/mocks.js +5 -0
  17. package/dist/es2019/utils/token.js +5 -0
  18. package/dist/es2019/view/EmbedCard/index.js +15 -1
  19. package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +4 -0
  20. package/dist/es2019/view/EmbedCard/views/forbidden-view/index.js +3 -3
  21. package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +88 -0
  22. package/dist/es2019/view/EmbedCard/views/unauthorized-view/types.js +1 -0
  23. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +4 -2
  24. package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +5 -5
  25. package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +5 -2
  26. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +3 -1
  27. package/dist/es2019/view/LinkUrl/index.js +1 -1
  28. package/dist/esm/utils/analytics/analytics.js +1 -1
  29. package/dist/esm/utils/mocks.js +5 -0
  30. package/dist/esm/utils/token.js +5 -0
  31. package/dist/esm/view/EmbedCard/index.js +15 -1
  32. package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +4 -0
  33. package/dist/esm/view/EmbedCard/views/forbidden-view/index.js +4 -4
  34. package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +90 -0
  35. package/dist/esm/view/EmbedCard/views/unauthorized-view/types.js +1 -0
  36. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +4 -2
  37. package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +5 -5
  38. package/dist/esm/view/FlexibleCard/components/actions/action/index.js +5 -2
  39. package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +4 -2
  40. package/dist/esm/view/LinkUrl/index.js +1 -1
  41. package/dist/types/utils/mocks.d.ts +5 -0
  42. package/dist/types/utils/token.d.ts +5 -0
  43. package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +4 -0
  44. package/dist/types/view/EmbedCard/views/forbidden-view/types.d.ts +1 -1
  45. package/dist/types/view/EmbedCard/views/unauthorized-view/index.d.ts +4 -0
  46. package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +9 -0
  47. package/dist/types/view/FlexibleCard/components/actions/action/action-button/types.d.ts +1 -0
  48. package/dist/types/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +1 -0
  49. package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +4 -0
  50. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -0
  51. package/dist/types-ts4.5/utils/mocks.d.ts +5 -0
  52. package/dist/types-ts4.5/utils/token.d.ts +5 -0
  53. package/dist/types-ts4.5/view/EmbedCard/views/UnauthorisedView.d.ts +4 -0
  54. package/dist/types-ts4.5/view/EmbedCard/views/forbidden-view/types.d.ts +1 -1
  55. package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/index.d.ts +4 -0
  56. package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +9 -0
  57. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-button/types.d.ts +1 -0
  58. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +1 -0
  59. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +4 -0
  60. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +8 -0
  61. package/package.json +1 -3
  62. package/report.api.md +3 -0
  63. package/tmp/api-report-tmp.d.ts +3 -0
@@ -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
  };
@@ -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.33.2",
11
+ packageVersion: "26.34.1",
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.33.2"
18
+ packageVersion: "26.34.1"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -16,6 +16,11 @@ export var mockContext = {
16
16
  atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
17
17
  schema: 'http://schema.org/'
18
18
  };
19
+ export var mockGenerator = {
20
+ '@type': 'Application',
21
+ '@id': 'https://www.atlassian.com/#Jira',
22
+ name: 'Jira'
23
+ };
19
24
  export var mockByUrl = function mockByUrl(url) {
20
25
  return {
21
26
  meta: {
@@ -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)",
@@ -17,6 +17,7 @@ import { EmbedCardUnauthorisedView } from './views/UnauthorisedView';
17
17
  import { EmbedCardErroredView } from './views/ErroredView';
18
18
  import ForbiddenView from './views/forbidden-view';
19
19
  import NotFoundView from './views/not-found-view';
20
+ import UnauthorizedView from './views/unauthorized-view';
20
21
  export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
21
22
  var _details$meta, _forbiddenViewProps$c3;
22
23
  var url = _ref.url,
@@ -103,6 +104,19 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
103
104
  });
104
105
  }
105
106
  var unauthorisedViewProps = extractEmbedProps(data, meta, platform);
107
+ if (getBooleanFF('platform.linking-platform.smart-card.cross-join')) {
108
+ return /*#__PURE__*/React.createElement(UnauthorizedView, {
109
+ analytics: analytics,
110
+ context: unauthorisedViewProps.context,
111
+ extensionKey: extensionKey,
112
+ inheritDimensions: inheritDimensions,
113
+ isSelected: isSelected,
114
+ onAuthorize: handleAuthorize,
115
+ onClick: handleFrameClick,
116
+ testId: testId,
117
+ url: unauthorisedViewProps.link
118
+ });
119
+ }
106
120
  return /*#__PURE__*/React.createElement(EmbedCardUnauthorisedView, _extends({}, unauthorisedViewProps, {
107
121
  isSelected: isSelected,
108
122
  onAuthorise: handleAuthorize,
@@ -142,7 +156,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
142
156
  context: forbiddenViewProps.context,
143
157
  inheritDimensions: inheritDimensions,
144
158
  isSelected: isSelected,
145
- onAuthorise: handleAuthorize,
159
+ onAuthorize: handleAuthorize,
146
160
  onClick: handleFrameClick,
147
161
  accessContext: accessContext,
148
162
  url: forbiddenViewProps.link
@@ -5,6 +5,10 @@ import { ExpandedFrame } from '../components/ExpandedFrame';
5
5
  import { ImageIcon } from '../components/ImageIcon';
6
6
  import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
7
7
  import { getUnresolvedEmbedCardImage } from '../utils';
8
+ /**
9
+ * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
10
+ * @deprecated Replaced by unauthorized-view
11
+ */
8
12
  export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
9
13
  var analytics = _ref.analytics,
10
14
  link = _ref.link,
@@ -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 = ["context", "onAuthorise", "accessContext", "testId"];
3
+ var _excluded = ["context", "onAuthorize", "accessContext", "testId"];
4
4
  import Button from '@atlaskit/button';
5
5
  import React, { useMemo } from 'react';
6
6
  import { FormattedMessage } from 'react-intl-next';
@@ -11,7 +11,7 @@ import UnresolvedView from '../unresolved-view';
11
11
  import { getUnresolvedEmbedCardImage } from '../../utils';
12
12
  var ForbiddenView = function ForbiddenView(_ref) {
13
13
  var context = _ref.context,
14
- onAuthorise = _ref.onAuthorise,
14
+ onAuthorize = _ref.onAuthorize,
15
15
  accessContext = _ref.accessContext,
16
16
  _ref$testId = _ref.testId,
17
17
  testId = _ref$testId === void 0 ? 'embed-card-forbidden-view' : _ref$testId,
@@ -45,7 +45,7 @@ var ForbiddenView = function ForbiddenView(_ref) {
45
45
  */
46
46
  var button = useMemo(function () {
47
47
  var _action$promise;
48
- var onEmbedCardClick = (_action$promise = action === null || action === void 0 ? void 0 : action.promise) !== null && _action$promise !== void 0 ? _action$promise : onAuthorise;
48
+ var onEmbedCardClick = (_action$promise = action === null || action === void 0 ? void 0 : action.promise) !== null && _action$promise !== void 0 ? _action$promise : onAuthorize;
49
49
  if (!onEmbedCardClick) {
50
50
  return null;
51
51
  }
@@ -57,7 +57,7 @@ var ForbiddenView = function ForbiddenView(_ref) {
57
57
  }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, toMessage(messages.try_another_account, callToActionMessageKey), {
58
58
  values: values
59
59
  })));
60
- }, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorise, values]);
60
+ }, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorize, values]);
61
61
  return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
62
62
  icon: icon,
63
63
  image: image !== null && image !== void 0 ? image : getUnresolvedEmbedCardImage('forbidden'),
@@ -0,0 +1,90 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["analytics", "context", "extensionKey", "onAuthorize", "testId"];
4
+ import Button from '@atlaskit/button';
5
+ import React, { useCallback, useMemo } from 'react';
6
+ import { FormattedMessage } from 'react-intl-next';
7
+ import { di } from 'react-magnetic-di';
8
+ import { messages } from '../../../../messages';
9
+ import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
10
+ import { getUnresolvedEmbedCardImage } from '../../utils';
11
+ import UnresolvedView from '../unresolved-view';
12
+ var UnauthorizedView = function UnauthorizedView(_ref) {
13
+ var _context$image;
14
+ var analytics = _ref.analytics,
15
+ context = _ref.context,
16
+ extensionKey = _ref.extensionKey,
17
+ onAuthorize = _ref.onAuthorize,
18
+ _ref$testId = _ref.testId,
19
+ testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
20
+ unresolvedViewProps = _objectWithoutProperties(_ref, _excluded);
21
+ var handleOnAuthorizeClick = useCallback(function () {
22
+ if (onAuthorize) {
23
+ analytics.track.appAccountAuthStarted({
24
+ extensionKey: extensionKey
25
+ });
26
+ onAuthorize();
27
+ }
28
+ }, [onAuthorize, analytics.track, extensionKey]);
29
+ var content = useMemo(function () {
30
+ if (onAuthorize) {
31
+ var _context$text;
32
+ // Our title and button messages always expect the product name to be present
33
+ // while the description support when product name is not present.
34
+ // To be looked at https://product-fabric.atlassian.net/browse/EDM-8173
35
+ var _values = {
36
+ context: (_context$text = context === null || context === void 0 ? void 0 : context.text) !== null && _context$text !== void 0 ? _context$text : ''
37
+ };
38
+ if (_values) {
39
+ // title: Connect your {context} account
40
+ // button: Connect to {context}
41
+ return {
42
+ title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
43
+ values: _values
44
+ })),
45
+ description: /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
46
+ analytics: analytics,
47
+ providerName: context === null || context === void 0 ? void 0 : context.text,
48
+ testId: testId
49
+ }),
50
+ button: /*#__PURE__*/React.createElement(Button, {
51
+ testId: "connect-account",
52
+ appearance: "primary",
53
+ onClick: handleOnAuthorizeClick
54
+ }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
55
+ values: _values
56
+ })))
57
+ };
58
+ }
59
+ }
60
+ var values = context !== null && context !== void 0 && context.text ? {
61
+ context: context === null || context === void 0 ? void 0 : context.text
62
+ } : undefined;
63
+ if (values) {
64
+ // title: We can't display private pages from {context}
65
+ // description: You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.
66
+ return {
67
+ title: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.unauthorised_account_name, {
68
+ values: values
69
+ })),
70
+ description: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.unauthorised_account_description, {
71
+ values: values
72
+ }))
73
+ };
74
+ }
75
+
76
+ // title: We can't display private pages
77
+ // description: You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.
78
+ return {
79
+ title: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_name_no_provider),
80
+ description: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_description_no_provider)
81
+ };
82
+ }, [analytics, context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, onAuthorize, testId]);
83
+ return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, content, {
84
+ icon: context === null || context === void 0 ? void 0 : context.icon,
85
+ image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : getUnresolvedEmbedCardImage('unauthorized'),
86
+ testId: testId,
87
+ text: context === null || context === void 0 ? void 0 : context.text
88
+ }));
89
+ };
90
+ export default UnauthorizedView;
@@ -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"])), tokens.actionIcon, getIconSizeStyles(getIconWidth(size)));
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
  };
@@ -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.33.2",
14
+ packageVersion: "26.34.1",
15
15
  componentName: 'linkUrl'
16
16
  };
17
17
  var Link = withLinkClickedEvent('a');
@@ -4,6 +4,11 @@ export declare const mockContext: {
4
4
  readonly atlassian: "https://schema.atlassian.com/ns/vocabulary#";
5
5
  readonly schema: "http://schema.org/";
6
6
  };
7
+ export declare const mockGenerator: {
8
+ '@type': string;
9
+ '@id': string;
10
+ name: string;
11
+ };
7
12
  export declare const mockByUrl: (url: string) => JsonLd.Response<JsonLd.Data.BaseData>;
8
13
  export declare const mocks: {
9
14
  success: JsonLd.Response<JsonLd.Data.BaseData>;
@@ -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)";
@@ -12,4 +12,8 @@ export interface EmbedCardUnauthorisedViewProps {
12
12
  onClick?: (evt: React.MouseEvent) => void;
13
13
  extensionKey?: string;
14
14
  }
15
+ /**
16
+ * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
17
+ * @deprecated Replaced by unauthorized-view
18
+ */
15
19
  export declare const EmbedCardUnauthorisedView: FC<EmbedCardUnauthorisedViewProps>;
@@ -3,6 +3,6 @@ import { ContextViewModel } from '../../types';
3
3
  import { UnresolvedViewProps } from '../unresolved-view/types';
4
4
  export type ForbiddenViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
5
5
  context?: ContextViewModel;
6
- onAuthorise?: () => void;
6
+ onAuthorize?: () => void;
7
7
  accessContext: RequestAccessContextProps;
8
8
  };
@@ -0,0 +1,4 @@
1
+ import { type FC } from 'react';
2
+ import { UnauthorizedViewProps } from './types';
3
+ declare const UnauthorizedView: FC<UnauthorizedViewProps>;
4
+ export default UnauthorizedView;
@@ -0,0 +1,9 @@
1
+ import type { AnalyticsFacade } from '../../../../state/analytics';
2
+ import { ContextViewModel } from '../../types';
3
+ import { UnresolvedViewProps } from '../unresolved-view/types';
4
+ export type UnauthorizedViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
5
+ analytics: AnalyticsFacade;
6
+ context?: ContextViewModel;
7
+ extensionKey?: string;
8
+ onAuthorize?: () => void;
9
+ };
@@ -6,4 +6,5 @@ export type ActionButtonProps = ActionProps & {
6
6
  iconBefore?: React.ReactChild;
7
7
  isLoading?: boolean;
8
8
  size: SmartLinkSize;
9
+ isDisabled?: boolean;
9
10
  };
@@ -4,4 +4,5 @@ export type ActionIconProps = {
4
4
  size?: SmartLinkSize;
5
5
  icon?: ReactChild;
6
6
  testId?: string;
7
+ isDisabled?: boolean;
7
8
  };
@@ -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.
@@ -4,6 +4,11 @@ export declare const mockContext: {
4
4
  readonly atlassian: "https://schema.atlassian.com/ns/vocabulary#";
5
5
  readonly schema: "http://schema.org/";
6
6
  };
7
+ export declare const mockGenerator: {
8
+ '@type': string;
9
+ '@id': string;
10
+ name: string;
11
+ };
7
12
  export declare const mockByUrl: (url: string) => JsonLd.Response<JsonLd.Data.BaseData>;
8
13
  export declare const mocks: {
9
14
  success: JsonLd.Response<JsonLd.Data.BaseData>;
@@ -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)";
@@ -12,4 +12,8 @@ export interface EmbedCardUnauthorisedViewProps {
12
12
  onClick?: (evt: React.MouseEvent) => void;
13
13
  extensionKey?: string;
14
14
  }
15
+ /**
16
+ * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
17
+ * @deprecated Replaced by unauthorized-view
18
+ */
15
19
  export declare const EmbedCardUnauthorisedView: FC<EmbedCardUnauthorisedViewProps>;
@@ -3,6 +3,6 @@ import { ContextViewModel } from '../../types';
3
3
  import { UnresolvedViewProps } from '../unresolved-view/types';
4
4
  export type ForbiddenViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
5
5
  context?: ContextViewModel;
6
- onAuthorise?: () => void;
6
+ onAuthorize?: () => void;
7
7
  accessContext: RequestAccessContextProps;
8
8
  };
@@ -0,0 +1,4 @@
1
+ import { type FC } from 'react';
2
+ import { UnauthorizedViewProps } from './types';
3
+ declare const UnauthorizedView: FC<UnauthorizedViewProps>;
4
+ export default UnauthorizedView;
@@ -0,0 +1,9 @@
1
+ import type { AnalyticsFacade } from '../../../../state/analytics';
2
+ import { ContextViewModel } from '../../types';
3
+ import { UnresolvedViewProps } from '../unresolved-view/types';
4
+ export type UnauthorizedViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
5
+ analytics: AnalyticsFacade;
6
+ context?: ContextViewModel;
7
+ extensionKey?: string;
8
+ onAuthorize?: () => void;
9
+ };
@@ -6,4 +6,5 @@ export type ActionButtonProps = ActionProps & {
6
6
  iconBefore?: React.ReactChild;
7
7
  isLoading?: boolean;
8
8
  size: SmartLinkSize;
9
+ isDisabled?: boolean;
9
10
  };
@@ -4,4 +4,5 @@ export type ActionIconProps = {
4
4
  size?: SmartLinkSize;
5
5
  icon?: ReactChild;
6
6
  testId?: string;
7
+ isDisabled?: boolean;
7
8
  };
@@ -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.33.2",
3
+ "version": "26.34.1",
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 };