@atlaskit/smart-card 34.0.0 → 34.1.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/FlexibleCard/components/actions/action/ActionOld.js +112 -0
  4. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/ActionButtonOld.js +95 -0
  5. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +16 -0
  6. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +20 -45
  7. package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/ActionIconOld.js +67 -0
  8. package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.compiled.css +50 -0
  9. package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +32 -39
  10. package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +25 -16
  11. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/SkeletonOld.js +90 -0
  12. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.compiled.css +27 -0
  13. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +39 -70
  14. package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +9 -10
  15. package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/RelatedLinksActionIconOld.js +33 -0
  16. package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.compiled.css +2 -0
  17. package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +20 -15
  18. package/dist/cjs/view/FlexibleCard/components/utils.js +8 -0
  19. package/dist/cjs/view/LinkUrl/index.js +1 -1
  20. package/dist/es2019/utils/analytics/analytics.js +1 -1
  21. package/dist/es2019/view/FlexibleCard/components/actions/action/ActionOld.js +100 -0
  22. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/ActionButtonOld.js +88 -0
  23. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +16 -0
  24. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +20 -49
  25. package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/ActionIconOld.js +57 -0
  26. package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.compiled.css +50 -0
  27. package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +32 -38
  28. package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +22 -15
  29. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/SkeletonOld.js +82 -0
  30. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.compiled.css +27 -0
  31. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +28 -68
  32. package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +7 -11
  33. package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/RelatedLinksActionIconOld.js +23 -0
  34. package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.compiled.css +2 -0
  35. package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +16 -13
  36. package/dist/es2019/view/FlexibleCard/components/utils.js +8 -0
  37. package/dist/es2019/view/LinkUrl/index.js +1 -1
  38. package/dist/esm/utils/analytics/analytics.js +1 -1
  39. package/dist/esm/view/FlexibleCard/components/actions/action/ActionOld.js +104 -0
  40. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/ActionButtonOld.js +84 -0
  41. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +16 -0
  42. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +20 -44
  43. package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/ActionIconOld.js +60 -0
  44. package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.compiled.css +50 -0
  45. package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +28 -38
  46. package/dist/esm/view/FlexibleCard/components/actions/action/index.js +22 -15
  47. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/SkeletonOld.js +83 -0
  48. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.compiled.css +27 -0
  49. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.js +35 -68
  50. package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +7 -11
  51. package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/RelatedLinksActionIconOld.js +25 -0
  52. package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.compiled.css +2 -0
  53. package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +17 -14
  54. package/dist/esm/view/FlexibleCard/components/utils.js +8 -0
  55. package/dist/esm/view/LinkUrl/index.js +1 -1
  56. package/dist/types/view/FlexibleCard/components/actions/action/ActionOld.d.ts +13 -0
  57. package/dist/types/view/FlexibleCard/components/actions/action/action-button/ActionButtonOld.d.ts +4 -0
  58. package/dist/types/view/FlexibleCard/components/actions/action/action-button/index.d.ts +2 -2
  59. package/dist/types/view/FlexibleCard/components/actions/action/action-icon/ActionIconOld.d.ts +8 -0
  60. package/dist/types/view/FlexibleCard/components/actions/action/action-icon/index.d.ts +2 -6
  61. package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +2 -11
  62. package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +7 -0
  63. package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/SkeletonOld.d.ts +10 -0
  64. package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.d.ts +3 -6
  65. package/dist/types/view/FlexibleCard/components/actions/view-related-links-action/index.d.ts +2 -2
  66. package/dist/types/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/RelatedLinksActionIconOld.d.ts +10 -0
  67. package/dist/types/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.d.ts +2 -9
  68. package/dist/types/view/FlexibleCard/components/utils.d.ts +3 -0
  69. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/ActionOld.d.ts +13 -0
  70. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-button/ActionButtonOld.d.ts +4 -0
  71. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-button/index.d.ts +2 -2
  72. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-icon/ActionIconOld.d.ts +8 -0
  73. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-icon/index.d.ts +2 -6
  74. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/index.d.ts +2 -11
  75. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +7 -0
  76. package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/SkeletonOld.d.ts +10 -0
  77. package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/skeleton/main.d.ts +3 -6
  78. package/dist/types-ts4.5/view/FlexibleCard/components/actions/view-related-links-action/index.d.ts +2 -2
  79. package/dist/types-ts4.5/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/RelatedLinksActionIconOld.d.ts +10 -0
  80. package/dist/types-ts4.5/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.d.ts +2 -9
  81. package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +3 -0
  82. package/package.json +4 -4
