@atlaskit/smart-card 34.3.0 → 34.4.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 +15 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +201 -263
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.js +115 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.compiled.css +46 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +58 -81
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.js +135 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.js +108 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +10 -57
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.compiled.css +2 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +38 -37
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.js +58 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +24 -16
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +48 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +55 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +23 -19
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +14 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +63 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +61 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +20 -19
- package/dist/cjs/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +51 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.js +24 -24
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +66 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/index.js +31 -25
- package/dist/cjs/view/RelatedLinksModal/views/resolved/ResolvedOld.js +45 -0
- package/dist/cjs/view/RelatedLinksModal/views/resolved/index.js +16 -14
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +141 -0
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +56 -50
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +69 -55
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.js +113 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.compiled.css +46 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +60 -95
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.js +118 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.js +102 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +11 -57
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.compiled.css +2 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +35 -36
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.js +50 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +15 -11
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +42 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +55 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +20 -18
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +9 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +55 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +55 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +19 -18
- package/dist/es2019/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +42 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.js +23 -22
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +58 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.js +28 -24
- package/dist/es2019/view/RelatedLinksModal/views/resolved/ResolvedOld.js +36 -0
- package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +16 -13
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +133 -0
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +53 -49
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +116 -162
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.js +108 -0
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.compiled.css +46 -0
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +54 -79
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.js +127 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.js +101 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +11 -56
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.compiled.css +2 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +36 -37
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.js +53 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +15 -11
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +42 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +55 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +20 -18
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +14 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +53 -0
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +54 -0
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +19 -18
- package/dist/esm/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +43 -0
- package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.js +24 -23
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +58 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.js +28 -24
- package/dist/esm/view/RelatedLinksModal/views/resolved/ResolvedOld.js +37 -0
- package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +16 -13
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +133 -0
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +53 -49
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.d.ts +17 -0
- package/dist/types/view/FlexibleCard/components/blocks/element-group/index.d.ts +5 -9
- package/dist/types/view/FlexibleCard/components/blocks/element-group/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.d.ts +16 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.d.ts +15 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +5 -7
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -13
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.d.ts +9 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +8 -2
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.d.ts +14 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +5 -3
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -0
- package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-links-list/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.d.ts +6 -0
- package/dist/types/view/RelatedLinksModal/views/errored/error-svg/index.d.ts +2 -6
- package/dist/types/view/RelatedLinksModal/views/resolved/ResolvedOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/views/resolved/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.d.ts +6 -0
- package/dist/types/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.d.ts +2 -6
- package/dist/types-ts4.5/utils/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.d.ts +17 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/index.d.ts +5 -9
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.d.ts +16 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.d.ts +15 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +5 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -13
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.d.ts +9 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +8 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.d.ts +14 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +5 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +1 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/index.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/index.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.d.ts +6 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/errored/error-svg/index.d.ts +2 -6
- package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/ResolvedOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/index.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.d.ts +6 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.d.ts +2 -6
- package/package.json +2 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
8
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
9
|
+
import { Box } from '@atlaskit/primitives';
|
|
10
|
+
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize } from '../../../../../../constants';
|
|
11
|
+
import { LinkIcon } from '../../../elements';
|
|
12
|
+
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
|
|
13
|
+
import Block from '../../block';
|
|
14
|
+
import ElementGroup from '../../element-group';
|
|
15
|
+
const actionStyles = css({
|
|
16
|
+
cursor: 'pointer',
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
18
|
+
':hover': {
|
|
19
|
+
color: "var(--ds-text-subtle, #8993A4)",
|
|
20
|
+
textDecoration: 'underline'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const actionHoverStyles = css({
|
|
24
|
+
position: 'relative',
|
|
25
|
+
zIndex: 1,
|
|
26
|
+
'&:focus': {
|
|
27
|
+
outlineOffset: "var(--ds-space-negative-025, -2px)"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* This function does not work in the component below as it needs to be xcss.
|
|
33
|
+
* The component instead uses inherited styles
|
|
34
|
+
*/
|
|
35
|
+
const getMessageStyles = (size, hasAction) => {
|
|
36
|
+
const sizeStyles = getLinkSizeStyles(size);
|
|
37
|
+
return css({
|
|
38
|
+
flex: '1 1 auto',
|
|
39
|
+
justifyContent: 'flex-end'
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
42
|
+
hasAction ? actionStyles : '',
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
44
|
+
sizeStyles,
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
46
|
+
getTruncateStyles(1, getLinkLineHeight(size)), {
|
|
47
|
+
color: "var(--ds-text-disabled, #6B778C)",
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
49
|
+
':focus': {
|
|
50
|
+
outline: `${"var(--ds-border-focused, #388BFF)"} solid 2px`
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
54
|
+
hasAction ? actionHoverStyles : '');
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Represents an Errored TitleBlock view.
|
|
59
|
+
* This will render when a Smart Link did not successfully resolve.
|
|
60
|
+
* This may be a result of a Smart Link not having the correct credentials,
|
|
61
|
+
* or the backend response was errored or malformed.
|
|
62
|
+
* @see TitleBlock
|
|
63
|
+
*/
|
|
64
|
+
const TitleBlockErroredView = ({
|
|
65
|
+
actionGroup,
|
|
66
|
+
retry,
|
|
67
|
+
position,
|
|
68
|
+
testId,
|
|
69
|
+
title,
|
|
70
|
+
icon,
|
|
71
|
+
hideIcon,
|
|
72
|
+
...blockProps
|
|
73
|
+
}) => {
|
|
74
|
+
const {
|
|
75
|
+
descriptor,
|
|
76
|
+
onClick,
|
|
77
|
+
values
|
|
78
|
+
} = retry || {};
|
|
79
|
+
const {
|
|
80
|
+
size = SmartLinkSize.Medium
|
|
81
|
+
} = blockProps;
|
|
82
|
+
const hasAction = onClick !== undefined;
|
|
83
|
+
return jsx(Block, _extends({}, blockProps, {
|
|
84
|
+
testId: `${testId}-errored-view`
|
|
85
|
+
}), !hideIcon && jsx(LinkIcon, {
|
|
86
|
+
overrideIcon: icon,
|
|
87
|
+
position: position
|
|
88
|
+
}), title, descriptor && jsx(ElementGroup, {
|
|
89
|
+
direction: SmartLinkDirection.Horizontal,
|
|
90
|
+
align: SmartLinkAlignment.Right
|
|
91
|
+
}, jsx(Box
|
|
92
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
93
|
+
, {
|
|
94
|
+
xcss: getMessageStyles(size, hasAction),
|
|
95
|
+
onClick: onClick,
|
|
96
|
+
testId: `${testId}-errored-view-message`,
|
|
97
|
+
tabIndex: hasAction ? 0 : -1
|
|
98
|
+
}, jsx(FormattedMessage, _extends({}, descriptor, {
|
|
99
|
+
values: values
|
|
100
|
+
})))), actionGroup);
|
|
101
|
+
};
|
|
102
|
+
export default TitleBlockErroredView;
|
|
@@ -1,53 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { css, jsx } from '@emotion/react';
|
|
2
|
+
import React from 'react';
|
|
8
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
4
|
import { Box } from '@atlaskit/primitives';
|
|
10
|
-
import { SmartLinkAlignment, SmartLinkDirection
|
|
5
|
+
import { SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
11
6
|
import { LinkIcon } from '../../../elements';
|
|
12
|
-
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
|
|
13
7
|
import Block from '../../block';
|
|
14
8
|
import ElementGroup from '../../element-group';
|
|
15
|
-
|
|
16
|
-
cursor: 'pointer',
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
18
|
-
':hover': {
|
|
19
|
-
color: "var(--ds-text-subtle, #8993A4)",
|
|
20
|
-
textDecoration: 'underline'
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const actionHoverStyles = css({
|
|
24
|
-
position: 'relative',
|
|
25
|
-
zIndex: 1,
|
|
26
|
-
'&:focus': {
|
|
27
|
-
outlineOffset: "var(--ds-space-negative-025, -2px)"
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const getMessageStyles = (size, hasAction) => {
|
|
31
|
-
const sizeStyles = getLinkSizeStyles(size);
|
|
32
|
-
return css({
|
|
33
|
-
flex: '1 1 auto',
|
|
34
|
-
justifyContent: 'flex-end'
|
|
35
|
-
},
|
|
36
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
37
|
-
hasAction ? actionStyles : '',
|
|
38
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
39
|
-
sizeStyles,
|
|
40
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
41
|
-
getTruncateStyles(1, getLinkLineHeight(size)), {
|
|
42
|
-
color: "var(--ds-text-disabled, #6B778C)",
|
|
43
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
44
|
-
':focus': {
|
|
45
|
-
outline: `${"var(--ds-border-focused, #388BFF)"} solid 2px`
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
49
|
-
hasAction ? actionHoverStyles : '');
|
|
50
|
-
};
|
|
9
|
+
import TitleBlockErroredViewOld from './TitleBlockErroredViewOld';
|
|
51
10
|
|
|
52
11
|
/**
|
|
53
12
|
* Represents an Errored TitleBlock view.
|
|
@@ -56,7 +15,7 @@ const getMessageStyles = (size, hasAction) => {
|
|
|
56
15
|
* or the backend response was errored or malformed.
|
|
57
16
|
* @see TitleBlock
|
|
58
17
|
*/
|
|
59
|
-
const
|
|
18
|
+
const TitleBlockErroredViewNew = ({
|
|
60
19
|
actionGroup,
|
|
61
20
|
retry,
|
|
62
21
|
position,
|
|
@@ -71,27 +30,22 @@ const TitleBlockErroredView = ({
|
|
|
71
30
|
onClick,
|
|
72
31
|
values
|
|
73
32
|
} = retry || {};
|
|
74
|
-
const {
|
|
75
|
-
size = SmartLinkSize.Medium
|
|
76
|
-
} = blockProps;
|
|
77
33
|
const hasAction = onClick !== undefined;
|
|
78
|
-
return
|
|
34
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
79
35
|
testId: `${testId}-errored-view`
|
|
80
|
-
}), !hideIcon &&
|
|
36
|
+
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
81
37
|
overrideIcon: icon,
|
|
82
38
|
position: position
|
|
83
|
-
}), title, descriptor &&
|
|
39
|
+
}), title, descriptor && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
84
40
|
direction: SmartLinkDirection.Horizontal,
|
|
85
41
|
align: SmartLinkAlignment.Right
|
|
86
|
-
},
|
|
87
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
88
|
-
, {
|
|
89
|
-
xcss: getMessageStyles(size, hasAction),
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
90
43
|
onClick: onClick,
|
|
91
44
|
testId: `${testId}-errored-view-message`,
|
|
92
45
|
tabIndex: hasAction ? 0 : -1
|
|
93
|
-
},
|
|
46
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
|
|
94
47
|
values: values
|
|
95
48
|
})))), actionGroup);
|
|
96
49
|
};
|
|
97
|
-
export default
|
|
50
|
+
export default TitleBlockErroredViewOld;
|
|
51
|
+
export { TitleBlockErroredViewNew };
|
|
@@ -1,43 +1,34 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { useCallback, useState } from 'react';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
8
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
7
9
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
8
10
|
import { Title } from '../../elements';
|
|
9
11
|
import ActionGroup from '../action-group';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
17
|
-
'.actions-button-group': {
|
|
18
|
-
opacity: 0
|
|
19
|
-
},
|
|
20
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
21
|
-
'&:hover .actions-button-group, .actions-button-group:focus-within': {
|
|
22
|
-
opacity: 1
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
};
|
|
12
|
+
import { TitleBlockErroredViewNew } from './errored';
|
|
13
|
+
import { TitleBlockResolvedViewNew } from './resolved';
|
|
14
|
+
import { TitleBlockResolvingViewNew } from './resolving';
|
|
15
|
+
import TitleBlockOld from './TitleBlockOld';
|
|
16
|
+
const styles = null;
|
|
17
|
+
const actionStyles = null;
|
|
27
18
|
const getTitleBlockViewComponent = status => {
|
|
28
19
|
switch (status) {
|
|
29
20
|
case SmartLinkStatus.Pending:
|
|
30
21
|
case SmartLinkStatus.Resolving:
|
|
31
|
-
return
|
|
22
|
+
return TitleBlockResolvingViewNew;
|
|
32
23
|
case SmartLinkStatus.Resolved:
|
|
33
|
-
return
|
|
24
|
+
return TitleBlockResolvedViewNew;
|
|
34
25
|
case SmartLinkStatus.Unauthorized:
|
|
35
26
|
case SmartLinkStatus.Forbidden:
|
|
36
27
|
case SmartLinkStatus.NotFound:
|
|
37
28
|
case SmartLinkStatus.Errored:
|
|
38
29
|
case SmartLinkStatus.Fallback:
|
|
39
30
|
default:
|
|
40
|
-
return
|
|
31
|
+
return TitleBlockErroredViewNew;
|
|
41
32
|
}
|
|
42
33
|
};
|
|
43
34
|
|
|
@@ -49,18 +40,17 @@ const getTitleBlockViewComponent = status => {
|
|
|
49
40
|
* @public
|
|
50
41
|
* @param {TitleBlockProps} TitleBlockProps
|
|
51
42
|
* @see Block
|
|
52
|
-
* @see
|
|
53
|
-
* @see
|
|
54
|
-
* @see
|
|
43
|
+
* @see TitleBlockResolvingViewNew
|
|
44
|
+
* @see TitleBlockResolvedViewNew
|
|
45
|
+
* @see TitleBlockErroredViewNew
|
|
55
46
|
*/
|
|
56
|
-
const
|
|
47
|
+
const TitleBlockNew = ({
|
|
57
48
|
actions = [],
|
|
58
49
|
anchorTarget,
|
|
59
50
|
hideTitleTooltip,
|
|
60
51
|
maxLines,
|
|
61
52
|
onActionMenuOpenChange,
|
|
62
53
|
onClick,
|
|
63
|
-
overrideCss,
|
|
64
54
|
status = SmartLinkStatus.Fallback,
|
|
65
55
|
showActionOnHover,
|
|
66
56
|
testId = 'smart-block-title',
|
|
@@ -70,6 +60,7 @@ const TitleBlock = ({
|
|
|
70
60
|
hideRetry,
|
|
71
61
|
metadataPosition,
|
|
72
62
|
hideIcon = false,
|
|
63
|
+
className,
|
|
73
64
|
...props
|
|
74
65
|
}) => {
|
|
75
66
|
if (hideRetry && props.retry) {
|
|
@@ -89,9 +80,6 @@ const TitleBlock = ({
|
|
|
89
80
|
visibleButtonsNum: showActionOnHover ? 1 : 2,
|
|
90
81
|
onDropdownOpenChange: onDropdownOpenChange
|
|
91
82
|
});
|
|
92
|
-
const actionStyles = getActionStyles(showActionOnHover, actionDropdownOpen);
|
|
93
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
94
|
-
const combinedCss = css(actionStyles, overrideCss);
|
|
95
83
|
const overrideText = !!text ? {
|
|
96
84
|
text
|
|
97
85
|
} : {};
|
|
@@ -105,14 +93,25 @@ const TitleBlock = ({
|
|
|
105
93
|
theme: theme
|
|
106
94
|
}, overrideText));
|
|
107
95
|
const Component = getTitleBlockViewComponent(status);
|
|
108
|
-
return /*#__PURE__*/React.createElement(
|
|
109
|
-
|
|
110
|
-
|
|
96
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: ax([showActionOnHover && !actionDropdownOpen && "_1bfhidpf _wn5xkb7n _h157kb7n"])
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
99
|
+
actionGroup: actionGroup
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
101
|
+
,
|
|
102
|
+
className: className,
|
|
111
103
|
testId: testId,
|
|
112
104
|
title: title,
|
|
113
105
|
metadataPosition: metadataPosition,
|
|
114
106
|
hideIcon: hideIcon,
|
|
115
107
|
icon: icon
|
|
116
|
-
}));
|
|
108
|
+
})));
|
|
109
|
+
};
|
|
110
|
+
const TitleBlock = props => {
|
|
111
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
112
|
+
return /*#__PURE__*/React.createElement(TitleBlockNew, props);
|
|
113
|
+
} else {
|
|
114
|
+
return /*#__PURE__*/React.createElement(TitleBlockOld, props);
|
|
115
|
+
}
|
|
117
116
|
};
|
|
118
117
|
export default TitleBlock;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
|
+
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkWidth } from '../../../../../../constants';
|
|
7
|
+
import { LinkIcon } from '../../../elements';
|
|
8
|
+
import Block from '../../block';
|
|
9
|
+
import ElementGroup from '../../element-group';
|
|
10
|
+
import { renderElementItems } from '../../utils';
|
|
11
|
+
/**
|
|
12
|
+
* This renders a fully resolved TitleBlock.
|
|
13
|
+
* This should render when a Smart Link returns a valid response.
|
|
14
|
+
* @see TitleBlock
|
|
15
|
+
*/
|
|
16
|
+
const TitleBlockResolvedView = ({
|
|
17
|
+
actionGroup,
|
|
18
|
+
metadata = [],
|
|
19
|
+
position,
|
|
20
|
+
subtitle = [],
|
|
21
|
+
testId,
|
|
22
|
+
text,
|
|
23
|
+
icon,
|
|
24
|
+
title,
|
|
25
|
+
metadataPosition,
|
|
26
|
+
hideIcon,
|
|
27
|
+
...blockProps
|
|
28
|
+
}) => {
|
|
29
|
+
const metadataElements = renderElementItems(metadata);
|
|
30
|
+
const subtitleElements = renderElementItems(subtitle);
|
|
31
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
32
|
+
testId: `${testId}-resolved-view`
|
|
33
|
+
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
34
|
+
overrideIcon: icon,
|
|
35
|
+
position: position
|
|
36
|
+
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
37
|
+
direction: SmartLinkDirection.Vertical,
|
|
38
|
+
width: SmartLinkWidth.Flexible,
|
|
39
|
+
overrideCss: css({
|
|
40
|
+
gap: "var(--ds-space-050, 0.25rem)"
|
|
41
|
+
})
|
|
42
|
+
}, title, subtitleElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
43
|
+
direction: SmartLinkDirection.Horizontal
|
|
44
|
+
}, subtitleElements)), metadataElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
45
|
+
direction: SmartLinkDirection.Horizontal,
|
|
46
|
+
align: SmartLinkAlignment.Right,
|
|
47
|
+
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center
|
|
48
|
+
}, metadataElements), actionGroup);
|
|
49
|
+
};
|
|
50
|
+
export default TitleBlockResolvedView;
|
package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._zulppdf9{gap:var(--ds-space-050,.25rem)}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkWidth } from '../../../../../../constants';
|
|
7
7
|
import { LinkIcon } from '../../../elements';
|
|
8
8
|
import Block from '../../block';
|
|
9
|
-
import ElementGroup from '../../element-group';
|
|
9
|
+
import { ElementGroupNew as ElementGroup } from '../../element-group';
|
|
10
10
|
import { renderElementItems } from '../../utils';
|
|
11
|
+
import TitleBlockResolvedViewOld from './TitleBlockResolvedViewOld';
|
|
12
|
+
const style = null;
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* This renders a fully resolved TitleBlock.
|
|
13
16
|
* This should render when a Smart Link returns a valid response.
|
|
14
17
|
* @see TitleBlock
|
|
15
18
|
*/
|
|
16
|
-
const
|
|
19
|
+
const TitleBlockResolvedViewNew = ({
|
|
17
20
|
actionGroup,
|
|
18
21
|
metadata = [],
|
|
19
22
|
position,
|
|
@@ -36,15 +39,16 @@ const TitleBlockResolvedView = ({
|
|
|
36
39
|
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
37
40
|
direction: SmartLinkDirection.Vertical,
|
|
38
41
|
width: SmartLinkWidth.Flexible,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
+
size: blockProps.size,
|
|
43
|
+
className: ax(["_zulppdf9"])
|
|
42
44
|
}, title, subtitleElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
43
45
|
direction: SmartLinkDirection.Horizontal
|
|
44
46
|
}, subtitleElements)), metadataElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
45
47
|
direction: SmartLinkDirection.Horizontal,
|
|
46
48
|
align: SmartLinkAlignment.Right,
|
|
47
|
-
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center
|
|
49
|
+
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center,
|
|
50
|
+
size: blockProps.size
|
|
48
51
|
}, metadataElements), actionGroup);
|
|
49
52
|
};
|
|
50
|
-
export default
|
|
53
|
+
export default TitleBlockResolvedViewOld;
|
|
54
|
+
export { TitleBlockResolvedViewNew };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { jsx } from '@emotion/react';
|
|
9
|
+
import { SmartLinkSize } from '../../../../../../constants';
|
|
10
|
+
import LoadingSkeleton from '../../../common/loading-skeleton';
|
|
11
|
+
import { getIconSizeStyles, getIconWidth } from '../../../utils';
|
|
12
|
+
import Block from '../../block';
|
|
13
|
+
/**
|
|
14
|
+
* This represents a TitleBlock for a Smart Link that is currently waiting
|
|
15
|
+
* for a request to finish.
|
|
16
|
+
* This should render when a Smart Link has sent a request.
|
|
17
|
+
* @see TitleBlock
|
|
18
|
+
*/
|
|
19
|
+
const TitleBlockResolvingView = ({
|
|
20
|
+
actionGroup,
|
|
21
|
+
testId,
|
|
22
|
+
title,
|
|
23
|
+
hideIcon,
|
|
24
|
+
...blockProps
|
|
25
|
+
}) => {
|
|
26
|
+
const {
|
|
27
|
+
size = SmartLinkSize.Medium
|
|
28
|
+
} = blockProps;
|
|
29
|
+
const iconWidth = getIconWidth(size);
|
|
30
|
+
const iconStyles = getIconSizeStyles(iconWidth);
|
|
31
|
+
return jsx(Block, _extends({}, blockProps, {
|
|
32
|
+
testId: `${testId}-resolving-view`
|
|
33
|
+
}), !hideIcon &&
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
35
|
+
jsx("span", {
|
|
36
|
+
css: iconStyles,
|
|
37
|
+
"data-testid": `${testId}-icon`
|
|
38
|
+
}, jsx(LoadingSkeleton, {
|
|
39
|
+
testId: `${testId}-icon-loading`
|
|
40
|
+
})), title, actionGroup);
|
|
41
|
+
};
|
|
42
|
+
export default TitleBlockResolvingView;
|
package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
._16jlidpf{flex-grow:0}
|
|
2
|
+
._19l31j6v img, ._1pr21j6v span, ._1u5t1j6v svg{max-height:1rem}
|
|
3
|
+
._19l31k8s img, ._1pr21k8s span, ._1u5t1k8s svg{max-height:1.5rem}
|
|
4
|
+
._19l3oqnp img, ._1pr2oqnp span, ._1u5toqnp svg{max-height:.75rem}
|
|
5
|
+
._19l3viql img, ._1pr2viql span, ._1u5tviql svg{max-height:2rem}
|
|
6
|
+
._1bsb1j6v{width:1rem}
|
|
7
|
+
._1bsb1k8s{width:1.5rem}
|
|
8
|
+
._1bsboqnp{width:.75rem}
|
|
9
|
+
._1bsbviql{width:2rem}
|
|
10
|
+
._1o9zidpf{flex-shrink:0}
|
|
11
|
+
._1rg21j6v img, ._q7cv1j6v span, ._xwbj1j6v svg{min-width:1rem}
|
|
12
|
+
._1rg21k8s img, ._q7cv1k8s span, ._xwbj1k8s svg{min-width:1.5rem}
|
|
13
|
+
._1rg2oqnp img, ._q7cvoqnp span, ._xwbjoqnp svg{min-width:.75rem}
|
|
14
|
+
._1rg2viql img, ._q7cvviql span, ._xwbjviql svg{min-width:2rem}
|
|
15
|
+
._1tke1j6v{min-height:1rem}
|
|
16
|
+
._1tke1k8s{min-height:1.5rem}
|
|
17
|
+
._1tkeoqnp{min-height:.75rem}
|
|
18
|
+
._1tkeviql{min-height:2rem}
|
|
19
|
+
._1ul91j6v{min-width:1rem}
|
|
20
|
+
._1ul91k8s{min-width:1.5rem}
|
|
21
|
+
._1ul9oqnp{min-width:.75rem}
|
|
22
|
+
._1ul9viql{min-width:2rem}
|
|
23
|
+
._4t3i1j6v{height:1rem}
|
|
24
|
+
._4t3i1k8s{height:1.5rem}
|
|
25
|
+
._4t3ioqnp{height:.75rem}
|
|
26
|
+
._4t3iviql{height:2rem}
|
|
27
|
+
._5jw9idpf svg{padding-bottom:0}
|
|
28
|
+
._7wy9idpf svg{padding-left:0}
|
|
29
|
+
._bna71j6v img, ._1xjx1j6v span, ._17521j6v svg{height:1rem}
|
|
30
|
+
._bna71k8s img, ._1xjx1k8s span, ._17521k8s svg{height:1.5rem}
|
|
31
|
+
._bna7oqnp img, ._1xjxoqnp span, ._1752oqnp svg{height:.75rem}
|
|
32
|
+
._bna7viql img, ._1xjxviql span, ._1752viql svg{height:2rem}
|
|
33
|
+
._c71l1j6v{max-height:1rem}
|
|
34
|
+
._c71l1k8s{max-height:1.5rem}
|
|
35
|
+
._c71loqnp{max-height:.75rem}
|
|
36
|
+
._c71lviql{max-height:2rem}
|
|
37
|
+
._i0dl1wug{flex-basis:auto}
|
|
38
|
+
._i2i3idpf svg{padding-top:0}
|
|
39
|
+
._mezj1j6v img, ._e2oo1j6v span, ._w8l51j6v svg{width:1rem}
|
|
40
|
+
._mezj1k8s img, ._e2oo1k8s span, ._w8l51k8s svg{width:1.5rem}
|
|
41
|
+
._mezjoqnp img, ._e2oooqnp span, ._w8l5oqnp svg{width:.75rem}
|
|
42
|
+
._mezjviql img, ._e2ooviql span, ._w8l5viql svg{width:2rem}
|
|
43
|
+
._p12f1j6v{max-width:1rem}
|
|
44
|
+
._p12f1k8s{max-width:1.5rem}
|
|
45
|
+
._p12foqnp{max-width:.75rem}
|
|
46
|
+
._p12fviql{max-width:2rem}
|
|
47
|
+
._qci81j6v img, ._15iz1j6v span, ._erub1j6v svg{min-height:1rem}
|
|
48
|
+
._qci81k8s img, ._15iz1k8s span, ._erub1k8s svg{min-height:1.5rem}
|
|
49
|
+
._qci8oqnp img, ._15izoqnp span, ._eruboqnp svg{min-height:.75rem}
|
|
50
|
+
._qci8viql img, ._15izviql span, ._erubviql svg{min-height:2rem}
|
|
51
|
+
._rtys1j6v img, ._b8nk1j6v span, ._4x201j6v svg{max-width:1rem}
|
|
52
|
+
._rtys1k8s img, ._b8nk1k8s span, ._4x201k8s svg{max-width:1.5rem}
|
|
53
|
+
._rtysoqnp img, ._b8nkoqnp span, ._4x20oqnp svg{max-width:.75rem}
|
|
54
|
+
._rtysviql img, ._b8nkviql span, ._4x20viql svg{max-width:2rem}
|
|
55
|
+
._uhasidpf svg{padding-right:0}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
6
7
|
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
9
8
|
import { SmartLinkSize } from '../../../../../../constants';
|
|
10
9
|
import LoadingSkeleton from '../../../common/loading-skeleton';
|
|
11
|
-
import { getIconSizeStyles, getIconWidth } from '../../../utils';
|
|
12
10
|
import Block from '../../block';
|
|
11
|
+
import TitleBlockResolvingViewOld from './TitleBlockResolvingViewOld';
|
|
12
|
+
const iconStyle = {
|
|
13
|
+
'xlarge': "_16jlidpf _1o9zidpf _i0dl1wug _4t3iviql _1tkeviql _c71lviql _1bsbviql _1ul9viql _p12fviql _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna7viql _1xjxviql _1752viql _qci8viql _15izviql _erubviql _19l3viql _1pr2viql _1u5tviql _mezjviql _e2ooviql _w8l5viql _1rg2viql _q7cvviql _xwbjviql _rtysviql _b8nkviql _4x20viql",
|
|
14
|
+
'large': "_16jlidpf _1o9zidpf _i0dl1wug _4t3i1k8s _1tke1k8s _c71l1k8s _1bsb1k8s _1ul91k8s _p12f1k8s _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna71k8s _1xjx1k8s _17521k8s _qci81k8s _15iz1k8s _erub1k8s _19l31k8s _1pr21k8s _1u5t1k8s _mezj1k8s _e2oo1k8s _w8l51k8s _1rg21k8s _q7cv1k8s _xwbj1k8s _rtys1k8s _b8nk1k8s _4x201k8s",
|
|
15
|
+
'medium': "_16jlidpf _1o9zidpf _i0dl1wug _4t3i1j6v _1tke1j6v _c71l1j6v _1bsb1j6v _1ul91j6v _p12f1j6v _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna71j6v _1xjx1j6v _17521j6v _qci81j6v _15iz1j6v _erub1j6v _19l31j6v _1pr21j6v _1u5t1j6v _mezj1j6v _e2oo1j6v _w8l51j6v _1rg21j6v _q7cv1j6v _xwbj1j6v _rtys1j6v _b8nk1j6v _4x201j6v",
|
|
16
|
+
'small': "_16jlidpf _1o9zidpf _i0dl1wug _4t3ioqnp _1tkeoqnp _c71loqnp _1bsboqnp _1ul9oqnp _p12foqnp _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna7oqnp _1xjxoqnp _1752oqnp _qci8oqnp _15izoqnp _eruboqnp _19l3oqnp _1pr2oqnp _1u5toqnp _mezjoqnp _e2oooqnp _w8l5oqnp _1rg2oqnp _q7cvoqnp _xwbjoqnp _rtysoqnp _b8nkoqnp _4x20oqnp"
|
|
17
|
+
};
|
|
13
18
|
/**
|
|
14
19
|
* This represents a TitleBlock for a Smart Link that is currently waiting
|
|
15
20
|
* for a request to finish.
|
|
16
21
|
* This should render when a Smart Link has sent a request.
|
|
17
22
|
* @see TitleBlock
|
|
18
23
|
*/
|
|
19
|
-
const
|
|
24
|
+
const TitleBlockResolvingViewNew = ({
|
|
20
25
|
actionGroup,
|
|
21
26
|
testId,
|
|
22
27
|
title,
|
|
@@ -26,17 +31,14 @@ const TitleBlockResolvingView = ({
|
|
|
26
31
|
const {
|
|
27
32
|
size = SmartLinkSize.Medium
|
|
28
33
|
} = blockProps;
|
|
29
|
-
|
|
30
|
-
const iconStyles = getIconSizeStyles(iconWidth);
|
|
31
|
-
return jsx(Block, _extends({}, blockProps, {
|
|
34
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
32
35
|
testId: `${testId}-resolving-view`
|
|
33
|
-
}), !hideIcon &&
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"data-testid": `${testId}-icon`
|
|
38
|
-
}, jsx(LoadingSkeleton, {
|
|
36
|
+
}), !hideIcon && /*#__PURE__*/React.createElement("span", {
|
|
37
|
+
"data-testid": `${testId}-icon`,
|
|
38
|
+
className: ax([iconStyle[size]])
|
|
39
|
+
}, /*#__PURE__*/React.createElement(LoadingSkeleton, {
|
|
39
40
|
testId: `${testId}-icon-loading`
|
|
40
41
|
})), title, actionGroup);
|
|
41
42
|
};
|
|
42
|
-
export default
|
|
43
|
+
export default TitleBlockResolvingViewOld;
|
|
44
|
+
export { TitleBlockResolvingViewNew };
|
|
@@ -3,10 +3,12 @@ import Loadable from 'react-loadable';
|
|
|
3
3
|
import DocumentIcon from '@atlaskit/icon-file-type/glyph/document/16';
|
|
4
4
|
import BlogIcon from '@atlaskit/icon-object/glyph/blog/16';
|
|
5
5
|
import { ConfluenceIcon, JiraIcon } from '@atlaskit/logo';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { R400 } from '@atlaskit/theme/colors';
|
|
7
8
|
import { IconType } from '../../../../../constants';
|
|
9
|
+
import { getLazyIcons } from '../../../../../utils';
|
|
8
10
|
// prettier-ignore
|
|
9
|
-
const
|
|
11
|
+
const importIconMapperOld = {
|
|
10
12
|
[IconType.Archive]: () => import( /* webpackChunkName: "glyphArchive" */'@atlaskit/icon-file-type/glyph/archive/16'),
|
|
11
13
|
[IconType.Audio]: () => import( /* webpackChunkName: "glyphAudio" */'@atlaskit/icon-file-type/glyph/audio/16'),
|
|
12
14
|
[IconType.Code]: () => import( /* webpackChunkName: "glyphCode" */'@atlaskit/icon-file-type/glyph/source-code/16'),
|
|
@@ -82,7 +84,12 @@ const importIconMapper = {
|
|
|
82
84
|
[IconType.Subscriber]: () => import( /* webpackChunkName: "glyphSubscriber" */'@atlaskit/icon/glyph/people'),
|
|
83
85
|
[IconType.SubTasksProgress]: () => import( /* webpackChunkName: "glyphSubtaskProgress" */'@atlaskit/icon/glyph/subtask')
|
|
84
86
|
};
|
|
85
|
-
const getIconImportFn = icon =>
|
|
87
|
+
const getIconImportFn = icon => {
|
|
88
|
+
if (fg('platform-smart-card-icon-migration')) {
|
|
89
|
+
return getLazyIcons()[icon];
|
|
90
|
+
}
|
|
91
|
+
return importIconMapperOld[icon];
|
|
92
|
+
};
|
|
86
93
|
const importIcon = importFn => {
|
|
87
94
|
return Loadable({
|
|
88
95
|
loader: () => importFn().then(module => module.default),
|
|
@@ -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.
|
|
13
|
+
packageVersion: "34.4.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|