@atlaskit/smart-card 40.1.0 → 40.2.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 40.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#185964](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185964)
8
+ [`7285ac5df3686`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7285ac5df3686) - -
9
+ [ux] Adds ability for actions in smart links to have inline padding (for TwC Panel)
10
+
3
11
  ## 40.1.0
4
12
 
5
13
  ### Minor Changes
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "40.0.1"
14
+ packageVersion: "40.1.0"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,3 +1,4 @@
1
+ ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
1
2
  ._18zrze3t{padding-inline:var(--ds-space-0,0)}
2
3
  ._1rjcze3t{padding-block:var(--ds-space-0,0)}
3
4
  ._1e0c1bgi{display:contents}
@@ -11,17 +11,21 @@ var _runtime = require("@compiled/react/runtime");
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
12
  var _react = _interopRequireDefault(require("react"));
13
13
  var _reactIntlNext = require("react-intl-next");
14
+ var _css = require("@atlaskit/css");
14
15
  var _compiled = require("@atlaskit/primitives/compiled");
15
16
  var _constants = require("../../../../../constants");
16
17
  var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
17
18
  var styles = {
18
19
  button: "_1e0c1bgi",
20
+ padding: "_18zrutpp",
19
21
  message: "_1rjcze3t _18zrze3t"
20
22
  };
21
23
  var UnresolvedAction = function UnresolvedAction(_ref) {
22
24
  var _context$actions;
23
25
  var _ref$testId = _ref.testId,
24
- testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId;
26
+ testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId,
27
+ _ref$hasPadding = _ref.hasPadding,
28
+ hasPadding = _ref$hasPadding === void 0 ? false : _ref$hasPadding;
25
29
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
26
30
  var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.InternalActionName.UnresolvedAction];
27
31
  if (!data) {
@@ -34,7 +38,7 @@ var UnresolvedAction = function UnresolvedAction(_ref) {
34
38
  var message = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
35
39
  testId: "".concat(testId, "-errored-view-message"),
36
40
  tabIndex: hasAction ? 0 : undefined,
37
- xcss: styles.message
41
+ xcss: (0, _css.cx)(styles.message, hasPadding && styles.padding)
38
42
  }, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, descriptor, {
39
43
  values: values
40
44
  })));