@@ -1,82 +1,42 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import { css, jsx, keyframes } from '@emotion/react';
1
+ /* main.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import "./main.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { N20, N30 } from '@atlaskit/theme/colors';
8
- const AutomationSkeletonContainer = css({
9
- paddingBlock: "var(--ds-space-025, 2px)"
10
- });
11
- const SkeletonContainer = css({
12
- marginBlock: "var(--ds-space-100, 8px)",
13
- marginInline: "var(--ds-space-250, 20px)",
14
- display: 'flex'
15
- });
16
- const SkeletonIcon = css({
17
- width: "var(--ds-space-200, 16px)",
18
- height: "var(--ds-space-200, 16px)",
19
- display: 'inline-block',
20
- borderRadius: "var(--ds-space-025, 2px)",
21
- backgroundColor: 'currentColor',
22
- border: `${"var(--ds-space-025, 2px)"} solid transparent`,
23
- opacity: 0.15
24
- });
25
- const MenuIcon = css({
26
- width: '24px',
27
- height: '24px',
28
- display: 'flex',
29
- justifyContent: 'center',
30
- alignItems: 'center'
31
- });
32
- const shimmer = keyframes({
33
- '0%': {
34
- backgroundPosition: '-300px 0'
35
- },
36
- '100%': {
37
- backgroundPosition: '2000px 0'
38
- }
39
- });
40
- const SkeletonText = css({
41
- width: '85%',
42
- height: "var(--ds-space-200, 16px)",
43
- marginTop: "var(--ds-space-050, 4px)",
44
- marginLeft: "var(--ds-space-150, 12px)",
45
- animationDuration: '1s',
46
- animationFillMode: 'forwards',
47
- animationIterationCount: 'infinite',
48
- animationName: shimmer,
49
- animationTimingFunction: 'linear',
50
- backgroundColor: `var(--ds-skeleton, ${N30})`,
51
- backgroundImage: `linear-gradient(to right, ${`var(--ds-skeleton, ${N30})`} 10%, ${`var(--ds-skeleton-subtle, ${N20})`} 30%, ${`var(--ds-skeleton, ${N30})`} 50%)`,
52
- backgroundRepeat: 'no-repeat'
53
- });
54
- const SkeletonLine = () => jsx("div", {
55
- css: SkeletonContainer
56
- }, jsx("div", {
57
- css: MenuIcon
58
- }, jsx("div", {
59
- css: SkeletonIcon
60
- })), jsx("div", {
61
- css: SkeletonText
7
+ import { SkeletonOld } from './SkeletonOld';
8
+ const AutomationSkeletonContainer = null;
9
+ const SkeletonContainer = null;
10
+ const SkeletonIcon = null;
11
+ const MenuIcon = null;
12
+ const shimmer = null;
13
+ const SkeletonText = null;
14
+ const SkeletonLine = () => /*#__PURE__*/React.createElement("div", {
15
+ className: ax(["_1mouu2gc _195gv47k _1e0c1txw"])
16
+ }, /*#__PURE__*/React.createElement("div", {
17
+ className: ax(["_1bsb1tcg _4t3i1tcg _1e0c1txw _1bah1h6o _4cvr1h6o"])
18
+ }, /*#__PURE__*/React.createElement("div", {
19
+ className: ax(["_2rkov77o _19it1i39 _1bsbpxbi _4t3ipxbi _1e0c1o8l _bfhk1r31 _tzy4nh7s"])
20
+ })), /*#__PURE__*/React.createElement("div", {
21
+ className: ax(["_1bsb13sl _4t3ipxbi _19pk1b66 _18u0utpp _5sag9cwz _1o51q7pw _tip812c5 _j7hq1nls _1pglp3kn _bfhkqrzy _1itk34ia _12vemgnk"])
62
22
  }));
