@atlaskit/smart-card 34.2.2 → 34.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +201 -263
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +8 -13
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +5 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.compiled.css +34 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +33 -18
- package/dist/cjs/view/FlexibleCard/components/blocks/block/indexOld.js +56 -0
- 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/preview-block/index.js +12 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/indexOld.js +37 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.compiled.css +15 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +18 -52
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.js +104 -0
- 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/FlexibleCard/components/common/image-icon/index.js +4 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +63 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +61 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +20 -19
- package/dist/cjs/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +51 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.js +24 -24
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +66 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/index.js +31 -25
- package/dist/cjs/view/RelatedLinksModal/views/resolved/ResolvedOld.js +45 -0
- package/dist/cjs/view/RelatedLinksModal/views/resolved/index.js +16 -14
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +141 -0
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +56 -50
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +69 -55
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +1 -3
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.compiled.css +34 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +32 -35
- package/dist/es2019/view/FlexibleCard/components/blocks/block/indexOld.js +62 -0
- 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/preview-block/index.js +12 -8
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/indexOld.js +28 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.compiled.css +15 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +14 -62
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.js +106 -0
- 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/FlexibleCard/components/common/image-icon/index.js +1 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +55 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +55 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +19 -18
- package/dist/es2019/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +42 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.js +23 -22
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +58 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.js +28 -24
- package/dist/es2019/view/RelatedLinksModal/views/resolved/ResolvedOld.js +36 -0
- package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +16 -13
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +133 -0
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +53 -49
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +116 -162
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +1 -3
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +1 -4
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.compiled.css +34 -0
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +31 -20
- package/dist/esm/view/FlexibleCard/components/blocks/block/indexOld.js +50 -0
- 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/preview-block/index.js +12 -8
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/indexOld.js +30 -0
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.compiled.css +15 -0
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +15 -53
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.js +98 -0
- 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/FlexibleCard/components/common/image-icon/index.js +1 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +53 -0
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +54 -0
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +19 -18
- package/dist/esm/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +43 -0
- package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.js +24 -23
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +58 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.js +28 -24
- package/dist/esm/view/RelatedLinksModal/views/resolved/ResolvedOld.js +37 -0
- package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +16 -13
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +133 -0
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +53 -49
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +3 -10
- package/dist/types/view/FlexibleCard/components/blocks/block/indexOld.d.ts +11 -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/preview-block/index.d.ts +3 -13
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/indexOld.d.ts +14 -0
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/resolved/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.d.ts +16 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.d.ts +15 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +5 -7
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -13
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.d.ts +9 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +8 -2
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.d.ts +14 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +5 -3
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +2 -0
- package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-links-list/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.d.ts +6 -0
- package/dist/types/view/RelatedLinksModal/views/errored/error-svg/index.d.ts +2 -6
- package/dist/types/view/RelatedLinksModal/views/resolved/ResolvedOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/views/resolved/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.d.ts +6 -0
- package/dist/types/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.d.ts +2 -6
- package/dist/types-ts4.5/utils/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/block/index.d.ts +3 -10
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/block/indexOld.d.ts +11 -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/preview-block/index.d.ts +3 -13
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/indexOld.d.ts +14 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/resolved/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.d.ts +16 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.d.ts +15 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +5 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -13
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.d.ts +9 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +8 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.d.ts +14 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +5 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +2 -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 +4 -4
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "icon", "theme", "hideRetry", "metadataPosition", "hideIcon"];
|
|
5
|
+
import React, { useCallback, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { css } from '@emotion/react';
|
|
9
|
+
import { SmartLinkStatus } from '../../../../../constants';
|
|
10
|
+
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
11
|
+
import { Title } from '../../elements';
|
|
12
|
+
import ActionGroup from '../action-group';
|
|
13
|
+
import TitleBlockErroredView from './errored';
|
|
14
|
+
import TitleBlockResolvedView from './resolved';
|
|
15
|
+
import TitleBlockResolvingView from './resolving';
|
|
16
|
+
var getActionStyles = function getActionStyles(showOnHover, isOpen) {
|
|
17
|
+
if (showOnHover && !isOpen) {
|
|
18
|
+
return css({
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
20
|
+
'.actions-button-group': {
|
|
21
|
+
opacity: 0
|
|
22
|
+
},
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
24
|
+
'&:hover .actions-button-group, .actions-button-group:focus-within': {
|
|
25
|
+
opacity: 1
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var getTitleBlockViewComponent = function getTitleBlockViewComponent(status) {
|
|
31
|
+
switch (status) {
|
|
32
|
+
case SmartLinkStatus.Pending:
|
|
33
|
+
case SmartLinkStatus.Resolving:
|
|
34
|
+
return TitleBlockResolvingView;
|
|
35
|
+
case SmartLinkStatus.Resolved:
|
|
36
|
+
return TitleBlockResolvedView;
|
|
37
|
+
case SmartLinkStatus.Unauthorized:
|
|
38
|
+
case SmartLinkStatus.Forbidden:
|
|
39
|
+
case SmartLinkStatus.NotFound:
|
|
40
|
+
case SmartLinkStatus.Errored:
|
|
41
|
+
case SmartLinkStatus.Fallback:
|
|
42
|
+
default:
|
|
43
|
+
return TitleBlockErroredView;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Represents a TitleBlock, which is the foundation of Flexible UI.
|
|
49
|
+
* This contains an icon, the link, and any associated metadata and actions in one block.
|
|
50
|
+
* The TitleBlock will also render differently given the state of the smart link.
|
|
51
|
+
* This can be found in the corresponding Resolving, Resolved and Errored views.
|
|
52
|
+
* @public
|
|
53
|
+
* @param {TitleBlockProps} TitleBlockProps
|
|
54
|
+
* @see Block
|
|
55
|
+
* @see TitleBlockResolvingView
|
|
56
|
+
* @see TitleBlockResolvedView
|
|
57
|
+
* @see TitleBlockErroredView
|
|
58
|
+
*/
|
|
59
|
+
var TitleBlock = function TitleBlock(_ref) {
|
|
60
|
+
var _ref$actions = _ref.actions,
|
|
61
|
+
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
62
|
+
anchorTarget = _ref.anchorTarget,
|
|
63
|
+
hideTitleTooltip = _ref.hideTitleTooltip,
|
|
64
|
+
maxLines = _ref.maxLines,
|
|
65
|
+
onActionMenuOpenChange = _ref.onActionMenuOpenChange,
|
|
66
|
+
onClick = _ref.onClick,
|
|
67
|
+
overrideCss = _ref.overrideCss,
|
|
68
|
+
_ref$status = _ref.status,
|
|
69
|
+
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
70
|
+
showActionOnHover = _ref.showActionOnHover,
|
|
71
|
+
_ref$testId = _ref.testId,
|
|
72
|
+
testId = _ref$testId === void 0 ? 'smart-block-title' : _ref$testId,
|
|
73
|
+
text = _ref.text,
|
|
74
|
+
icon = _ref.icon,
|
|
75
|
+
theme = _ref.theme,
|
|
76
|
+
hideRetry = _ref.hideRetry,
|
|
77
|
+
metadataPosition = _ref.metadataPosition,
|
|
78
|
+
_ref$hideIcon = _ref.hideIcon,
|
|
79
|
+
hideIcon = _ref$hideIcon === void 0 ? false : _ref$hideIcon,
|
|
80
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
81
|
+
if (hideRetry && props.retry) {
|
|
82
|
+
delete props.retry;
|
|
83
|
+
}
|
|
84
|
+
var _useState = useState(false),
|
|
85
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
86
|
+
actionDropdownOpen = _useState2[0],
|
|
87
|
+
setActionDropdownOpen = _useState2[1];
|
|
88
|
+
var onDropdownOpenChange = useCallback(function (isOpen) {
|
|
89
|
+
setActionDropdownOpen(isOpen);
|
|
90
|
+
if (onActionMenuOpenChange) {
|
|
91
|
+
onActionMenuOpenChange({
|
|
92
|
+
isOpen: isOpen
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, [onActionMenuOpenChange]);
|
|
96
|
+
var actionGroup = actions.length > 0 && /*#__PURE__*/React.createElement(ActionGroup, {
|
|
97
|
+
items: actions,
|
|
98
|
+
visibleButtonsNum: showActionOnHover ? 1 : 2,
|
|
99
|
+
onDropdownOpenChange: onDropdownOpenChange
|
|
100
|
+
});
|
|
101
|
+
var actionStyles = getActionStyles(showActionOnHover, actionDropdownOpen);
|
|
102
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
103
|
+
var combinedCss = css(actionStyles, overrideCss);
|
|
104
|
+
var overrideText = !!text ? {
|
|
105
|
+
text: text
|
|
106
|
+
} : {};
|
|
107
|
+
var onMouseDown = useMouseDownEvent();
|
|
108
|
+
var title = /*#__PURE__*/React.createElement(Title, _extends({
|
|
109
|
+
hideTooltip: hideTitleTooltip,
|
|
110
|
+
maxLines: maxLines,
|
|
111
|
+
onClick: onClick,
|
|
112
|
+
onMouseDown: onMouseDown,
|
|
113
|
+
target: anchorTarget,
|
|
114
|
+
theme: theme
|
|
115
|
+
}, overrideText));
|
|
116
|
+
var Component = getTitleBlockViewComponent(status);
|
|
117
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
118
|
+
actionGroup: actionGroup,
|
|
119
|
+
overrideCss: combinedCss,
|
|
120
|
+
testId: testId,
|
|
121
|
+
title: title,
|
|
122
|
+
metadataPosition: metadataPosition,
|
|
123
|
+
hideIcon: hideIcon,
|
|
124
|
+
icon: icon
|
|
125
|
+
}));
|
|
126
|
+
};
|
|
127
|
+
export default TitleBlock;
|
package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
10
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
11
|
+
import { Box } from '@atlaskit/primitives';
|
|
12
|
+
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize } from '../../../../../../constants';
|
|
13
|
+
import { LinkIcon } from '../../../elements';
|
|
14
|
+
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
|
|
15
|
+
import Block from '../../block';
|
|
16
|
+
import ElementGroup from '../../element-group';
|
|
17
|
+
var actionStyles = css({
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
20
|
+
':hover': {
|
|
21
|
+
color: "var(--ds-text-subtle, #8993A4)",
|
|
22
|
+
textDecoration: 'underline'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var actionHoverStyles = css({
|
|
26
|
+
position: 'relative',
|
|
27
|
+
zIndex: 1,
|
|
28
|
+
'&:focus': {
|
|
29
|
+
outlineOffset: "var(--ds-space-negative-025, -2px)"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* This function does not work in the component below as it needs to be xcss.
|
|
35
|
+
* The component instead uses inherited styles
|
|
36
|
+
*/
|
|
37
|
+
var getMessageStyles = function getMessageStyles(size, hasAction) {
|
|
38
|
+
var sizeStyles = getLinkSizeStyles(size);
|
|
39
|
+
return css({
|
|
40
|
+
flex: '1 1 auto',
|
|
41
|
+
justifyContent: 'flex-end'
|
|
42
|
+
},
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
44
|
+
hasAction ? actionStyles : '',
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
46
|
+
sizeStyles,
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
48
|
+
getTruncateStyles(1, getLinkLineHeight(size)), {
|
|
49
|
+
color: "var(--ds-text-disabled, #6B778C)",
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
51
|
+
':focus': {
|
|
52
|
+
outline: "var(--ds-border-focused, #388BFF)".concat(" solid 2px")
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
56
|
+
hasAction ? actionHoverStyles : '');
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Represents an Errored TitleBlock view.
|
|
61
|
+
* This will render when a Smart Link did not successfully resolve.
|
|
62
|
+
* This may be a result of a Smart Link not having the correct credentials,
|
|
63
|
+
* or the backend response was errored or malformed.
|
|
64
|
+
* @see TitleBlock
|
|
65
|
+
*/
|
|
66
|
+
var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
67
|
+
var actionGroup = _ref.actionGroup,
|
|
68
|
+
retry = _ref.retry,
|
|
69
|
+
position = _ref.position,
|
|
70
|
+
testId = _ref.testId,
|
|
71
|
+
title = _ref.title,
|
|
72
|
+
icon = _ref.icon,
|
|
73
|
+
hideIcon = _ref.hideIcon,
|
|
74
|
+
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
75
|
+
var _ref2 = retry || {},
|
|
76
|
+
descriptor = _ref2.descriptor,
|
|
77
|
+
onClick = _ref2.onClick,
|
|
78
|
+
values = _ref2.values;
|
|
79
|
+
var _blockProps$size = blockProps.size,
|
|
80
|
+
size = _blockProps$size === void 0 ? SmartLinkSize.Medium : _blockProps$size;
|
|
81
|
+
var hasAction = onClick !== undefined;
|
|
82
|
+
return jsx(Block, _extends({}, blockProps, {
|
|
83
|
+
testId: "".concat(testId, "-errored-view")
|
|
84
|
+
}), !hideIcon && jsx(LinkIcon, {
|
|
85
|
+
overrideIcon: icon,
|
|
86
|
+
position: position
|
|
87
|
+
}), title, descriptor && jsx(ElementGroup, {
|
|
88
|
+
direction: SmartLinkDirection.Horizontal,
|
|
89
|
+
align: SmartLinkAlignment.Right
|
|
90
|
+
}, jsx(Box
|
|
91
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
92
|
+
, {
|
|
93
|
+
xcss: getMessageStyles(size, hasAction),
|
|
94
|
+
onClick: onClick,
|
|
95
|
+
testId: "".concat(testId, "-errored-view-message"),
|
|
96
|
+
tabIndex: hasAction ? 0 : -1
|
|
97
|
+
}, jsx(FormattedMessage, _extends({}, descriptor, {
|
|
98
|
+
values: values
|
|
99
|
+
})))), actionGroup);
|
|
100
|
+
};
|
|
101
|
+
export default TitleBlockErroredView;
|
|
@@ -1,55 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
4
|
-
|
|
5
|
-
* @jsxRuntime classic
|
|
6
|
-
* @jsx jsx
|
|
7
|
-
*/
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import React from 'react';
|
|
10
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
11
6
|
import { Box } from '@atlaskit/primitives';
|
|
12
|
-
import { SmartLinkAlignment, SmartLinkDirection
|
|
7
|
+
import { SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
13
8
|
import { LinkIcon } from '../../../elements';
|
|
14
|
-
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
|
|
15
9
|
import Block from '../../block';
|
|
16
10
|
import ElementGroup from '../../element-group';
|
|
17
|
-
|
|
18
|
-
cursor: 'pointer',
|
|
19
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
20
|
-
':hover': {
|
|
21
|
-
color: "var(--ds-text-subtle, #8993A4)",
|
|
22
|
-
textDecoration: 'underline'
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
var actionHoverStyles = css({
|
|
26
|
-
position: 'relative',
|
|
27
|
-
zIndex: 1,
|
|
28
|
-
'&:focus': {
|
|
29
|
-
outlineOffset: "var(--ds-space-negative-025, -2px)"
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
var getMessageStyles = function getMessageStyles(size, hasAction) {
|
|
33
|
-
var sizeStyles = getLinkSizeStyles(size);
|
|
34
|
-
return css({
|
|
35
|
-
flex: '1 1 auto',
|
|
36
|
-
justifyContent: 'flex-end'
|
|
37
|
-
},
|
|
38
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
39
|
-
hasAction ? actionStyles : '',
|
|
40
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
41
|
-
sizeStyles,
|
|
42
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
43
|
-
getTruncateStyles(1, getLinkLineHeight(size)), {
|
|
44
|
-
color: "var(--ds-text-disabled, #6B778C)",
|
|
45
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
46
|
-
':focus': {
|
|
47
|
-
outline: "var(--ds-border-focused, #388BFF)".concat(" solid 2px")
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
51
|
-
hasAction ? actionHoverStyles : '');
|
|
52
|
-
};
|
|
11
|
+
import TitleBlockErroredViewOld from './TitleBlockErroredViewOld';
|
|
53
12
|
|
|
54
13
|
/**
|
|
55
14
|
* Represents an Errored TitleBlock view.
|
|
@@ -58,7 +17,7 @@ var getMessageStyles = function getMessageStyles(size, hasAction) {
|
|
|
58
17
|
* or the backend response was errored or malformed.
|
|
59
18
|
* @see TitleBlock
|
|
60
19
|
*/
|
|
61
|
-
var
|
|
20
|
+
var TitleBlockErroredViewNew = function TitleBlockErroredViewNew(_ref) {
|
|
62
21
|
var actionGroup = _ref.actionGroup,
|
|
63
22
|
retry = _ref.retry,
|
|
64
23
|
position = _ref.position,
|
|
@@ -71,26 +30,22 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
71
30
|
descriptor = _ref2.descriptor,
|
|
72
31
|
onClick = _ref2.onClick,
|
|
73
32
|
values = _ref2.values;
|
|
74
|
-
var _blockProps$size = blockProps.size,
|
|
75
|
-
size = _blockProps$size === void 0 ? SmartLinkSize.Medium : _blockProps$size;
|
|
76
33
|
var hasAction = onClick !== undefined;
|
|
77
|
-
return
|
|
34
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
78
35
|
testId: "".concat(testId, "-errored-view")
|
|
79
|
-
}), !hideIcon &&
|
|
36
|
+
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
80
37
|
overrideIcon: icon,
|
|
81
38
|
position: position
|
|
82
|
-
}), title, descriptor &&
|
|
39
|
+
}), title, descriptor && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
83
40
|
direction: SmartLinkDirection.Horizontal,
|
|
84
41
|
align: SmartLinkAlignment.Right
|
|
85
|
-
},
|
|
86
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
87
|
-
, {
|
|
88
|
-
xcss: getMessageStyles(size, hasAction),
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
89
43
|
onClick: onClick,
|
|
90
44
|
testId: "".concat(testId, "-errored-view-message"),
|
|
91
45
|
tabIndex: hasAction ? 0 : -1
|
|
92
|
-
},
|
|
46
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
|
|
93
47
|
values: values
|
|
94
48
|
})))), actionGroup);
|
|
95
49
|
};
|
|
96
|
-
export default
|
|
50
|
+
export default TitleBlockErroredViewOld;
|
|
51
|
+
export { TitleBlockErroredViewNew };
|
|
@@ -1,46 +1,37 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
5
|
+
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "status", "showActionOnHover", "testId", "text", "icon", "theme", "hideRetry", "metadataPosition", "hideIcon", "className"];
|
|
6
|
+
import "./index.compiled.css";
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
|
+
import { useCallback, useState } from 'react';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
11
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
10
12
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
11
13
|
import { Title } from '../../elements';
|
|
12
14
|
import ActionGroup from '../action-group';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
20
|
-
'.actions-button-group': {
|
|
21
|
-
opacity: 0
|
|
22
|
-
},
|
|
23
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
24
|
-
'&:hover .actions-button-group, .actions-button-group:focus-within': {
|
|
25
|
-
opacity: 1
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
};
|
|
15
|
+
import { TitleBlockErroredViewNew } from './errored';
|
|
16
|
+
import { TitleBlockResolvedViewNew } from './resolved';
|
|
17
|
+
import { TitleBlockResolvingViewNew } from './resolving';
|
|
18
|
+
import TitleBlockOld from './TitleBlockOld';
|
|
19
|
+
var styles = null;
|
|
20
|
+
var actionStyles = null;
|
|
30
21
|
var getTitleBlockViewComponent = function getTitleBlockViewComponent(status) {
|
|
31
22
|
switch (status) {
|
|
32
23
|
case SmartLinkStatus.Pending:
|
|
33
24
|
case SmartLinkStatus.Resolving:
|
|
34
|
-
return
|
|
25
|
+
return TitleBlockResolvingViewNew;
|
|
35
26
|
case SmartLinkStatus.Resolved:
|
|
36
|
-
return
|
|
27
|
+
return TitleBlockResolvedViewNew;
|
|
37
28
|
case SmartLinkStatus.Unauthorized:
|
|
38
29
|
case SmartLinkStatus.Forbidden:
|
|
39
30
|
case SmartLinkStatus.NotFound:
|
|
40
31
|
case SmartLinkStatus.Errored:
|
|
41
32
|
case SmartLinkStatus.Fallback:
|
|
42
33
|
default:
|
|
43
|
-
return
|
|
34
|
+
return TitleBlockErroredViewNew;
|
|
44
35
|
}
|
|
45
36
|
};
|
|
46
37
|
|
|
@@ -52,11 +43,11 @@ var getTitleBlockViewComponent = function getTitleBlockViewComponent(status) {
|
|
|
52
43
|
* @public
|
|
53
44
|
* @param {TitleBlockProps} TitleBlockProps
|
|
54
45
|
* @see Block
|
|
55
|
-
* @see
|
|
56
|
-
* @see
|
|
57
|
-
* @see
|
|
46
|
+
* @see TitleBlockResolvingViewNew
|
|
47
|
+
* @see TitleBlockResolvedViewNew
|
|
48
|
+
* @see TitleBlockErroredViewNew
|
|
58
49
|
*/
|
|
59
|
-
var
|
|
50
|
+
var TitleBlockNew = function TitleBlockNew(_ref) {
|
|
60
51
|
var _ref$actions = _ref.actions,
|
|
61
52
|
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
62
53
|
anchorTarget = _ref.anchorTarget,
|
|
@@ -64,7 +55,6 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
64
55
|
maxLines = _ref.maxLines,
|
|
65
56
|
onActionMenuOpenChange = _ref.onActionMenuOpenChange,
|
|
66
57
|
onClick = _ref.onClick,
|
|
67
|
-
overrideCss = _ref.overrideCss,
|
|
68
58
|
_ref$status = _ref.status,
|
|
69
59
|
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
70
60
|
showActionOnHover = _ref.showActionOnHover,
|
|
@@ -77,6 +67,7 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
77
67
|
metadataPosition = _ref.metadataPosition,
|
|
78
68
|
_ref$hideIcon = _ref.hideIcon,
|
|
79
69
|
hideIcon = _ref$hideIcon === void 0 ? false : _ref$hideIcon,
|
|
70
|
+
className = _ref.className,
|
|
80
71
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
81
72
|
if (hideRetry && props.retry) {
|
|
82
73
|
delete props.retry;
|
|
@@ -98,9 +89,6 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
98
89
|
visibleButtonsNum: showActionOnHover ? 1 : 2,
|
|
99
90
|
onDropdownOpenChange: onDropdownOpenChange
|
|
100
91
|
});
|
|
101
|
-
var actionStyles = getActionStyles(showActionOnHover, actionDropdownOpen);
|
|
102
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
103
|
-
var combinedCss = css(actionStyles, overrideCss);
|
|
104
92
|
var overrideText = !!text ? {
|
|
105
93
|
text: text
|
|
106
94
|
} : {};
|
|
@@ -114,14 +102,25 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
114
102
|
theme: theme
|
|
115
103
|
}, overrideText));
|
|
116
104
|
var Component = getTitleBlockViewComponent(status);
|
|
117
|
-
return /*#__PURE__*/React.createElement(
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: ax([showActionOnHover && !actionDropdownOpen && "_1bfhidpf _wn5xkb7n _h157kb7n"])
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
108
|
+
actionGroup: actionGroup
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
110
|
+
,
|
|
111
|
+
className: className,
|
|
120
112
|
testId: testId,
|
|
121
113
|
title: title,
|
|
122
114
|
metadataPosition: metadataPosition,
|
|
123
115
|
hideIcon: hideIcon,
|
|
124
116
|
icon: icon
|
|
125
|
-
}));
|
|
117
|
+
})));
|
|
118
|
+
};
|
|
119
|
+
var TitleBlock = function TitleBlock(props) {
|
|
120
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
121
|
+
return /*#__PURE__*/React.createElement(TitleBlockNew, props);
|
|
122
|
+
} else {
|
|
123
|
+
return /*#__PURE__*/React.createElement(TitleBlockOld, props);
|
|
124
|
+
}
|
|
126
125
|
};
|
|
127
126
|
export default TitleBlock;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "icon", "title", "metadataPosition", "hideIcon"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
import { css } from '@emotion/react';
|
|
8
|
+
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkWidth } from '../../../../../../constants';
|
|
9
|
+
import { LinkIcon } from '../../../elements';
|
|
10
|
+
import Block from '../../block';
|
|
11
|
+
import ElementGroup from '../../element-group';
|
|
12
|
+
import { renderElementItems } from '../../utils';
|
|
13
|
+
/**
|
|
14
|
+
* This renders a fully resolved TitleBlock.
|
|
15
|
+
* This should render when a Smart Link returns a valid response.
|
|
16
|
+
* @see TitleBlock
|
|
17
|
+
*/
|
|
18
|
+
var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
19
|
+
var actionGroup = _ref.actionGroup,
|
|
20
|
+
_ref$metadata = _ref.metadata,
|
|
21
|
+
metadata = _ref$metadata === void 0 ? [] : _ref$metadata,
|
|
22
|
+
position = _ref.position,
|
|
23
|
+
_ref$subtitle = _ref.subtitle,
|
|
24
|
+
subtitle = _ref$subtitle === void 0 ? [] : _ref$subtitle,
|
|
25
|
+
testId = _ref.testId,
|
|
26
|
+
text = _ref.text,
|
|
27
|
+
icon = _ref.icon,
|
|
28
|
+
title = _ref.title,
|
|
29
|
+
metadataPosition = _ref.metadataPosition,
|
|
30
|
+
hideIcon = _ref.hideIcon,
|
|
31
|
+
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
var metadataElements = renderElementItems(metadata);
|
|
33
|
+
var subtitleElements = renderElementItems(subtitle);
|
|
34
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
35
|
+
testId: "".concat(testId, "-resolved-view")
|
|
36
|
+
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
37
|
+
overrideIcon: icon,
|
|
38
|
+
position: position
|
|
39
|
+
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
40
|
+
direction: SmartLinkDirection.Vertical,
|
|
41
|
+
width: SmartLinkWidth.Flexible,
|
|
42
|
+
overrideCss: css({
|
|
43
|
+
gap: "var(--ds-space-050, 0.25rem)"
|
|
44
|
+
})
|
|
45
|
+
}, title, subtitleElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
46
|
+
direction: SmartLinkDirection.Horizontal
|
|
47
|
+
}, subtitleElements)), metadataElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
48
|
+
direction: SmartLinkDirection.Horizontal,
|
|
49
|
+
align: SmartLinkAlignment.Right,
|
|
50
|
+
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center
|
|
51
|
+
}, metadataElements), actionGroup);
|
|
52
|
+
};
|
|
53
|
+
export default TitleBlockResolvedView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._zulppdf9{gap:var(--ds-space-050,.25rem)}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "icon", "title", "metadataPosition", "hideIcon"];
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import "./index.compiled.css";
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
8
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkWidth } from '../../../../../../constants';
|
|
9
9
|
import { LinkIcon } from '../../../elements';
|
|
10
10
|
import Block from '../../block';
|
|
11
|
-
import ElementGroup from '../../element-group';
|
|
11
|
+
import { ElementGroupNew as ElementGroup } from '../../element-group';
|
|
12
12
|
import { renderElementItems } from '../../utils';
|
|
13
|
+
import TitleBlockResolvedViewOld from './TitleBlockResolvedViewOld';
|
|
14
|
+
var style = null;
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* This renders a fully resolved TitleBlock.
|
|
15
18
|
* This should render when a Smart Link returns a valid response.
|
|
16
19
|
* @see TitleBlock
|
|
17
20
|
*/
|
|
18
|
-
var
|
|
21
|
+
var TitleBlockResolvedViewNew = function TitleBlockResolvedViewNew(_ref) {
|
|
19
22
|
var actionGroup = _ref.actionGroup,
|
|
20
23
|
_ref$metadata = _ref.metadata,
|
|
21
24
|
metadata = _ref$metadata === void 0 ? [] : _ref$metadata,
|
|
@@ -39,15 +42,16 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
39
42
|
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
40
43
|
direction: SmartLinkDirection.Vertical,
|
|
41
44
|
width: SmartLinkWidth.Flexible,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
+
size: blockProps.size,
|
|
46
|
+
className: ax(["_zulppdf9"])
|
|
45
47
|
}, title, subtitleElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
46
48
|
direction: SmartLinkDirection.Horizontal
|
|
47
49
|
}, subtitleElements)), metadataElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
48
50
|
direction: SmartLinkDirection.Horizontal,
|
|
49
51
|
align: SmartLinkAlignment.Right,
|
|
50
|
-
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center
|
|
52
|
+
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center,
|
|
53
|
+
size: blockProps.size
|
|
51
54
|
}, metadataElements), actionGroup);
|
|
52
55
|
};
|
|
53
|
-
export default
|
|
56
|
+
export default TitleBlockResolvedViewOld;
|
|
57
|
+
export { TitleBlockResolvedViewNew };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
+
import { jsx } from '@emotion/react';
|
|
11
|
+
import { SmartLinkSize } from '../../../../../../constants';
|
|
12
|
+
import LoadingSkeleton from '../../../common/loading-skeleton';
|
|
13
|
+
import { getIconSizeStyles, getIconWidth } from '../../../utils';
|
|
14
|
+
import Block from '../../block';
|
|
15
|
+
/**
|
|
16
|
+
* This represents a TitleBlock for a Smart Link that is currently waiting
|
|
17
|
+
* for a request to finish.
|
|
18
|
+
* This should render when a Smart Link has sent a request.
|
|
19
|
+
* @see TitleBlock
|
|
20
|
+
*/
|
|
21
|
+
var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
|
|
22
|
+
var actionGroup = _ref.actionGroup,
|
|
23
|
+
testId = _ref.testId,
|
|
24
|
+
title = _ref.title,
|
|
25
|
+
hideIcon = _ref.hideIcon,
|
|
26
|
+
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
var _blockProps$size = blockProps.size,
|
|
28
|
+
size = _blockProps$size === void 0 ? SmartLinkSize.Medium : _blockProps$size;
|
|
29
|
+
var iconWidth = getIconWidth(size);
|
|
30
|
+
var iconStyles = getIconSizeStyles(iconWidth);
|
|
31
|
+
return jsx(Block, _extends({}, blockProps, {
|
|
32
|
+
testId: "".concat(testId, "-resolving-view")
|
|
33
|
+
}), !hideIcon &&
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
35
|
+
jsx("span", {
|
|
36
|
+
css: iconStyles,
|
|
37
|
+
"data-testid": "".concat(testId, "-icon")
|
|
38
|
+
}, jsx(LoadingSkeleton, {
|
|
39
|
+
testId: "".concat(testId, "-icon-loading")
|
|
40
|
+
})), title, actionGroup);
|
|
41
|
+
};
|
|
42
|
+
export default TitleBlockResolvingView;
|