@@ -229,6 +229,6 @@ var FollowAction = exports.FollowAction = function FollowAction(props) {
229
229
  var PreviewAction = exports.PreviewAction = function PreviewAction(props) {
230
230
  return /*#__PURE__*/_react.default.createElement(_actions.PreviewAction, toActionProps(props));
231
231
  };
232
- var UnresolvedAction = exports.UnresolvedAction = function UnresolvedAction() {
233
- return /*#__PURE__*/_react.default.createElement(_actions.UnresolvedAction, null);
232
+ var UnresolvedAction = exports.UnresolvedAction = function UnresolvedAction(props) {
233
+ return /*#__PURE__*/_react.default.createElement(_actions.UnresolvedAction, props);
234
234
  };
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
20
20
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
21
21
  var PACKAGE_DATA = {
22
22
  packageName: "@atlaskit/smart-card",
23
- packageVersion: "40.0.1",
23
+ packageVersion: "40.1.0",
24
24
  componentName: 'linkUrl'
25
25
  };
26
26
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "40.0.1"
5
+ packageVersion: "40.1.0"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,3 +1,4 @@
1
+ ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
1
2
  ._18zrze3t{padding-inline:var(--ds-space-0,0)}
2
3
  ._1rjcze3t{padding-block:var(--ds-space-0,0)}
3
4
  ._1e0c1bgi{display:contents}
@@ -4,15 +4,18 @@ import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React from 'react';
6
6
  import { FormattedMessage } from 'react-intl-next';
7
+ import { cx } from '@atlaskit/css';
7
8
  import { Box, Pressable } from '@atlaskit/primitives/compiled';
8
9
  import { InternalActionName } from '../../../../../constants';
9
10
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
10
11
  const styles = {
11
12
  button: "_1e0c1bgi",
13
+ padding: "_18zrutpp",
12
14
  message: "_1rjcze3t _18zrze3t"
13
15
  };
14
16
  const UnresolvedAction = ({
15
- testId = 'unresolved-action'
17
+ testId = 'unresolved-action',
18
+ hasPadding = false
16
19
  }) => {
17
20
  var _context$actions;
18
21
  const context = useFlexibleUiContext();
@@ -29,7 +32,7 @@ const UnresolvedAction = ({
29
32
  const message = /*#__PURE__*/React.createElement(Box, {
30
33
  testId: `${testId}-errored-view-message`,
31
34
  tabIndex: hasAction ? 0 : undefined,
32
- xcss: styles.message
35
+ xcss: cx(styles.message, hasPadding && styles.padding)
33
36
  }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
34
37
  values: values
35
38
  })));
@@ -139,6 +139,6 @@ export const CustomAction = props => /*#__PURE__*/React.createElement(CustomActi
139
139
  export const DownloadAction = props => /*#__PURE__*/React.createElement(DownloadActionComponent, toActionProps(props));
140
140
  export const FollowAction = props => /*#__PURE__*/React.createElement(FollowActionComponent, toActionProps(props));
141
141
  export const PreviewAction = props => /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
142
- export const UnresolvedAction = () => /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
142
+ export const UnresolvedAction = props => /*#__PURE__*/React.createElement(UnresolvedActionComponent, props);
143
143
  export { CustomUnresolvedAction } from './components/actions';
144
144
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "40.0.1",
13
+ packageVersion: "40.1.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "40.0.1"
7
+ packageVersion: "40.1.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,3 +1,4 @@
1
+ ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
1
2
  ._18zrze3t{padding-inline:var(--ds-space-0,0)}
2
3
  ._1rjcze3t{padding-block:var(--ds-space-0,0)}
3
4
  ._1e0c1bgi{display:contents}
@@ -4,17 +4,21 @@ import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React from 'react';
6
6
  import { FormattedMessage } from 'react-intl-next';
7
+ import { cx } from '@atlaskit/css';
7
8
  import { Box, Pressable } from '@atlaskit/primitives/compiled';
8
9
  import { InternalActionName } from '../../../../../constants';
9
10
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
10
11
  var styles = {
11
12
  button: "_1e0c1bgi",
13
+ padding: "_18zrutpp",
12
14
  message: "_1rjcze3t _18zrze3t"
13
15
  };
14
16
  var UnresolvedAction = function UnresolvedAction(_ref) {
15
17
  var _context$actions;
16
18
  var _ref$testId = _ref.testId,
17
- testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId;
19
+ testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId,
20
+ _ref$hasPadding = _ref.hasPadding,
21
+ hasPadding = _ref$hasPadding === void 0 ? false : _ref$hasPadding;
18
22
  var context = useFlexibleUiContext();
19
23
  var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction];
20
24
  if (!data) {
@@ -27,7 +31,7 @@ var UnresolvedAction = function UnresolvedAction(_ref) {
27
31
  var message = /*#__PURE__*/React.createElement(Box, {
28
32
  testId: "".concat(testId, "-errored-view-message"),
29
33
  tabIndex: hasAction ? 0 : undefined,
30
- xcss: styles.message
34
+ xcss: cx(styles.message, hasPadding && styles.padding)
31
35
  }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
32
36
  values: values
33
37
  })));
@@ -203,8 +203,8 @@ export var FollowAction = function FollowAction(props) {
203
203
  export var PreviewAction = function PreviewAction(props) {
204
204
  return /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
205
205
  };
206
- export var UnresolvedAction = function UnresolvedAction() {
207
- return /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
206
+ export var UnresolvedAction = function UnresolvedAction(props) {
207
+ return /*#__PURE__*/React.createElement(UnresolvedActionComponent, props);
208
208
  };
209
209
  export { CustomUnresolvedAction } from './components/actions';
210
210
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
13
13
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
14
14
  var PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/smart-card",
16
- packageVersion: "40.0.1",
16
+ packageVersion: "40.1.0",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- declare const UnresolvedAction: ({ testId }: {
2
+ declare const UnresolvedAction: ({ testId, hasPadding, }: {
3
3
  testId?: string | undefined;
4
+ hasPadding?: boolean | undefined;
4
5
  }) => React.JSX.Element | null;
5
6
  export default UnresolvedAction;
@@ -78,6 +78,8 @@ export type FollowActionProps = BaseActionProps;
78
78
  export declare const FollowAction: (props: FollowActionProps) => React.JSX.Element;
79
79
  export type PreviewActionProps = BaseActionProps;
80
80
  export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
81
- export declare const UnresolvedAction: () => React.JSX.Element;
81
+ export declare const UnresolvedAction: (props: {
82
+ hasPadding?: boolean;
83
+ }) => React.JSX.Element;
82
84
  export { CustomUnresolvedAction } from './components/actions';
83
85
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- declare const UnresolvedAction: ({ testId }: {
2
+ declare const UnresolvedAction: ({ testId, hasPadding, }: {
3
3
  testId?: string | undefined;
4
+ hasPadding?: boolean | undefined;
4
5
  }) => React.JSX.Element | null;
5
6
  export default UnresolvedAction;
@@ -78,6 +78,8 @@ export type FollowActionProps = BaseActionProps;
78
78
  export declare const FollowAction: (props: FollowActionProps) => React.JSX.Element;
79
79
  export type PreviewActionProps = BaseActionProps;
80
80
  export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
81
- export declare const UnresolvedAction: () => React.JSX.Element;
81
+ export declare const UnresolvedAction: (props: {
82
+ hasPadding?: boolean;
83
+ }) => React.JSX.Element;
82
84
  export { CustomUnresolvedAction } from './components/actions';
83
85
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "40.1.0",
3
+ "version": "40.2.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"