63
23
  const getSkeletonLines = lineCount => {
64
24
  const skeletonLines = [];
65
25
  for (let i = 0; i < lineCount; i++) {
66
- skeletonLines.push(jsx(SkeletonLine, {
26
+ skeletonLines.push( /*#__PURE__*/React.createElement(SkeletonLine, {
67
27
  key: `skeleton-line-${i}`
68
28
  }));
69
29
  }
70
30
  return skeletonLines;
71
31
  };
72
- export const Skeleton = props => {
32
+ export const SkeletonNew = props => {
73
33
  const {
74
34
  lineCount = 5
75
35
  } = props;
76
- return (
77
- // eslint-disable-next-line @atlaskit/design-system/use-primitives
78
- jsx("div", {
79
- css: AutomationSkeletonContainer
80
- }, getSkeletonLines(lineCount))
81
- );
36
+ return /*#__PURE__*/React.createElement("div", {
37
+ className: ax(["_1rjcv77o"])
38
+ }, getSkeletonLines(lineCount));
39
+ };
40
+ export const Skeleton = props => {
41
+ return fg('bandicoots-compiled-migration-smartcard') ? /*#__PURE__*/React.createElement(SkeletonNew, props) : /*#__PURE__*/React.createElement(SkeletonOld, props);
82
42
  };
@@ -1,12 +1,8 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
6
5
  import { lazy, useCallback } from 'react';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
- import { jsx } from '@emotion/react';
10
6
  import { FormattedMessage } from 'react-intl-next';
11
7
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
12
8
  import { messages } from '../../../../../messages';
@@ -29,7 +25,7 @@ const ViewRelatedLinksAction = ({
29
25
  const onClick = useCallback(() => {
30
26
  const ari = actionData === null || actionData === void 0 ? void 0 : actionData.ari;
31
27
  if (ari) {
32
- modal.open(jsx(RelatedLinksModal, {
28
+ modal.open( /*#__PURE__*/React.createElement(RelatedLinksModal, {
33
29
  ari: ari,
34
30
  showModal: true,
35
31
  onClose: () => modal.close()
@@ -38,9 +34,9 @@ const ViewRelatedLinksAction = ({
38
34
  fireEvent('ui.button.clicked.relatedLinks', {});
39
35
  onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
40
36
  }, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
41
- return actionData ? jsx(Action, _extends({
42
- content: jsx(FormattedMessage, messages.related_links_view_related_urls),
43
- icon: jsx(RelatedLinksActionIcon, null),
37
+ return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
38
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_urls),
39
+ icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, null),
44
40
  onClick: onClick,
45
41
  testId: "smart-action-view-related-links-action",
46
42
  ariaLabel: "View most recent pages or content types coming from or found on this link"
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
+ import { css, jsx } from '@emotion/react';
7
+ import ChildIssuesIcon from '@atlaskit/icon/core/migration/child-issues';
8
+ const rotateSvg = css({
9
+ transform: 'rotate(180deg)',
10
+ display: 'inline-block'
11
+ });
12
+
13
+ /**
14
+ * ChildIssuesIcon but 180 degrees rotated
15
+ */
16
+ const RelatedLinksActionIconOld = () => jsx("span", {
17
+ css: rotateSvg
18
+ }, jsx(ChildIssuesIcon, {
19
+ color: "currentColor",
20
+ spacing: "spacious",
21
+ label: "View recent links..."
22
+ }));
23
+ export default RelatedLinksActionIconOld;
@@ -0,0 +1,2 @@
1
+ ._1e0c1o8l{display:inline-block}
2
+ ._t9ec1sub{transform:rotate(180deg)}
@@ -1,23 +1,26 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import { css, jsx } from '@emotion/react';
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import "./index.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
7
5
  import ChildIssuesIcon from '@atlaskit/icon/core/migration/child-issues';
8
- const rotateSvg = css({
9
- transform: 'rotate(180deg)',
10
- display: 'inline-block'
11
- });
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import RelatedLinksActionIconOld from './RelatedLinksActionIconOld';
8
+ const rotateSvg = null;
12
9
 
13
10
  /**
14
11
  * ChildIssuesIcon but 180 degrees rotated
15
12
  */
16
- const RelatedLinksActionIcon = () => jsx("span", {
17
- css: rotateSvg
18
- }, jsx(ChildIssuesIcon, {
13
+ const RelatedLinksActionIconNew = () => /*#__PURE__*/React.createElement("span", {
14
+ className: ax(["_t9ec1sub _1e0c1o8l"])
15
+ }, /*#__PURE__*/React.createElement(ChildIssuesIcon, {
19
16
  color: "currentColor",
20
17
  spacing: "spacious",
21
18
  label: "View recent links..."
22
19
  }));
20
+ const RelatedLinksActionIcon = () => {
21
+ if (fg('bandicoots-compiled-migration-smartcard')) {
22
+ return /*#__PURE__*/React.createElement(RelatedLinksActionIconNew, null);
23
+ }
24
+ return /*#__PURE__*/React.createElement(RelatedLinksActionIconOld, null);
25
+ };
23
26
  export default RelatedLinksActionIcon;
@@ -31,6 +31,10 @@ export const getFormattedMessageAsString = (intl, message, context) => {
31
31
  context
32
32
  }) : '';
33
33
  };
34
+
35
+ /**
36
+ * @deprecated remove on FF bandicoots-compiled-migration-smartcard clean up
37
+ */
34
38
  const getIconDimensionStyles = value => css({
35
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
36
40
  height: value,
@@ -45,6 +49,10 @@ const getIconDimensionStyles = value => css({
45
49
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
46
50
  maxWidth: value
47
51
  });
52
+
53
+ /**
54
+ * @deprecated remove on FF bandicoots-compiled-migration-smartcard clean up
55
+ */
48
56
  export const getIconSizeStyles = width => {
49
57
  const sizeStyles = getIconDimensionStyles(width);
50
58
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
@@ -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: "34.0.0",
13
+ packageVersion: "34.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: "34.0.0"
7
+ packageVersion: "34.1.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
+ import { jsx } from '@emotion/react';
7
+ import { SmartLinkSize } from '../../../../../constants';
8
+ import ActionButton from './action-button';
9
+ import ActionDropdownItem from './action-dropdown-item';
10
+ import ActionIcon from './action-icon';
11
+ import ActionStackItem from './action-stack-item';
12
+ /**
13
+ * A base action that can be triggered with an on click.
14
+ * @internal
15
+ * @param {ActionProps} ActionProps - The props necessary for the Action.
16
+ */
17
+ var ActionOld = function ActionOld(_ref) {
18
+ var as = _ref.as,
19
+ _ref$appearance = _ref.appearance,
20
+ appearance = _ref$appearance === void 0 ? 'subtle' : _ref$appearance,
21
+ content = _ref.content,
22
+ _ref$isLoading = _ref.isLoading,
23
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
24
+ onClick = _ref.onClick,
25
+ _ref$size = _ref.size,
26
+ size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
27
+ _ref$testId = _ref.testId,
28
+ testId = _ref$testId === void 0 ? 'smart-action' : _ref$testId,
29
+ icon = _ref.icon,
30
+ _ref$iconPosition = _ref.iconPosition,
31
+ iconPosition = _ref$iconPosition === void 0 ? 'before' : _ref$iconPosition,
32
+ spaceInline = _ref.spaceInline,
33
+ tooltipMessage = _ref.tooltipMessage,
34
+ tooltipOnHide = _ref.tooltipOnHide,
35
+ hideTooltip = _ref.hideTooltip,
36
+ hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
37
+ xcss = _ref.xcss,
38
+ asDropDownItem = _ref.asDropDownItem,
39
+ overrideCss = _ref.overrideCss,
40
+ isDisabled = _ref.isDisabled,
41
+ href = _ref.href,
42
+ ariaLabel = _ref.ariaLabel,
43
+ Wrapper = _ref.wrapper;
44
+ if (!onClick) {
45
+ return null;
46
+ }
47
+ var isStackItem = as === 'stack-item';
48
+ var isDropdownItem = as === 'dropdown-item' || asDropDownItem;
49
+ var actionIcon = icon && jsx(ActionIcon, {
50
+ asStackItemIcon: isStackItem,
51
+ isDisabled: isDisabled,
52
+ icon: icon,
53
+ size: size,
54
+ testId: testId
55
+ });
56
+ var iconBefore = icon && iconPosition === 'before' ? actionIcon : undefined;
57
+ var iconAfter = icon && iconPosition === 'after' ? actionIcon : undefined;
58
+ if (isStackItem) {
59
+ return jsx(ActionStackItem, {
60
+ content: content,
61
+ icon: actionIcon,
62
+ space: spaceInline,
63
+ isDisabled: isDisabled,
64
+ isLoading: isLoading,
65
+ onClick: onClick,
66
+ size: size,
67
+ testId: testId,
68
+ tooltipMessage: tooltipMessage || content
69
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
70
+ ,
71
+ xcss: xcss,
72
+ tooltipOnHide: tooltipOnHide,
73
+ hideTooltipOnMouseDown: hideTooltipOnMouseDown,
74
+ hideTooltip: hideTooltip
75
+ });
76
+ }
77
+ if (isDropdownItem) {
78
+ return jsx(ActionDropdownItem, {
79
+ content: content,
80
+ iconAfter: iconAfter,
81
+ iconBefore: iconBefore,
82
+ isLoading: isLoading,
83
+ onClick: onClick,
84
+ testId: testId
85
+ });
86
+ }
87
+ var button = jsx(ActionButton, {
88
+ appearance: appearance,
89
+ content: content,
90
+ iconAfter: iconAfter,
91
+ iconBefore: iconBefore,
92
+ isLoading: isLoading,
93
+ onClick: onClick,
94
+ overrideCss: overrideCss,
95
+ size: size,
96
+ testId: testId,
97
+ tooltipMessage: tooltipMessage || content,
98
+ isDisabled: isDisabled,
99
+ href: href,
100
+ ariaLabel: ariaLabel
101
+ });
102
+ return Wrapper !== undefined ? jsx(Wrapper, null, button) : button;
103
+ };
104
+ export default ActionOld;
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React, { useCallback } from 'react';
6
+
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
+ import { css, jsx } from '@emotion/react';
9
+ import { LoadingButton } from '@atlaskit/button';
10
+ import Tooltip from '@atlaskit/tooltip';
11
+ import { SmartLinkSize } from '../../../../../../constants';
12
+ import { sizeToButtonSpacing } from '../../../utils';
13
+ var getButtonStyle = function getButtonStyle(size, iconOnly) {
14
+ switch (size) {
15
+ case SmartLinkSize.Large:
16
+ return iconOnly ? css({
17
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
18
+ 'button, button:hover, button:focus, button:active': {
19
+ padding: 0,
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
+ '> span': {
22
+ margin: 0
23
+ }
24
+ }
25
+ }) : '';
26
+ case SmartLinkSize.Small:
27
+ return css({
28
+ font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
29
+ fontWeight: "var(--ds-font-weight-medium, 500)",
30
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
31
+ 'button, button:hover, button:focus, button:active': [{
32
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
33
+ lineHeight: 'inherit'
34
+ }, iconOnly ? "\n padding: 0.125rem;\n " : "\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n "]
35
+ });
36
+ case SmartLinkSize.XLarge:
37
+ case SmartLinkSize.Medium:
38
+ default:
39
+ return '';
40
+ }
41
+ };
42
+ var ActionButtonOld = function ActionButtonOld(_ref) {
43
+ var appearance = _ref.appearance,
44
+ content = _ref.content,
45
+ iconAfter = _ref.iconAfter,
46
+ iconBefore = _ref.iconBefore,
47
+ isLoading = _ref.isLoading,
48
+ onClick = _ref.onClick,
49
+ overrideCss = _ref.overrideCss,
50
+ size = _ref.size,
51
+ testId = _ref.testId,
52
+ tooltipMessage = _ref.tooltipMessage,
53
+ isDisabled = _ref.isDisabled,
54
+ href = _ref.href,
55
+ ariaLabel = _ref.ariaLabel;
56
+ var iconOnly = !content;
57
+ var onButtonClick = useCallback(function (handler) {
58
+ return function (e) {
59
+ e.preventDefault();
60
+ handler();
61
+ };
62
+ }, []);
63
+ return jsx("div", {
64
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
65
+ css: [getButtonStyle(size, iconOnly), overrideCss],
66
+ "data-testid": "".concat(testId, "-button-wrapper")
67
+ }, jsx(Tooltip, {
68
+ content: tooltipMessage,
69
+ hideTooltipOnClick: true,
70
+ testId: "".concat(testId, "-tooltip")
71
+ }, jsx(LoadingButton, {
72
+ appearance: appearance,
73
+ iconAfter: iconAfter,
74
+ iconBefore: iconBefore,
75
+ isDisabled: isDisabled,
76
+ isLoading: isLoading,
77
+ onClick: onButtonClick(onClick),
78
+ spacing: sizeToButtonSpacing[size],
79
+ testId: testId,
80
+ href: href,
81
+ "aria-label": ariaLabel
82
+ }, content)));
83
+ };
84
+ export default ActionButtonOld;
@@ -0,0 +1,16 @@
1
+ ._11c8qk37{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11lv1xvx button, ._192b1xvx button:active, ._vbn71xvx button:focus, ._wfu31xvx button:hover{padding-left:var(--ds-space-025,.125rem)}
3
+ ._11lvidpf button, ._192bidpf button:active, ._vbn7idpf button:focus, ._wfu3idpf button:hover{padding-left:0}
4
+ ._11lvpdf9 button, ._192bpdf9 button:active, ._vbn7pdf9 button:focus, ._wfu3pdf9 button:hover{padding-left:var(--ds-space-050,.25rem)}
5
+ ._1gfl1xvx button, ._or3f1xvx button:active, ._1ddv1xvx button:focus, ._1hha1xvx button:hover{padding-top:var(--ds-space-025,.125rem)}
6
+ ._1gflidpf button, ._or3fidpf button:active, ._1ddvidpf button:focus, ._1hhaidpf button:hover{padding-top:0}
7
+ ._1gqn1xvx button, ._1qdm1xvx button:active, ._df2r1xvx button:focus, ._j1tw1xvx button:hover{padding-bottom:var(--ds-space-025,.125rem)}
8
+ ._1gqnidpf button, ._1qdmidpf button:active, ._df2ridpf button:focus, ._j1twidpf button:hover{padding-bottom:0}
9
+ ._1i3bidpf button:active>span, ._13gwidpf button:focus>span, ._4wlcidpf button:hover>span, ._rehaidpf button>span{margin-top:0}
10
+ ._1vtwidpf button:active>span, ._ijvwidpf button:focus>span, ._tpwpidpf button:hover>span, ._1ad8idpf button>span{margin-left:0}
11
+ ._3kh9idpf button:active>span, ._i2vxidpf button:focus>span, ._8pvjidpf button:hover>span, ._1e1oidpf button>span{margin-bottom:0}
12
+ ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
13
+ ._mp2fidpf button:active>span, ._ro8midpf button:focus>span, ._1l0qidpf button:hover>span, ._1bnaidpf button>span{margin-right:0}
14
+ ._yhjm1xvx button, ._1trn1xvx button:active, ._1fst1xvx button:focus, ._1xce1xvx button:hover{padding-right:var(--ds-space-025,.125rem)}
15
+ ._yhjmidpf button, ._1trnidpf button:active, ._1fstidpf button:focus, ._1xceidpf button:hover{padding-right:0}
16
+ ._yhjmpdf9 button, ._1trnpdf9 button:active, ._1fstpdf9 button:focus, ._1xcepdf9 button:hover{padding-right:var(--ds-space-050,.25rem)}
@@ -1,58 +1,31 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import "./index.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
5
4
  import React, { useCallback } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
5
  import { LoadingButton } from '@atlaskit/button';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
10
7
  import Tooltip from '@atlaskit/tooltip';
11
8
  import { SmartLinkSize } from '../../../../../../constants';
12
9
  import { sizeToButtonSpacing } from '../../../utils';
13
- var getButtonStyle = function getButtonStyle(size, iconOnly) {
14
- switch (size) {
15
- case SmartLinkSize.Large:
16
- return iconOnly ? css({
17
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
18
- 'button, button:hover, button:focus, button:active': {
19
- padding: 0,
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
- '> span': {
22
- margin: 0
23
- }
24
- }
25
- }) : '';
26
- case SmartLinkSize.Small:
27
- return css({
28
- font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
29
- fontWeight: "var(--ds-font-weight-medium, 500)",
30
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
31
- 'button, button:hover, button:focus, button:active': [{
32
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
33
- lineHeight: 'inherit'
34
- }, iconOnly ? "\n padding: 0.125rem;\n " : "\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n "]
35
- });
36
- case SmartLinkSize.XLarge:
37
- case SmartLinkSize.Medium:
38
- default:
39
- return '';
40
- }
41
- };
42
- var ActionButton = function ActionButton(_ref) {
10
+ import ActionButtonOld from './ActionButtonOld';
11
+ var IconOnlyLarge = null;
12
+ var SizeSmall = null;
13
+ var SizeSmallIconOnly = null;
14
+ var SizeSmallNotIconOnly = null;
15
+ var ActionButtonNew = function ActionButtonNew(_ref) {
43
16
  var appearance = _ref.appearance,
44
17
  content = _ref.content,
45
18
  iconAfter = _ref.iconAfter,
46
19
  iconBefore = _ref.iconBefore,
47
20
  isLoading = _ref.isLoading,
48
21
  onClick = _ref.onClick,
49
- overrideCss = _ref.overrideCss,
50
22
  size = _ref.size,
51
23
  testId = _ref.testId,
52
24
  tooltipMessage = _ref.tooltipMessage,
53
25
  isDisabled = _ref.isDisabled,
54
26
  href = _ref.href,
55
- ariaLabel = _ref.ariaLabel;
27
+ ariaLabel = _ref.ariaLabel,
28
+ className = _ref.className;
56
29
  var iconOnly = !content;
57
30
  var onButtonClick = useCallback(function (handler) {
58
31
  return function (e) {
@@ -60,15 +33,15 @@ var ActionButton = function ActionButton(_ref) {
60
33
  handler();
61
34
  };
62
35
  }, []);
63
- return jsx("div", {
64
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
65
- css: [getButtonStyle(size, iconOnly), overrideCss],
36
+ return /*#__PURE__*/React.createElement("div", {
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
38
+ className: ax([size === SmartLinkSize.Large && iconOnly && "_1gflidpf _or3fidpf _1ddvidpf _1hhaidpf _yhjmidpf _1trnidpf _1fstidpf _1xceidpf _1gqnidpf _1qdmidpf _df2ridpf _j1twidpf _11lvidpf _192bidpf _vbn7idpf _wfu3idpf _1i3bidpf _13gwidpf _4wlcidpf _rehaidpf _mp2fidpf _ro8midpf _1l0qidpf _1bnaidpf _3kh9idpf _i2vxidpf _8pvjidpf _1e1oidpf _1vtwidpf _ijvwidpf _tpwpidpf _1ad8idpf", size === SmartLinkSize.Small && "_11c8qk37 _k48p1wq8", size === SmartLinkSize.Small && iconOnly && "_1gfl1xvx _or3f1xvx _1ddv1xvx _1hha1xvx _yhjm1xvx _1trn1xvx _1fst1xvx _1xce1xvx _1gqn1xvx _1qdm1xvx _df2r1xvx _j1tw1xvx _11lv1xvx _192b1xvx _vbn71xvx _wfu31xvx", size === SmartLinkSize.Small && !iconOnly && "_11lvpdf9 _192bpdf9 _vbn7pdf9 _wfu3pdf9 _yhjmpdf9 _1trnpdf9 _1fstpdf9 _1xcepdf9", className]),
66
39
  "data-testid": "".concat(testId, "-button-wrapper")
67
- }, jsx(Tooltip, {
40
+ }, /*#__PURE__*/React.createElement(Tooltip, {
68
41
  content: tooltipMessage,
69
42
  hideTooltipOnClick: true,
70
43
  testId: "".concat(testId, "-tooltip")
71
- }, jsx(LoadingButton, {
44
+ }, /*#__PURE__*/React.createElement(LoadingButton, {
72
45
  appearance: appearance,
73
46
  iconAfter: iconAfter,
74
47
  iconBefore: iconBefore,
@@ -81,4 +54,7 @@ var ActionButton = function ActionButton(_ref) {
81
54
  "aria-label": ariaLabel
82
55
  }, content)));
83
56
  };
57
+ var ActionButton = function ActionButton(props) {
58
+ return fg('bandicoots-compiled-migration-smartcard') ? /*#__PURE__*/React.createElement(ActionButtonNew, props) : /*#__PURE__*/React.createElement(ActionButtonOld, props);
59
+ };
84
60
  export default ActionButton;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
+ import { css, jsx } from '@emotion/react';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { SmartLinkSize } from '../../../../../../constants';
9
+ import { getIconSizeStyles } from '../../../utils';
10
+ var getIconWidth = function getIconWidth(size) {
11
+ switch (size) {
12
+ case SmartLinkSize.XLarge:
13
+ case SmartLinkSize.Large:
14
+ return '1.5rem';
15
+ case SmartLinkSize.Medium:
16
+ case SmartLinkSize.Small:
17
+ default:
18
+ return '1rem';
19
+ }
20
+ };
21
+ var getIconStyles = function getIconStyles(isDisabled) {
22
+ return css({
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
24
+ color: isDisabled ? "var(--ds-text-disabled, #6B778C)" : "var(--ds-icon, #44546F)"
25
+ });
26
+ };
27
+ var stackItemIconSizeStyles = getIconSizeStyles('20px');
28
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
29
+ var stackItemIconStyles = css(stackItemIconSizeStyles, {
30
+ display: 'inline-block',
31
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
32
+ lineHeight: 0,
33
+ padding: "var(--ds-space-025, 2px)",
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
35
+ 'span,svg,img': {
36
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
37
+ lineHeight: 0
38
+ }
39
+ });
40
+ var newStackItemIconStyles = css({
41
+ display: 'inline-block',
42
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
43
+ lineHeight: 0
44
+ });
45
+ var ActionIconOld = function ActionIconOld(_ref) {
46
+ var size = _ref.size,
47
+ testId = _ref.testId,
48
+ icon = _ref.icon,
49
+ isDisabled = _ref.isDisabled,
50
+ asStackItemIcon = _ref.asStackItemIcon;
51
+ return jsx("span", {
52
+ css: [
53
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
54
+ getIconStyles(isDisabled), !fg('platform-visual-refresh-icons') ? asStackItemIcon ? stackItemIconStyles :
55
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
56
+ getIconSizeStyles(getIconWidth(size)) : newStackItemIconStyles],
57
+ "data-testid": "".concat(testId, "-icon")
58
+ }, icon);
59
+ };
60
+ export default ActionIconOld;