@atlaskit/smart-card 18.0.15 → 18.0.18
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 +21 -0
- package/client/package.json +1 -0
- package/dist/cjs/extractors/common/context/extractProvider.js +14 -4
- package/dist/cjs/extractors/common/detail/extractCommentCount.js +3 -1
- package/dist/cjs/extractors/common/detail/extractProgrammingLanguage.js +3 -1
- package/dist/cjs/extractors/common/detail/extractSubscriberCount.js +3 -1
- package/dist/cjs/extractors/common/primitives/extractTitleTextColor.js +3 -1
- package/dist/cjs/i18n/cs.js +43 -0
- package/dist/cjs/i18n/da.js +43 -0
- package/dist/cjs/i18n/de.js +43 -0
- package/dist/cjs/i18n/en.js +43 -0
- package/dist/cjs/i18n/en_GB.js +43 -0
- package/dist/cjs/i18n/en_ZZ.js +43 -0
- package/dist/cjs/i18n/es.js +43 -0
- package/dist/cjs/i18n/et.js +16 -0
- package/dist/cjs/i18n/fi.js +43 -0
- package/dist/cjs/i18n/fr.js +43 -0
- package/dist/cjs/i18n/hu.js +43 -0
- package/dist/cjs/i18n/it.js +43 -0
- package/dist/cjs/i18n/ja.js +43 -0
- package/dist/cjs/i18n/ko.js +43 -0
- package/dist/cjs/i18n/nb.js +43 -0
- package/dist/cjs/i18n/nl.js +43 -0
- package/dist/cjs/i18n/pl.js +43 -0
- package/dist/cjs/i18n/pt_BR.js +43 -0
- package/dist/cjs/i18n/pt_PT.js +16 -0
- package/dist/cjs/i18n/ru.js +43 -0
- package/dist/cjs/i18n/sk.js +16 -0
- package/dist/cjs/i18n/sv.js +43 -0
- package/dist/cjs/i18n/th.js +43 -0
- package/dist/cjs/i18n/tr.js +43 -0
- package/dist/cjs/i18n/uk.js +43 -0
- package/dist/cjs/i18n/vi.js +43 -0
- package/dist/cjs/i18n/zh.js +43 -0
- package/dist/cjs/i18n/zh_TW.js +43 -0
- package/dist/cjs/state/actions/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/components/Frame.js +10 -7
- package/dist/cjs/view/BlockCard/components/Link.js +3 -1
- package/dist/cjs/view/BlockCard/components/Provider.js +3 -1
- package/dist/cjs/view/BlockCard/views/ErroredView.js +3 -1
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +3 -1
- package/dist/cjs/view/BlockCard/views/NotFoundView.js +3 -1
- package/dist/cjs/view/BlockCard/views/ResolvingView.js +4 -2
- package/dist/cjs/view/EmbedCard/components/styled.js +15 -13
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +11 -25
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -2
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +4 -9
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +32 -0
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +1 -18
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/utils.js +20 -1
- package/dist/cjs/view/InlineCard/ErroredView/index.js +3 -1
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +4 -2
- package/dist/cjs/view/InlineCard/Frame/styled.js +16 -13
- package/dist/cjs/view/InlineCard/Icon.js +3 -1
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +4 -2
- package/dist/cjs/view/InlineCard/styled.js +6 -4
- package/dist/cjs/view/common/Byline.js +3 -1
- package/dist/cjs/view/common/Metadata.js +3 -1
- package/dist/cjs/view/common/ModalHeader.js +4 -2
- package/dist/es2019/extractors/common/context/extractProvider.js +13 -4
- package/dist/es2019/extractors/common/detail/extractCommentCount.js +2 -1
- package/dist/es2019/extractors/common/detail/extractProgrammingLanguage.js +2 -1
- package/dist/es2019/extractors/common/detail/extractSubscriberCount.js +2 -1
- package/dist/es2019/extractors/common/primitives/extractTitleTextColor.js +2 -1
- package/dist/es2019/i18n/cs.js +35 -0
- package/dist/es2019/i18n/da.js +35 -0
- package/dist/es2019/i18n/de.js +35 -0
- package/dist/es2019/i18n/en.js +35 -0
- package/dist/es2019/i18n/en_GB.js +35 -0
- package/dist/es2019/i18n/en_ZZ.js +35 -0
- package/dist/es2019/i18n/es.js +35 -0
- package/dist/es2019/i18n/et.js +8 -0
- package/dist/es2019/i18n/fi.js +35 -0
- package/dist/es2019/i18n/fr.js +35 -0
- package/dist/es2019/i18n/hu.js +35 -0
- package/dist/es2019/i18n/it.js +35 -0
- package/dist/es2019/i18n/ja.js +35 -0
- package/dist/es2019/i18n/ko.js +35 -0
- package/dist/es2019/i18n/nb.js +35 -0
- package/dist/es2019/i18n/nl.js +35 -0
- package/dist/es2019/i18n/pl.js +35 -0
- package/dist/es2019/i18n/pt_BR.js +35 -0
- package/dist/es2019/i18n/pt_PT.js +8 -0
- package/dist/es2019/i18n/ru.js +35 -0
- package/dist/es2019/i18n/sk.js +8 -0
- package/dist/es2019/i18n/sv.js +35 -0
- package/dist/es2019/i18n/th.js +35 -0
- package/dist/es2019/i18n/tr.js +35 -0
- package/dist/es2019/i18n/uk.js +35 -0
- package/dist/es2019/i18n/vi.js +35 -0
- package/dist/es2019/i18n/zh.js +35 -0
- package/dist/es2019/i18n/zh_TW.js +35 -0
- package/dist/es2019/state/actions/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/components/Frame.js +9 -7
- package/dist/es2019/view/BlockCard/components/Link.js +2 -1
- package/dist/es2019/view/BlockCard/components/Provider.js +2 -1
- package/dist/es2019/view/BlockCard/views/ErroredView.js +2 -1
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +2 -1
- package/dist/es2019/view/BlockCard/views/NotFoundView.js +2 -1
- package/dist/es2019/view/BlockCard/views/ResolvingView.js +3 -2
- package/dist/es2019/view/EmbedCard/components/styled.js +15 -15
- package/dist/es2019/view/EmbedCard/views/ErroredView.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +10 -25
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -3
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +4 -30
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +39 -0
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +2 -19
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/utils.js +16 -0
- package/dist/es2019/view/InlineCard/ErroredView/index.js +2 -1
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +3 -2
- package/dist/es2019/view/InlineCard/Frame/styled.js +15 -12
- package/dist/es2019/view/InlineCard/Icon.js +7 -6
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +3 -2
- package/dist/es2019/view/InlineCard/styled.js +5 -4
- package/dist/es2019/view/common/Byline.js +2 -1
- package/dist/es2019/view/common/Metadata.js +2 -1
- package/dist/es2019/view/common/ModalHeader.js +3 -2
- package/dist/esm/extractors/common/context/extractProvider.js +13 -4
- package/dist/esm/extractors/common/detail/extractCommentCount.js +2 -1
- package/dist/esm/extractors/common/detail/extractProgrammingLanguage.js +2 -1
- package/dist/esm/extractors/common/detail/extractSubscriberCount.js +2 -1
- package/dist/esm/extractors/common/primitives/extractTitleTextColor.js +2 -1
- package/dist/esm/i18n/cs.js +35 -0
- package/dist/esm/i18n/da.js +35 -0
- package/dist/esm/i18n/de.js +35 -0
- package/dist/esm/i18n/en.js +35 -0
- package/dist/esm/i18n/en_GB.js +35 -0
- package/dist/esm/i18n/en_ZZ.js +35 -0
- package/dist/esm/i18n/es.js +35 -0
- package/dist/esm/i18n/et.js +8 -0
- package/dist/esm/i18n/fi.js +35 -0
- package/dist/esm/i18n/fr.js +35 -0
- package/dist/esm/i18n/hu.js +35 -0
- package/dist/esm/i18n/it.js +35 -0
- package/dist/esm/i18n/ja.js +35 -0
- package/dist/esm/i18n/ko.js +35 -0
- package/dist/esm/i18n/nb.js +35 -0
- package/dist/esm/i18n/nl.js +35 -0
- package/dist/esm/i18n/pl.js +35 -0
- package/dist/esm/i18n/pt_BR.js +35 -0
- package/dist/esm/i18n/pt_PT.js +8 -0
- package/dist/esm/i18n/ru.js +35 -0
- package/dist/esm/i18n/sk.js +8 -0
- package/dist/esm/i18n/sv.js +35 -0
- package/dist/esm/i18n/th.js +35 -0
- package/dist/esm/i18n/tr.js +35 -0
- package/dist/esm/i18n/uk.js +35 -0
- package/dist/esm/i18n/vi.js +35 -0
- package/dist/esm/i18n/zh.js +35 -0
- package/dist/esm/i18n/zh_TW.js +35 -0
- package/dist/esm/state/actions/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/components/Frame.js +9 -7
- package/dist/esm/view/BlockCard/components/Link.js +2 -1
- package/dist/esm/view/BlockCard/components/Provider.js +2 -1
- package/dist/esm/view/BlockCard/views/ErroredView.js +2 -1
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +2 -1
- package/dist/esm/view/BlockCard/views/NotFoundView.js +2 -1
- package/dist/esm/view/BlockCard/views/ResolvingView.js +3 -2
- package/dist/esm/view/EmbedCard/components/styled.js +14 -13
- package/dist/esm/view/EmbedCard/views/ErroredView.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +10 -25
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +8 -3
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +4 -10
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +20 -0
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +2 -19
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/utils.js +16 -0
- package/dist/esm/view/InlineCard/ErroredView/index.js +2 -1
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +3 -2
- package/dist/esm/view/InlineCard/Frame/styled.js +16 -13
- package/dist/esm/view/InlineCard/Icon.js +2 -1
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +3 -2
- package/dist/esm/view/InlineCard/styled.js +5 -4
- package/dist/esm/view/common/Byline.js +2 -1
- package/dist/esm/view/common/Metadata.js +2 -1
- package/dist/esm/view/common/ModalHeader.js +3 -2
- package/dist/types/i18n/cs.d.ts +35 -0
- package/dist/types/i18n/da.d.ts +35 -0
- package/dist/types/i18n/de.d.ts +35 -0
- package/dist/types/i18n/en.d.ts +35 -0
- package/dist/types/i18n/en_GB.d.ts +35 -0
- package/dist/types/i18n/en_ZZ.d.ts +35 -0
- package/dist/types/i18n/es.d.ts +35 -0
- package/dist/types/i18n/et.d.ts +8 -0
- package/dist/types/i18n/fi.d.ts +35 -0
- package/dist/types/i18n/fr.d.ts +35 -0
- package/dist/types/i18n/hu.d.ts +35 -0
- package/dist/types/i18n/it.d.ts +35 -0
- package/dist/types/i18n/ja.d.ts +35 -0
- package/dist/types/i18n/ko.d.ts +35 -0
- package/dist/types/i18n/nb.d.ts +35 -0
- package/dist/types/i18n/nl.d.ts +35 -0
- package/dist/types/i18n/pl.d.ts +35 -0
- package/dist/types/i18n/pt_BR.d.ts +35 -0
- package/dist/types/i18n/pt_PT.d.ts +8 -0
- package/dist/types/i18n/ru.d.ts +35 -0
- package/dist/types/i18n/sk.d.ts +8 -0
- package/dist/types/i18n/sv.d.ts +35 -0
- package/dist/types/i18n/th.d.ts +35 -0
- package/dist/types/i18n/tr.d.ts +35 -0
- package/dist/types/i18n/uk.d.ts +35 -0
- package/dist/types/i18n/vi.d.ts +35 -0
- package/dist/types/i18n/zh.d.ts +35 -0
- package/dist/types/i18n/zh_TW.d.ts +35 -0
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/utils.d.ts +1 -0
- package/hooks/package.json +1 -0
- package/in-product/package.json +1 -0
- package/package.json +7 -2
- package/ssr/package.json +1 -0
- package/types/package.json +1 -0
|
@@ -71,7 +71,7 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
|
|
|
71
71
|
var nextStatus = response ? getStatus(response) : 'fatal'; // If we require authorization & do not have an authFlow available,
|
|
72
72
|
// throw an error and render as a normal blue link.
|
|
73
73
|
|
|
74
|
-
if (nextStatus === 'unauthorized' && !hasAuthFlowSupported) {
|
|
74
|
+
if ((nextStatus === 'unauthorized' || nextStatus === 'forbidden') && !hasAuthFlowSupported) {
|
|
75
75
|
handleResolvedLinkError(resourceUrl, new APIError('fallback', hostname, ERROR_MESSAGE_OAUTH));
|
|
76
76
|
return;
|
|
77
77
|
} // Handle any other errors
|
package/dist/esm/version.json
CHANGED
|
@@ -8,6 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
import { jsx } from '@emotion/core';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { N20A, N30A, B200, N40A, N50A } from '@atlaskit/theme/colors';
|
|
11
|
+
import { token } from '@atlaskit/tokens';
|
|
11
12
|
import { gs, br, mq } from '../../common/utils';
|
|
12
13
|
export var Frame = function Frame() {
|
|
13
14
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
@@ -21,7 +22,7 @@ var sharedFrameStyles = {
|
|
|
21
22
|
maxWidth: gs(95),
|
|
22
23
|
width: '100%',
|
|
23
24
|
display: 'flex',
|
|
24
|
-
backgroundColor: 'white'
|
|
25
|
+
backgroundColor: token('elevation.surface', 'white')
|
|
25
26
|
};
|
|
26
27
|
export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
27
28
|
var children = _ref.children,
|
|
@@ -33,15 +34,16 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
33
34
|
return jsx("div", {
|
|
34
35
|
css: mq(_objectSpread(_objectSpread({}, sharedFrameStyles), {}, {
|
|
35
36
|
'&:hover': isHoverable ? {
|
|
36
|
-
|
|
37
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4064
|
|
38
|
+
backgroundColor: token('color.background.neutral.subtle.hovered', N20A),
|
|
37
39
|
cursor: 'pointer'
|
|
38
40
|
} : undefined,
|
|
39
41
|
minHeight: isFluidHeight ? 0 : [gs(21), gs(15)],
|
|
40
42
|
borderRadius: isSelected ? br() : br(0.5),
|
|
41
|
-
border: "2px solid ".concat(isSelected ? B200 : 'transparent'),
|
|
43
|
+
border: "2px solid ".concat(isSelected ? token('color.border.selected', B200) : 'transparent'),
|
|
42
44
|
justifyContent: 'space-between',
|
|
43
45
|
overflow: 'hidden',
|
|
44
|
-
boxShadow: "0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A
|
|
46
|
+
boxShadow: token('elevation.shadow.raised', "0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A))
|
|
45
47
|
})),
|
|
46
48
|
"data-testid": testId,
|
|
47
49
|
className: className,
|
|
@@ -58,14 +60,14 @@ export var CompactFrame = function CompactFrame(_ref2) {
|
|
|
58
60
|
return jsx("div", {
|
|
59
61
|
css: mq(_objectSpread(_objectSpread({}, sharedFrameStyles), {}, {
|
|
60
62
|
'&:hover': isHoverable ? {
|
|
61
|
-
backgroundColor: N30A
|
|
63
|
+
backgroundColor: token('color.background.neutral.hovered', N30A)
|
|
62
64
|
} : undefined,
|
|
63
65
|
borderRadius: isSelected ? br() : br(0.5),
|
|
64
|
-
border: isSelected ? "2px solid ".concat(B200) : '',
|
|
66
|
+
border: isSelected ? "2px solid ".concat(token('color.border.selected', B200)) : '',
|
|
65
67
|
justifyContent: 'center',
|
|
66
68
|
alignItems: 'center',
|
|
67
69
|
height: inheritDimensions ? '100%' : gs(5),
|
|
68
|
-
backgroundColor: N20A,
|
|
70
|
+
backgroundColor: token('color.background.neutral', N20A),
|
|
69
71
|
width: ['calc(100% - 16px)', '100%'],
|
|
70
72
|
padding: ["0px ".concat(gs(1)), '0']
|
|
71
73
|
})),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/core';
|
|
3
3
|
import { B400 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { token } from '@atlaskit/tokens';
|
|
4
5
|
export var Link = function Link(_ref) {
|
|
5
6
|
var url = _ref.url,
|
|
6
7
|
_ref$testId = _ref.testId,
|
|
@@ -10,7 +11,7 @@ export var Link = function Link(_ref) {
|
|
|
10
11
|
"data-testid": "".concat(testId, "-link"),
|
|
11
12
|
className: className,
|
|
12
13
|
css: {
|
|
13
|
-
color: B400,
|
|
14
|
+
color: token('color.link', B400),
|
|
14
15
|
wordBreak: 'break-all'
|
|
15
16
|
}
|
|
16
17
|
}, url);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from '@emotion/core';
|
|
3
3
|
import { N300 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { gs } from '../../common/utils';
|
|
5
|
+
import { token } from '@atlaskit/tokens';
|
|
5
6
|
export var Provider = function Provider(_ref) {
|
|
6
7
|
var name = _ref.name,
|
|
7
8
|
icon = _ref.icon;
|
|
@@ -26,7 +27,7 @@ export var Provider = function Provider(_ref) {
|
|
|
26
27
|
}, iconToRender, jsx("span", {
|
|
27
28
|
css: {
|
|
28
29
|
fontSize: gs(1.5),
|
|
29
|
-
color: N300,
|
|
30
|
+
color: token('color.text.subtlest', N300),
|
|
30
31
|
margin: 0,
|
|
31
32
|
marginLeft: gs(0.5),
|
|
32
33
|
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
@@ -21,6 +21,7 @@ import { handleClickCommon } from '../utils/handlers';
|
|
|
21
21
|
import { Link } from '../components/Link';
|
|
22
22
|
import { UnresolvedText } from '../components/UnresolvedText';
|
|
23
23
|
import { RetryAction } from '../actions/RetryAction';
|
|
24
|
+
import { token } from '@atlaskit/tokens';
|
|
24
25
|
|
|
25
26
|
var textDescriptionProps = _objectSpread({}, messages.could_not_load_link);
|
|
26
27
|
|
|
@@ -63,7 +64,7 @@ export var ErroredView = function ErroredView(_ref) {
|
|
|
63
64
|
icon: jsx(WarningIcon, {
|
|
64
65
|
label: "errored-warning-icon",
|
|
65
66
|
size: "small",
|
|
66
|
-
primaryColor: R300,
|
|
67
|
+
primaryColor: token('color.icon.warning', R300),
|
|
67
68
|
testId: "".concat(testId, "-warning-icon")
|
|
68
69
|
}),
|
|
69
70
|
text: jsx(FormattedMessage, textDescriptionProps)
|
|
@@ -5,6 +5,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
7
|
import { R300 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
8
9
|
import LockIcon from '@atlaskit/icon/glyph/lock-filled';
|
|
9
10
|
import { Frame } from '../components/Frame';
|
|
10
11
|
import { Provider } from '../components/Provider';
|
|
@@ -65,7 +66,7 @@ export var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
65
66
|
icon: jsx(LockIcon, {
|
|
66
67
|
label: "forbidden-lock-icon",
|
|
67
68
|
size: "small",
|
|
68
|
-
primaryColor: R300,
|
|
69
|
+
primaryColor: token('color.icon.danger', R300),
|
|
69
70
|
testId: "".concat(testId, "-lock-icon")
|
|
70
71
|
}),
|
|
71
72
|
text: jsx(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
|
|
@@ -20,6 +20,7 @@ import { ContentHeader } from '../components/ContentHeader';
|
|
|
20
20
|
import { Link } from '../components/Link';
|
|
21
21
|
import { UnresolvedText } from '../components/UnresolvedText';
|
|
22
22
|
import { handleClickCommon } from '../utils/handlers';
|
|
23
|
+
import { token } from '@atlaskit/tokens';
|
|
23
24
|
|
|
24
25
|
var textDescriptionProps = _objectSpread({}, messages.not_found_description);
|
|
25
26
|
|
|
@@ -59,7 +60,7 @@ export var NotFoundView = function NotFoundView(_ref) {
|
|
|
59
60
|
icon: jsx(WarningIcon, {
|
|
60
61
|
label: "not-found-warning-icon",
|
|
61
62
|
size: "small",
|
|
62
|
-
primaryColor: R300,
|
|
63
|
+
primaryColor: token('color.icon.warning', R300),
|
|
63
64
|
testId: "".concat(testId, "-warning-icon")
|
|
64
65
|
}),
|
|
65
66
|
text: jsx(FormattedMessage, textDescriptionProps)
|
|
@@ -3,6 +3,7 @@ import { jsx } from '@emotion/core';
|
|
|
3
3
|
import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
|
|
4
4
|
import { N50, N90 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
import { Frame } from '../components/Frame';
|
|
7
8
|
import { gs } from '../../common/utils';
|
|
8
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -22,12 +23,12 @@ export var ResolvingView = function ResolvingView(_ref) {
|
|
|
22
23
|
className: blockCardResolvingViewClassName
|
|
23
24
|
}, jsx(DocumentFilledIcon, {
|
|
24
25
|
size: "small",
|
|
25
|
-
primaryColor: N50,
|
|
26
|
+
primaryColor: token('color.icon.subtle', N50),
|
|
26
27
|
label: "document-icon"
|
|
27
28
|
}), jsx("span", {
|
|
28
29
|
css: {
|
|
29
30
|
fontSize: "".concat(fontSize(), "px"),
|
|
30
|
-
color: N90,
|
|
31
|
+
color: token('color.text.subtlest', N90),
|
|
31
32
|
marginLeft: gs(0.5)
|
|
32
33
|
}
|
|
33
34
|
}, jsx(FormattedMessage, messages.loading)));
|
|
@@ -6,6 +6,7 @@ import styled from '@emotion/styled';
|
|
|
6
6
|
import { size as csssize, borderRadius, size, ellipsis } from '@atlaskit/media-ui';
|
|
7
7
|
import { fontFamily } from '@atlaskit/theme/constants';
|
|
8
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
9
10
|
import { gs as gridSize } from '../../common/utils';
|
|
10
11
|
export var className = 'media-card-frame';
|
|
11
12
|
export var cardShadow = "";
|
|
@@ -34,13 +35,13 @@ function getinteractiveStyles(_ref3) {
|
|
|
34
35
|
var isInteractive = _ref3.isInteractive,
|
|
35
36
|
isFrameVisible = _ref3.isFrameVisible;
|
|
36
37
|
var visibleFrameStyles = isFrameVisible ? visibleStyles : '';
|
|
37
|
-
var interactiveFrameStyles = isInteractive ? "\n &:hover {\n ".concat(visibleStyles, "\n }\n &:active {\n background-color: ").concat(colors.B50, ";\n }\n") : '';
|
|
38
|
+
var interactiveFrameStyles = isInteractive ? "\n &:hover {\n ".concat(visibleStyles, "\n }\n &:active {\n background-color: ").concat(token('color.background.selected', colors.B50), ";\n }\n") : '';
|
|
38
39
|
return "".concat(visibleFrameStyles).concat(interactiveFrameStyles);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
function selected(_ref4) {
|
|
42
43
|
var isSelected = _ref4.isSelected;
|
|
43
|
-
return isSelected ? "\n ".concat(visibleStyles, "\n &::after {\n cursor: pointer;\n box-shadow: 0 0 0 3px ").concat(colors.B100, ";\n content: '';\n outline: none;\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n ").concat(borderRadius, "\n }\n ") : '';
|
|
44
|
+
return isSelected ? "\n ".concat(visibleStyles, "\n &::after {\n cursor: pointer;\n box-shadow: 0 0 0 3px ").concat(token('color.border.selected', colors.B100), ";\n content: '';\n outline: none;\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n ").concat(borderRadius, "\n }\n ") : '';
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
var height = function height(_ref5) {
|
|
@@ -52,7 +53,7 @@ var wrapperStyles = function wrapperStyles(props) {
|
|
|
52
53
|
return "\n ".concat(borderRadius, "\n ").concat(minWidth(props), "\n ").concat(maxWidth(props), "\n ").concat(getinteractiveStyles(props), "\n ").concat(visible(props), "\n display: inline-flex;\n flex-direction: column;\n box-sizing: border-box;\n font-family: ").concat(fontFamily(), ";\n width: 100%;\n user-select: none;\n line-height: initial;\n transition: background 0.3s;\n position: relative;\n ").concat(height(props), ";\n ").concat(selected(props), "\n\n &:after {\n content: '';\n background: transparent;\n transition: background 0.3s, box-shadow 0.3s;\n position: absolute;\n width: calc(100% + ").concat(gridSize(2), ");\n height: calc(100% + ").concat(gridSize(1), ");\n left: -").concat(gridSize(1), ";\n ").concat(borderRadius, "\n }\n");
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
var visibleStyles = "\n background-color: ".concat(colors.N30, ";\n\n &:after {\n background: ").concat(colors.N30, " !important;\n }\n .embed-header {\n opacity: 1;\n }");
|
|
56
|
+
var visibleStyles = "\n background-color: ".concat(token('color.background.neutral.subtle', colors.N30), ";\n\n &:after {\n background: ").concat(token('color.background.neutral', colors.N30), " !important;\n }\n .embed-header {\n opacity: 1;\n }");
|
|
56
57
|
|
|
57
58
|
function visible(_ref6) {
|
|
58
59
|
var isVisible = _ref6.isVisible;
|
|
@@ -66,12 +67,12 @@ export var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedT
|
|
|
66
67
|
return wrapperStyles(props);
|
|
67
68
|
});
|
|
68
69
|
export var embedHeaderHeight = 32;
|
|
69
|
-
export var Header = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: ", "px;\n position: absolute;\n z-index: 1;\n width: 100%;\n display: flex;\n align-items: center;\n color: ", ";\n opacity: 0;\n transition: 300ms opacity cubic-bezier(0.15, 1, 0.3, 1);\n"])), embedHeaderHeight, colors.N300);
|
|
70
|
+
export var Header = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: ", "px;\n position: absolute;\n z-index: 1;\n width: 100%;\n display: flex;\n align-items: center;\n color: ", ";\n opacity: 0;\n transition: 300ms opacity cubic-bezier(0.15, 1, 0.3, 1);\n"])), embedHeaderHeight, token('color.icon', colors.N300));
|
|
70
71
|
export var IconWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", " margin-right: 4px;\n"])), borderRadius, size(16), function (_ref7) {
|
|
71
72
|
var isPlaceholder = _ref7.isPlaceholder;
|
|
72
73
|
|
|
73
74
|
if (isPlaceholder) {
|
|
74
|
-
return "\n background-color: ".concat(colors.N30, ";\n ");
|
|
75
|
+
return "\n background-color: ".concat(token('color.skeleton', colors.N30), ";\n ");
|
|
75
76
|
} else {
|
|
76
77
|
return '';
|
|
77
78
|
}
|
|
@@ -80,19 +81,19 @@ export var TextWrapper = styled.div(_templateObject5 || (_templateObject5 = _tag
|
|
|
80
81
|
var isPlaceholder = _ref8.isPlaceholder;
|
|
81
82
|
|
|
82
83
|
if (isPlaceholder) {
|
|
83
|
-
return "\n ".concat(borderRadius, "\n width: 125px;\n height: 12px;\n background-color: ").concat(colors.N30, ";\n ");
|
|
84
|
+
return "\n ".concat(borderRadius, "\n width: 125px;\n height: 12px;\n background-color: ").concat(token('color.skeleton', colors.N30), ";\n ");
|
|
84
85
|
} else {
|
|
85
86
|
return '';
|
|
86
87
|
}
|
|
87
|
-
}, colors.N300, ellipsis('none'));
|
|
88
|
+
}, token('color.text.subtlest', colors.N300), ellipsis('none'));
|
|
88
89
|
// NB: `overflow` is kept as `hidden` since
|
|
89
90
|
// the internal contents of the `iframe` should
|
|
90
91
|
// manage scrolling behaviour.
|
|
91
|
-
export var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n ", "\n background-color:
|
|
92
|
+
export var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n ", "\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n top: ", ";\n overflow: hidden;\n height: calc(100% - ", ");\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", ";\n"])), borderRadius, cardShadow, token('elevation.surface', 'white'), gridSize(4), gridSize(4), function (_ref9) {
|
|
92
93
|
var isInteractive = _ref9.isInteractive;
|
|
93
94
|
|
|
94
95
|
if (isInteractive) {
|
|
95
|
-
return "\n .".concat(className, ":hover & {\n box-shadow: 0 4px 8px -2px rgba(23, 43, 77, 0.32)
|
|
96
|
+
return "\n .".concat(className, ":hover & {\n box-shadow: ").concat(token('elevation.shadow.overlay', '0 4px 8px -2px rgba(23, 43, 77, 0.32), 0 0 1px rgba(23, 43, 77, 0.25)'), ";\n }\n ");
|
|
96
97
|
} else {
|
|
97
98
|
return '';
|
|
98
99
|
}
|
|
@@ -103,11 +104,11 @@ export var Image = styled.img(_templateObject7 || (_templateObject7 = _taggedTem
|
|
|
103
104
|
}, borderRadius);
|
|
104
105
|
export var maxAvatarCount = 6;
|
|
105
106
|
export var ContentWrapper = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n padding: 8px 12px 12px 12px;\n"])));
|
|
106
|
-
export var Title = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 16px;\n font-weight: 500;\n line-height: ", ";\n max-height: ", "px;\n overflow: hidden;\n"])), colors.N900, 20 / 16, 20 * 4);
|
|
107
|
-
export var Byline = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-top: 4px;\n color: ", ";\n font-size: 12px;\n font-weight: normal;\n line-height: ", ";\n ", ";\n"])), colors.N300, 16 / 12, ellipsis('100%'));
|
|
108
|
-
export var Description = styled.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-top: 7px;\n color: ", ";\n font-size: 12px;\n font-weight: normal;\n line-height: ", ";\n max-height: ", "px;\n overflow: hidden;\n"])), colors.N800, 18 / 12, 18 * 3);
|
|
107
|
+
export var Title = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 16px;\n font-weight: 500;\n line-height: ", ";\n max-height: ", "px;\n overflow: hidden;\n"])), token('color.text', colors.N900), 20 / 16, 20 * 4);
|
|
108
|
+
export var Byline = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-top: 4px;\n color: ", ";\n font-size: 12px;\n font-weight: normal;\n line-height: ", ";\n ", ";\n"])), token('color.text.subtlest', colors.N300), 16 / 12, ellipsis('100%'));
|
|
109
|
+
export var Description = styled.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-top: 7px;\n color: ", ";\n font-size: 12px;\n font-weight: normal;\n line-height: ", ";\n max-height: ", "px;\n overflow: hidden;\n"])), token('color.text', colors.N800), 18 / 12, 18 * 3);
|
|
109
110
|
export var ResolvedViewIconWrapper = styled.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n margin-top: 4px;\n"])));
|
|
110
|
-
export var Thumbnail = styled.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n ", "\n ", "\n float: right;\n margin: 4px 0 12px 12px;\n background-color: ", ";\n background-image: url(", ");\n background-size: cover;\n"])), borderRadius, size(48), colors.N30, function (_ref11) {
|
|
111
|
+
export var Thumbnail = styled.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n ", "\n ", "\n float: right;\n margin: 4px 0 12px 12px;\n background-color: ", ";\n background-image: url(", ");\n background-size: cover;\n"])), borderRadius, size(48), token('color.skeleton', colors.N30), function (_ref11) {
|
|
111
112
|
var src = _ref11.src;
|
|
112
113
|
return src;
|
|
113
114
|
});
|
|
@@ -4,6 +4,7 @@ import Button from '@atlaskit/button/custom-theme-button';
|
|
|
4
4
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
5
5
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
6
6
|
import { R300 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
7
8
|
import { Frame } from '../../BlockCard/components/Frame';
|
|
8
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
10
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
@@ -22,7 +23,7 @@ export var EmbedCardErroredView = function EmbedCardErroredView(_ref) {
|
|
|
22
23
|
testId: testId
|
|
23
24
|
}, jsx(ErrorIcon, {
|
|
24
25
|
size: "small",
|
|
25
|
-
primaryColor: R300,
|
|
26
|
+
primaryColor: token('color.icon.danger', R300),
|
|
26
27
|
label: "error-icon"
|
|
27
28
|
}), jsx("span", {
|
|
28
29
|
css: {
|
|
@@ -5,28 +5,10 @@ var _excluded = ["actionGroup", "testId", "title"];
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { jsx } from '@emotion/core';
|
|
8
|
-
import Spinner from '@atlaskit/spinner';
|
|
9
8
|
import Block from '../../block';
|
|
10
9
|
import { SmartLinkSize } from '../../../../../../constants';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// Spinner sizes should be equivalent or smaller than Icon size
|
|
14
|
-
// to avoid the jumping.
|
|
15
|
-
switch (size) {
|
|
16
|
-
case SmartLinkSize.XLarge:
|
|
17
|
-
return 28;
|
|
18
|
-
|
|
19
|
-
case SmartLinkSize.Large:
|
|
20
|
-
return 24;
|
|
21
|
-
|
|
22
|
-
case SmartLinkSize.Medium:
|
|
23
|
-
return 16;
|
|
24
|
-
|
|
25
|
-
case SmartLinkSize.Small:
|
|
26
|
-
default:
|
|
27
|
-
return 12;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
10
|
+
import LoadingSkeleton from '../../../common/loading-skeleton';
|
|
11
|
+
import { getIconSizeStyles, getIconWidth } from '../../../utils';
|
|
30
12
|
/**
|
|
31
13
|
* This represents a TitleBlock for a Smart Link that is currently waiting
|
|
32
14
|
* for a request to finish.
|
|
@@ -34,7 +16,6 @@ var getSpinnerSize = function getSpinnerSize(size) {
|
|
|
34
16
|
* @see TitleBlock
|
|
35
17
|
*/
|
|
36
18
|
|
|
37
|
-
|
|
38
19
|
var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
|
|
39
20
|
var actionGroup = _ref.actionGroup,
|
|
40
21
|
testId = _ref.testId,
|
|
@@ -43,12 +24,16 @@ var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
|
|
|
43
24
|
|
|
44
25
|
var _blockProps$size = blockProps.size,
|
|
45
26
|
size = _blockProps$size === void 0 ? SmartLinkSize.Medium : _blockProps$size;
|
|
27
|
+
var iconWidth = getIconWidth(size);
|
|
28
|
+
var iconStyles = getIconSizeStyles(iconWidth);
|
|
46
29
|
return jsx(Block, _extends({}, blockProps, {
|
|
47
30
|
testId: "".concat(testId, "-resolving-view")
|
|
48
|
-
}), jsx(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
31
|
+
}), jsx("span", {
|
|
32
|
+
css: iconStyles,
|
|
33
|
+
"data-testid": "".concat(testId, "-icon")
|
|
34
|
+
}, jsx(LoadingSkeleton, {
|
|
35
|
+
testId: "".concat(testId, "-icon-loading")
|
|
36
|
+
})), title, actionGroup);
|
|
52
37
|
};
|
|
53
38
|
|
|
54
39
|
export default TitleBlockResolvingView;
|
|
@@ -6,7 +6,8 @@ import React from 'react';
|
|
|
6
6
|
import Loadable from 'react-loadable';
|
|
7
7
|
import { B200, B400, N700, R400 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { IconType } from '../../../../../constants';
|
|
9
|
-
// prettier-ignore
|
|
9
|
+
import { token } from '@atlaskit/tokens'; // prettier-ignore
|
|
10
|
+
|
|
10
11
|
var importIconMapper = (_importIconMapper = {}, _defineProperty(_importIconMapper, IconType.Archive, function () {
|
|
11
12
|
return import(
|
|
12
13
|
/* webpackChunkName: "glyphArchive" */
|
|
@@ -295,10 +296,14 @@ var AtlaskitIcon = function AtlaskitIcon(_ref3) {
|
|
|
295
296
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
296
297
|
"data-testid": testId // Confluence and Jira imports don't have native testId prop
|
|
297
298
|
,
|
|
298
|
-
textColor: N700
|
|
299
|
+
textColor: token('color.text.subtle', N700)
|
|
300
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
301
|
+
,
|
|
299
302
|
iconColor: B200,
|
|
300
303
|
iconGradientStart: B400,
|
|
301
304
|
iconGradientStop: B200
|
|
305
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
306
|
+
|
|
302
307
|
});
|
|
303
308
|
|
|
304
309
|
case IconType.Error:
|
|
@@ -306,7 +311,7 @@ var AtlaskitIcon = function AtlaskitIcon(_ref3) {
|
|
|
306
311
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
307
312
|
label: label,
|
|
308
313
|
testId: testId,
|
|
309
|
-
primaryColor: R400
|
|
314
|
+
primaryColor: token('color.icon.danger', R400)
|
|
310
315
|
});
|
|
311
316
|
|
|
312
317
|
default:
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
4
|
-
|
|
5
1
|
/** @jsx jsx */
|
|
6
2
|
import React from 'react';
|
|
7
|
-
import {
|
|
3
|
+
import { jsx } from '@emotion/core';
|
|
8
4
|
import ImageLoader from 'react-render-image';
|
|
9
|
-
|
|
10
|
-
var shimmer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: 2px;\n user-select: none;\n\n background: #f6f7f8;\n background-image: linear-gradient(\n to right,\n #f6f7f8 0%,\n #edeef1 20%,\n #f6f7f8 40%,\n #f6f7f8 100%\n );\n background-repeat: no-repeat;\n background-size: 280% 100%;\n display: inline-block;\n\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: ", ";\n animation-timing-function: linear;\n"])), placeholderShimmer);
|
|
5
|
+
import LoadingSkeleton from '../loading-skeleton';
|
|
11
6
|
|
|
12
7
|
var ImageIcon = function ImageIcon(_ref) {
|
|
13
8
|
var defaultIcon = _ref.defaultIcon,
|
|
@@ -15,9 +10,8 @@ var ImageIcon = function ImageIcon(_ref) {
|
|
|
15
10
|
url = _ref.url;
|
|
16
11
|
return jsx(ImageLoader, {
|
|
17
12
|
src: url,
|
|
18
|
-
loading: jsx(
|
|
19
|
-
|
|
20
|
-
"data-testid": "".concat(testId, "-loading")
|
|
13
|
+
loading: jsx(LoadingSkeleton, {
|
|
14
|
+
testId: "".concat(testId, "-loading")
|
|
21
15
|
}),
|
|
22
16
|
loaded: jsx("img", {
|
|
23
17
|
src: url,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { css, jsx, keyframes } from '@emotion/core';
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
9
|
+
var animationNameStyles = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% { background-position: -20px 0; }\n 100% { background-position: 20px 0; }\n"])));
|
|
10
|
+
var styles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: 2px;\n user-select: none;\n background: ", ";\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4236\n background-image: linear-gradient(\n to right,\n ", " 0%,\n ", " 20%,\n ", " 40%,\n ", "100%\n );\n background-repeat: no-repeat;\n background-size: 280% 100%;\n display: inline-block;\n\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: ", ";\n animation-timing-function: linear;\n"])), token('color.skeleton.subtle', '#f6f7f8'), token('color.skeleton.subtle', '#f6f7f8'), token('color.skeleton', '#edeef1'), token('color.skeleton.subtle', '#f6f7f8'), token('color.skeleton.subtle', '#f6f7f8'), animationNameStyles);
|
|
11
|
+
|
|
12
|
+
var LoadingSkeleton = function LoadingSkeleton(_ref) {
|
|
13
|
+
var testId = _ref.testId;
|
|
14
|
+
return jsx("span", {
|
|
15
|
+
css: styles,
|
|
16
|
+
"data-testid": testId
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default LoadingSkeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,7 +9,7 @@ import { css, jsx } from '@emotion/core';
|
|
|
9
9
|
import { SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
10
10
|
import AtlaskitIcon from '../../common/atlaskit-icon';
|
|
11
11
|
import ImageIcon from '../../common/image-icon';
|
|
12
|
-
import { getIconSizeStyles, getTruncateStyles } from '../../utils';
|
|
12
|
+
import { getIconSizeStyles, getIconWidth, getTruncateStyles } from '../../utils';
|
|
13
13
|
|
|
14
14
|
var getPositionStyles = function getPositionStyles(size, position) {
|
|
15
15
|
switch (position) {
|
|
@@ -22,23 +22,6 @@ var getPositionStyles = function getPositionStyles(size, position) {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
var getWidth = function getWidth(size) {
|
|
26
|
-
switch (size) {
|
|
27
|
-
case SmartLinkSize.XLarge:
|
|
28
|
-
return '2rem';
|
|
29
|
-
|
|
30
|
-
case SmartLinkSize.Large:
|
|
31
|
-
return '1.5rem';
|
|
32
|
-
|
|
33
|
-
case SmartLinkSize.Medium:
|
|
34
|
-
return '1rem';
|
|
35
|
-
|
|
36
|
-
case SmartLinkSize.Small:
|
|
37
|
-
default:
|
|
38
|
-
return '.75rem';
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
25
|
var getIconStyles = function getIconStyles(size, position, width) {
|
|
43
26
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n ", "\n"])), getPositionStyles(size, position), getIconSizeStyles(width));
|
|
44
27
|
};
|
|
@@ -98,7 +81,7 @@ var Icon = function Icon(_ref) {
|
|
|
98
81
|
var defaultIcon = renderDefaultIcon(label, testId);
|
|
99
82
|
return (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, icon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
100
83
|
}, [icon, label, render, testId, url]);
|
|
101
|
-
var width =
|
|
84
|
+
var width = getIconWidth(size);
|
|
102
85
|
var styles = getIconStyles(size, position, width);
|
|
103
86
|
var renderStyles = render ? getCustomRenderStyles(width) : undefined;
|
|
104
87
|
return jsx("div", {
|
|
@@ -16,6 +16,7 @@ var containerStyles = css(_templateObject || (_templateObject = _taggedTemplateL
|
|
|
16
16
|
|
|
17
17
|
var getThemeStyles = function getThemeStyles(theme) {
|
|
18
18
|
switch (theme) {
|
|
19
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
19
20
|
case SmartLinkTheme.Black:
|
|
20
21
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), tokens.blackLink, tokens.blackLinkPressed, tokens.blackLink);
|
|
21
22
|
|
|
@@ -25,6 +25,22 @@ export var getIconSizeStyles = function getIconSizeStyles(width) {
|
|
|
25
25
|
var sizeStyles = getIconDimensionStyles(width);
|
|
26
26
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n ", "\n span,\n svg,\n img {\n ", "\n }\n svg {\n padding: 0;\n }\n "])), sizeStyles, sizeStyles);
|
|
27
27
|
};
|
|
28
|
+
export var getIconWidth = function getIconWidth(size) {
|
|
29
|
+
switch (size) {
|
|
30
|
+
case SmartLinkSize.XLarge:
|
|
31
|
+
return '2rem';
|
|
32
|
+
|
|
33
|
+
case SmartLinkSize.Large:
|
|
34
|
+
return '1.5rem';
|
|
35
|
+
|
|
36
|
+
case SmartLinkSize.Medium:
|
|
37
|
+
return '1rem';
|
|
38
|
+
|
|
39
|
+
case SmartLinkSize.Small:
|
|
40
|
+
default:
|
|
41
|
+
return '.75rem';
|
|
42
|
+
}
|
|
43
|
+
};
|
|
28
44
|
export var getLinkLineHeight = function getLinkLineHeight(size) {
|
|
29
45
|
switch (size) {
|
|
30
46
|
case SmartLinkSize.XLarge:
|
|
@@ -12,6 +12,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { R300 } from '@atlaskit/theme/colors';
|
|
15
|
+
import { token } from '@atlaskit/tokens';
|
|
15
16
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
16
17
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
17
18
|
import { Frame } from '../Frame';
|
|
@@ -85,7 +86,7 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
|
|
|
85
86
|
icon: icon || /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
86
87
|
label: "error",
|
|
87
88
|
size: "small",
|
|
88
|
-
primaryColor: R300
|
|
89
|
+
primaryColor: token('color.icon.danger', R300)
|
|
89
90
|
})),
|
|
90
91
|
title: this.renderMessage()
|
|
91
92
|
}));
|
|
@@ -13,6 +13,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { R400, N500 } from '@atlaskit/theme/colors';
|
|
16
|
+
import { token } from '@atlaskit/tokens';
|
|
16
17
|
import LockIcon from '@atlaskit/icon/glyph/lock-filled';
|
|
17
18
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
18
19
|
import { Frame } from '../Frame';
|
|
@@ -24,7 +25,7 @@ import { IconStyledButton, LowercaseAppearance, LinkAppearance } from '../styled
|
|
|
24
25
|
var FallbackForbiddenIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
|
|
25
26
|
label: "error",
|
|
26
27
|
size: "small",
|
|
27
|
-
primaryColor: R400
|
|
28
|
+
primaryColor: token('color.icon.danger', R400)
|
|
28
29
|
}));
|
|
29
30
|
export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
30
31
|
_inherits(InlineCardForbiddenView, _React$Component);
|
|
@@ -113,7 +114,7 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
113
114
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
114
115
|
icon: icon ? icon : FallbackForbiddenIcon,
|
|
115
116
|
title: this.renderMessage(),
|
|
116
|
-
titleColor: N500
|
|
117
|
+
titleColor: token('color.text.subtle', N500)
|
|
117
118
|
}));
|
|
118
119
|
}
|
|
119
120
|
}]);
|
|
@@ -3,24 +3,24 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import styled from '@emotion/styled';
|
|
6
|
-
import { B100, B400, B50, N20 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { B100, B400, B50, DN40A, DN50A, N20, N40A, N50A } from '@atlaskit/theme/colors';
|
|
7
7
|
import { borderRadius as akBorderRadius } from '@atlaskit/theme/constants';
|
|
8
|
-
import { e100 } from '@atlaskit/theme/elevation';
|
|
9
8
|
import { themed } from '@atlaskit/theme/components';
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
10
10
|
import { TitleWrapperClassName } from '../IconAndTitleLayout/styled';
|
|
11
11
|
var BACKGROUND_COLOR_DARK = '#262B31';
|
|
12
|
-
var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 2px ".concat(B100, ";\n outline: none;\n user-select: none;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n");
|
|
12
|
+
var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 2px ".concat(token('color.border.selected', B100), ";\n outline: none;\n user-select: none;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n");
|
|
13
13
|
|
|
14
14
|
var isInteractive = function isInteractive(_ref) {
|
|
15
15
|
var isInteractive = _ref.isInteractive;
|
|
16
16
|
|
|
17
17
|
if (isInteractive) {
|
|
18
18
|
return "\n cursor: pointer;\n :hover {\n background-color: ".concat(themed({
|
|
19
|
-
light: N20,
|
|
20
|
-
dark: BACKGROUND_COLOR_DARK
|
|
19
|
+
light: token('color.background.neutral.subtle.hovered', N20),
|
|
20
|
+
dark: token('color.background.neutral.subtle.hovered', BACKGROUND_COLOR_DARK)
|
|
21
21
|
}), ";\n text-decoration: none;\n }\n :active {\n background-color: ").concat(themed({
|
|
22
|
-
light: B50,
|
|
23
|
-
dark: BACKGROUND_COLOR_DARK
|
|
22
|
+
light: token('color.background.selected', B50),
|
|
23
|
+
dark: token('color.background.selected', BACKGROUND_COLOR_DARK)
|
|
24
24
|
}), ";\n text-decoration: none;\n }\n :focus {\n ").concat(selected, "\n text-decoration: none;\n }\n ");
|
|
25
25
|
} else {
|
|
26
26
|
return '';
|
|
@@ -55,18 +55,21 @@ var withoutHover = function withoutHover(_ref3) {
|
|
|
55
55
|
// NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
export var Wrapper = styled.a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 16px;\n padding: 1px 0.24em 2px 0.24em;\n ", "\n display: inline;\n box-decoration-break: clone;\n border-radius: ", "px;\n color: ", ";\n background-color: ", ";\n ", "
|
|
58
|
+
export var Wrapper = styled.a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 16px;\n padding: 1px 0.24em 2px 0.24em;\n ", "\n display: inline;\n box-decoration-break: clone;\n border-radius: ", "px;\n color: ", ";\n background-color: ", ";\n ", "\n ", "\n ", ";\n ", "\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n\n &:hover span.", " {\n text-decoration: ", ";\n }\n"])), function (props) {
|
|
59
59
|
return props.withoutBackground ? "padding-left: 0; margin-left:-2px;" : '';
|
|
60
60
|
}, akBorderRadius(), themed({
|
|
61
|
-
light: B400,
|
|
62
|
-
dark: '#4794FF'
|
|
61
|
+
light: token('color.link', B400),
|
|
62
|
+
dark: token('color.link', '#4794FF')
|
|
63
63
|
}), function (props) {
|
|
64
64
|
return props.withoutBackground ? '' : themed({
|
|
65
|
-
light: 'white',
|
|
66
|
-
dark: BACKGROUND_COLOR_DARK
|
|
65
|
+
light: token('elevation.surface.raised', 'white'),
|
|
66
|
+
dark: token('elevation.surface.raised', 'BACKGROUND_COLOR_DARK')
|
|
67
67
|
});
|
|
68
68
|
}, function (props) {
|
|
69
|
-
return props.withoutBackground ? '' :
|
|
69
|
+
return props.withoutBackground ? '' : themed({
|
|
70
|
+
light: "box-shadow: ".concat(token('elevation.shadow.raised', "0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A)), ";"),
|
|
71
|
+
dark: "box-shadow: ".concat(token('elevation.shadow.raised', "0 1px 1px ".concat(DN50A, ", 0 0 1px 1px ").concat(DN40A)), ";")
|
|
72
|
+
});
|
|
70
73
|
}, function (props) {
|
|
71
74
|
return isInteractive(props);
|
|
72
75
|
}, function (props) {
|