@atlaskit/smart-card 34.3.0 → 34.5.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 +24 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +204 -264
- 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/metadata-block/MetadataBlockOld.js +85 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +39 -29
- 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 +74 -56
- 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/metadata-block/MetadataBlockOld.js +75 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +29 -24
- 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 +119 -163
- 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/metadata-block/MetadataBlockOld.js +80 -0
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +29 -24
- 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 +4 -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/metadata-block/MetadataBlockOld.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +2 -9
- 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 +4 -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/metadata-block/MetadataBlockOld.d.ts +11 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +2 -9
- 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 +5 -2
|
@@ -1,92 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
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 { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkWidth } from '../../../../../constants';
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return css({
|
|
14
|
-
WebkitBoxAlign: 'end',
|
|
15
|
-
MsFlexAlign: 'end',
|
|
16
|
-
justifyContent: 'flex-end',
|
|
17
|
-
textAlign: 'right'
|
|
18
|
-
});
|
|
19
|
-
case SmartLinkAlignment.Left:
|
|
20
|
-
default:
|
|
21
|
-
return css({
|
|
22
|
-
WebkitBoxAlign: 'start',
|
|
23
|
-
MsFlexAlign: 'start',
|
|
24
|
-
justifyContent: 'flex-start',
|
|
25
|
-
textAlign: 'left'
|
|
26
|
-
});
|
|
27
|
-
}
|
|
6
|
+
import { renderChildren } from '../utils';
|
|
7
|
+
import ElementGroupOld from './ElementGroupOld';
|
|
8
|
+
const alignmentStyleMap = {
|
|
9
|
+
right: "_1dthh9n0 _r291h9n0 _1bahesu3 _y3gnusic",
|
|
10
|
+
left: "_1dthv2br _r291v2br _1bah1y6m _y3gn1e5h"
|
|
28
11
|
};
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'> span': {
|
|
35
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
36
|
-
marginLeft: `${gap}rem`
|
|
37
|
-
},
|
|
38
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
39
|
-
'> span:first-child': {
|
|
40
|
-
marginLeft: 'initial'
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return css({
|
|
45
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
46
|
-
'> span': {
|
|
47
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
48
|
-
marginRight: `${gap}rem`,
|
|
49
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
50
|
-
'&:last-child': {
|
|
51
|
-
marginRight: 'initial'
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
12
|
+
const baseStyleBySize = {
|
|
13
|
+
xlarge: "_zulp147b _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
14
|
+
large: "_zulp1e9d _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
15
|
+
medium: "_zulpcxkx _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
16
|
+
small: "_zulppdf9 _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf"
|
|
55
17
|
};
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
18
|
+
const baseStyleByDirection = {
|
|
19
|
+
horizontal: "_2lx2vrvc _4cvr1h6o",
|
|
20
|
+
vertical: "_2lx21bp4 _4cvr1y6m"
|
|
21
|
+
};
|
|
22
|
+
const baseStyle = null;
|
|
23
|
+
const widthStyle = {
|
|
24
|
+
flexible: "_16jlkb7n _1o9z11wp _i0dlf1ug",
|
|
25
|
+
'fit-to-content': ""
|
|
26
|
+
};
|
|
27
|
+
const positionStyle = {
|
|
28
|
+
top: "_1wpz1y6m",
|
|
29
|
+
center: ""
|
|
30
|
+
};
|
|
31
|
+
const horizontalStyleBase = null;
|
|
32
|
+
const horizontalStyleByHeight = {
|
|
33
|
+
xlarge: "_1e0ccj1k _102k1m1q",
|
|
34
|
+
large: "_1e0ccj1k _102k1m1q",
|
|
35
|
+
medium: "_1e0ccj1k _102k1k8s",
|
|
36
|
+
small: "_1e0ccj1k _102k1k8s"
|
|
37
|
+
};
|
|
38
|
+
const gapStylesLeft = {
|
|
39
|
+
xlarge: "_7yhb147b _m6ukidpf",
|
|
40
|
+
large: "_7yhb1e9d _m6ukidpf",
|
|
41
|
+
medium: "_7yhbcxkx _m6ukidpf",
|
|
42
|
+
small: "_7yhbpdf9 _m6ukidpf"
|
|
43
|
+
};
|
|
44
|
+
const gapStylesRight = {
|
|
45
|
+
xlarge: "_24rc147b _3dveidpf",
|
|
46
|
+
large: "_24rc1e9d _3dveidpf",
|
|
47
|
+
medium: "_24rccxkx _3dveidpf",
|
|
48
|
+
small: "_24rcpdf9 _3dveidpf"
|
|
76
49
|
};
|
|
77
|
-
export const getElementGroupStyles = (direction, size, align, width, position) => css(
|
|
78
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
79
|
-
getBaseStyles(direction, size),
|
|
80
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
81
|
-
getAlignmentStyles(align), {
|
|
82
|
-
minWidth: '10%'
|
|
83
|
-
},
|
|
84
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
85
|
-
width === SmartLinkWidth.Flexible ? `flex: 1 3;` : '',
|
|
86
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
87
|
-
direction === SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : '',
|
|
88
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
89
|
-
position === SmartLinkPosition.Top ? 'align-self: flex-start;' : '');
|
|
90
50
|
|
|
91
51
|
/**
|
|
92
52
|
* Creates a group of Action components. Accepts an array of Actions, in addition to some styling
|
|
@@ -95,19 +55,24 @@ position === SmartLinkPosition.Top ? 'align-self: flex-start;' : '');
|
|
|
95
55
|
* @param {ActionGroupProps} ActionGroupProps
|
|
96
56
|
* @see Action
|
|
97
57
|
*/
|
|
98
|
-
const
|
|
58
|
+
const ElementGroupNew = ({
|
|
99
59
|
align = SmartLinkAlignment.Left,
|
|
100
60
|
children,
|
|
101
|
-
overrideCss,
|
|
102
61
|
direction = SmartLinkDirection.Horizontal,
|
|
103
62
|
size = SmartLinkSize.Medium,
|
|
104
63
|
testId = 'smart-element-group',
|
|
105
64
|
width = SmartLinkWidth.FitToContent,
|
|
106
|
-
position = SmartLinkPosition.Center
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
65
|
+
position = SmartLinkPosition.Center,
|
|
66
|
+
className
|
|
67
|
+
}) => {
|
|
68
|
+
const totalCss = [baseStyleBySize[size], baseStyleByDirection[direction], baseStyle, alignmentStyleMap[align], null, widthStyle[width], direction === SmartLinkDirection.Horizontal ? horizontalStyleBase : {}, direction === SmartLinkDirection.Horizontal ? horizontalStyleByHeight[size] : {}, direction === SmartLinkDirection.Horizontal ? SmartLinkAlignment.Left ? gapStylesLeft[size] : gapStylesRight[size] : {}, positionStyle[position]];
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
"data-smart-element-group": true,
|
|
71
|
+
"data-testid": testId
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
73
|
+
,
|
|
74
|
+
className: ax([baseStyleBySize[size], baseStyleByDirection[direction], "_fiawglyw _1ouwidpf _f6ju1ns9", alignmentStyleMap[align], "_1ul99by0", widthStyle[width], direction === SmartLinkDirection.Horizontal && "_1reo15vq _18m915vq _1e0c1ule _s7n4nkob _1bto1l2s _1nmz1hna _1yyjkb7n _sudp1e54 _1aaynkob _15tynkob _1iu61nu9 _166k1nu9 _1div1nu9 _bmfb1nu9", direction === SmartLinkDirection.Horizontal && "", SmartLinkAlignment.Left ? gapStylesLeft[size] : gapStylesRight[size], positionStyle[position], className])
|
|
75
|
+
}, renderChildren(children, size));
|
|
76
|
+
};
|
|
77
|
+
export default ElementGroupOld;
|
|
78
|
+
export { ElementGroupNew };
|
|
@@ -0,0 +1,75 @@
|
|
|
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, SmartLinkSize, SmartLinkStatus, SmartLinkWidth } from '../../../../../constants';
|
|
7
|
+
import { getMaxLineHeight, getTruncateStyles } from '../../utils';
|
|
8
|
+
import Block from '../block';
|
|
9
|
+
import ElementGroup from '../element-group';
|
|
10
|
+
import { renderElementItems } from '../utils';
|
|
11
|
+
const DEFAULT_MAX_LINES = 2;
|
|
12
|
+
const MAXIMUM_MAX_LINES = 2;
|
|
13
|
+
const MINIMUM_MAX_LINES = 1;
|
|
14
|
+
const getElementGroupStyles = (size, maxLines) => {
|
|
15
|
+
// MetadataBlock allows metadata elements to be displayed in
|
|
16
|
+
// multiple lines, with maximum of 2 lines.
|
|
17
|
+
// We need the height of the line to be equal on both left and right
|
|
18
|
+
// sides so they line up nicely.
|
|
19
|
+
const lineHeight = getMaxLineHeight(size);
|
|
20
|
+
return css({
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
22
|
+
lineHeight: `${lineHeight}rem`
|
|
23
|
+
},
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
|
+
getTruncateStyles(maxLines, lineHeight + 'rem'));
|
|
26
|
+
};
|
|
27
|
+
const getMaxLines = maxLines => {
|
|
28
|
+
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
29
|
+
return DEFAULT_MAX_LINES;
|
|
30
|
+
}
|
|
31
|
+
if (maxLines < MINIMUM_MAX_LINES) {
|
|
32
|
+
return MINIMUM_MAX_LINES;
|
|
33
|
+
}
|
|
34
|
+
return maxLines;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
|
|
39
|
+
* Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
|
|
40
|
+
* @public
|
|
41
|
+
* @param {MetadataBlockProps} MetadataBlockProps
|
|
42
|
+
* @see Block
|
|
43
|
+
*/
|
|
44
|
+
const MetadataBlockOld = ({
|
|
45
|
+
maxLines = DEFAULT_MAX_LINES,
|
|
46
|
+
status = SmartLinkStatus.Fallback,
|
|
47
|
+
testId = 'smart-block-metadata',
|
|
48
|
+
primary = [],
|
|
49
|
+
secondary = [],
|
|
50
|
+
...blockProps
|
|
51
|
+
}) => {
|
|
52
|
+
if (primary.length === 0 && secondary.length === 0 || status !== SmartLinkStatus.Resolved) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const primaryElements = renderElementItems(primary);
|
|
56
|
+
const secondaryElements = renderElementItems(secondary);
|
|
57
|
+
const {
|
|
58
|
+
size = SmartLinkSize.Medium
|
|
59
|
+
} = blockProps;
|
|
60
|
+
const elementGroupStyles = getElementGroupStyles(size, getMaxLines(maxLines));
|
|
61
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
62
|
+
testId: `${testId}-resolved-view`
|
|
63
|
+
}), primaryElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
64
|
+
align: SmartLinkAlignment.Left,
|
|
65
|
+
overrideCss: elementGroupStyles,
|
|
66
|
+
direction: SmartLinkDirection.Horizontal,
|
|
67
|
+
width: SmartLinkWidth.Flexible
|
|
68
|
+
}, primaryElements), secondaryElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
69
|
+
align: SmartLinkAlignment.Right,
|
|
70
|
+
overrideCss: elementGroupStyles,
|
|
71
|
+
direction: SmartLinkDirection.Horizontal,
|
|
72
|
+
width: SmartLinkWidth.Flexible
|
|
73
|
+
}, secondaryElements));
|
|
74
|
+
};
|
|
75
|
+
export default MetadataBlockOld;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._18m915vq{overflow-y:hidden}
|
|
3
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
4
|
+
._1e0ccj1k{display:-webkit-box}
|
|
5
|
+
._1nmz1hna{word-break:break-word}
|
|
6
|
+
._1reo15vq{overflow-x:hidden}
|
|
7
|
+
._1yyjcs5v{-webkit-line-clamp:2}
|
|
8
|
+
._1yyjkb7n{-webkit-line-clamp:1}
|
|
9
|
+
._sudp1e54{-webkit-box-orient:vertical}
|
|
10
|
+
@supports not (-webkit-line-clamp:1){._102k1k7u{max-height:3.5rem}._102k1wto{max-height:3rem}}
|
|
@@ -1,28 +1,26 @@
|
|
|
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 { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkStatus, SmartLinkWidth } from '../../../../../constants';
|
|
7
|
-
import { getMaxLineHeight, getTruncateStyles } from '../../utils';
|
|
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 MetadataBlockOld from './MetadataBlockOld';
|
|
11
12
|
const DEFAULT_MAX_LINES = 2;
|
|
12
13
|
const MAXIMUM_MAX_LINES = 2;
|
|
13
14
|
const MINIMUM_MAX_LINES = 1;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
|
-
getTruncateStyles(maxLines, lineHeight + 'rem'));
|
|
15
|
+
const truncateStyles = {
|
|
16
|
+
'1': "_1reo15vq _18m915vq _1e0ccj1k _1bto1l2s _1nmz1hna _1yyjkb7n _sudp1e54",
|
|
17
|
+
'2': "_1reo15vq _18m915vq _1e0ccj1k _1bto1l2s _1nmz1hna _1yyjcs5v _sudp1e54"
|
|
18
|
+
};
|
|
19
|
+
const sizeStyles = {
|
|
20
|
+
xlarge: "_11c81oud _102k1k7u",
|
|
21
|
+
large: "_11c81oud _102k1k7u",
|
|
22
|
+
medium: "_11c81oud _102k1wto",
|
|
23
|
+
small: "_11c81oud _102k1wto"
|
|
26
24
|
};
|
|
27
25
|
const getMaxLines = maxLines => {
|
|
28
26
|
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
@@ -57,19 +55,26 @@ const MetadataBlock = ({
|
|
|
57
55
|
const {
|
|
58
56
|
size = SmartLinkSize.Medium
|
|
59
57
|
} = blockProps;
|
|
60
|
-
const
|
|
58
|
+
const maxLinesTotal = getMaxLines(maxLines);
|
|
61
59
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
62
60
|
testId: `${testId}-resolved-view`
|
|
63
61
|
}), primaryElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
64
62
|
align: SmartLinkAlignment.Left,
|
|
65
|
-
overrideCss: elementGroupStyles,
|
|
66
63
|
direction: SmartLinkDirection.Horizontal,
|
|
67
|
-
width: SmartLinkWidth.Flexible
|
|
64
|
+
width: SmartLinkWidth.Flexible,
|
|
65
|
+
className: ax([truncateStyles[maxLinesTotal], sizeStyles[size]])
|
|
68
66
|
}, primaryElements), secondaryElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
69
67
|
align: SmartLinkAlignment.Right,
|
|
70
|
-
overrideCss: elementGroupStyles,
|
|
71
68
|
direction: SmartLinkDirection.Horizontal,
|
|
72
|
-
width: SmartLinkWidth.Flexible
|
|
69
|
+
width: SmartLinkWidth.Flexible,
|
|
70
|
+
className: ax([truncateStyles[maxLinesTotal], sizeStyles[size]])
|
|
73
71
|
}, secondaryElements));
|
|
74
72
|
};
|
|
75
|
-
|
|
73
|
+
const MetadataBlockExported = props => {
|
|
74
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
75
|
+
return /*#__PURE__*/React.createElement(MetadataBlock, props);
|
|
76
|
+
} else {
|
|
77
|
+
return /*#__PURE__*/React.createElement(MetadataBlockOld, props);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export default MetadataBlockExported;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback, useState } 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 { SmartLinkStatus } from '../../../../../constants';
|
|
7
|
+
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
8
|
+
import { Title } from '../../elements';
|
|
9
|
+
import ActionGroup from '../action-group';
|
|
10
|
+
import TitleBlockErroredView from './errored';
|
|
11
|
+
import TitleBlockResolvedView from './resolved';
|
|
12
|
+
import TitleBlockResolvingView from './resolving';
|
|
13
|
+
const getActionStyles = (showOnHover, isOpen) => {
|
|
14
|
+
if (showOnHover && !isOpen) {
|
|
15
|
+
return css({
|
|
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
|
+
};
|
|
27
|
+
const getTitleBlockViewComponent = status => {
|
|
28
|
+
switch (status) {
|
|
29
|
+
case SmartLinkStatus.Pending:
|
|
30
|
+
case SmartLinkStatus.Resolving:
|
|
31
|
+
return TitleBlockResolvingView;
|
|
32
|
+
case SmartLinkStatus.Resolved:
|
|
33
|
+
return TitleBlockResolvedView;
|
|
34
|
+
case SmartLinkStatus.Unauthorized:
|
|
35
|
+
case SmartLinkStatus.Forbidden:
|
|
36
|
+
case SmartLinkStatus.NotFound:
|
|
37
|
+
case SmartLinkStatus.Errored:
|
|
38
|
+
case SmartLinkStatus.Fallback:
|
|
39
|
+
default:
|
|
40
|
+
return TitleBlockErroredView;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Represents a TitleBlock, which is the foundation of Flexible UI.
|
|
46
|
+
* This contains an icon, the link, and any associated metadata and actions in one block.
|
|
47
|
+
* The TitleBlock will also render differently given the state of the smart link.
|
|
48
|
+
* This can be found in the corresponding Resolving, Resolved and Errored views.
|
|
49
|
+
* @public
|
|
50
|
+
* @param {TitleBlockProps} TitleBlockProps
|
|
51
|
+
* @see Block
|
|
52
|
+
* @see TitleBlockResolvingView
|
|
53
|
+
* @see TitleBlockResolvedView
|
|
54
|
+
* @see TitleBlockErroredView
|
|
55
|
+
*/
|
|
56
|
+
const TitleBlock = ({
|
|
57
|
+
actions = [],
|
|
58
|
+
anchorTarget,
|
|
59
|
+
hideTitleTooltip,
|
|
60
|
+
maxLines,
|
|
61
|
+
onActionMenuOpenChange,
|
|
62
|
+
onClick,
|
|
63
|
+
overrideCss,
|
|
64
|
+
status = SmartLinkStatus.Fallback,
|
|
65
|
+
showActionOnHover,
|
|
66
|
+
testId = 'smart-block-title',
|
|
67
|
+
text,
|
|
68
|
+
icon,
|
|
69
|
+
theme,
|
|
70
|
+
hideRetry,
|
|
71
|
+
metadataPosition,
|
|
72
|
+
hideIcon = false,
|
|
73
|
+
...props
|
|
74
|
+
}) => {
|
|
75
|
+
if (hideRetry && props.retry) {
|
|
76
|
+
delete props.retry;
|
|
77
|
+
}
|
|
78
|
+
const [actionDropdownOpen, setActionDropdownOpen] = useState(false);
|
|
79
|
+
const onDropdownOpenChange = useCallback(isOpen => {
|
|
80
|
+
setActionDropdownOpen(isOpen);
|
|
81
|
+
if (onActionMenuOpenChange) {
|
|
82
|
+
onActionMenuOpenChange({
|
|
83
|
+
isOpen
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}, [onActionMenuOpenChange]);
|
|
87
|
+
const actionGroup = actions.length > 0 && /*#__PURE__*/React.createElement(ActionGroup, {
|
|
88
|
+
items: actions,
|
|
89
|
+
visibleButtonsNum: showActionOnHover ? 1 : 2,
|
|
90
|
+
onDropdownOpenChange: onDropdownOpenChange
|
|
91
|
+
});
|
|
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
|
+
const overrideText = !!text ? {
|
|
96
|
+
text
|
|
97
|
+
} : {};
|
|
98
|
+
const onMouseDown = useMouseDownEvent();
|
|
99
|
+
const title = /*#__PURE__*/React.createElement(Title, _extends({
|
|
100
|
+
hideTooltip: hideTitleTooltip,
|
|
101
|
+
maxLines: maxLines,
|
|
102
|
+
onClick: onClick,
|
|
103
|
+
onMouseDown: onMouseDown,
|
|
104
|
+
target: anchorTarget,
|
|
105
|
+
theme: theme
|
|
106
|
+
}, overrideText));
|
|
107
|
+
const Component = getTitleBlockViewComponent(status);
|
|
108
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
109
|
+
actionGroup: actionGroup,
|
|
110
|
+
overrideCss: combinedCss,
|
|
111
|
+
testId: testId,
|
|
112
|
+
title: title,
|
|
113
|
+
metadataPosition: metadataPosition,
|
|
114
|
+
hideIcon: hideIcon,
|
|
115
|
+
icon: icon
|
|
116
|
+
}));
|
|
117
|
+
};
|
|
118
|
+
export default TitleBlock;
|
|
@@ -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 };
|