@atlaskit/smart-card 43.28.6 → 43.29.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 +20 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-status-lozenge--default--platform-dst-lozenge-tag-badge-visual-uplifts-false.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-status-lozenge--default--platform-dst-lozenge-tag-badge-visual-uplifts-true.png +3 -0
- package/dist/cjs/messages.js +8 -7
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/index.compiled.css +5 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js +18 -5
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/error-boundary/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.compiled.css +4 -0
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +19 -4
- package/dist/cjs/view/FlexibleCard/components/elements/due-on-element/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/elements/state-element/index.js +24 -3
- package/dist/cjs/view/InlineCard/Frame/styled.compiled.css +1 -1
- package/dist/cjs/view/InlineCard/Frame/styled.js +2 -2
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +25 -4
- package/dist/cjs/view/InlineCard/common/inline-lozenge/index.compiled.css +1 -0
- package/dist/cjs/view/InlineCard/common/inline-lozenge/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-status-lozenge--default--platform-dst-lozenge-tag-badge-visual-uplifts-false.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-status-lozenge--default--platform-dst-lozenge-tag-badge-visual-uplifts-true.png +3 -0
- package/dist/es2019/messages.js +8 -7
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/index.compiled.css +5 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js +18 -5
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/error-boundary/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.compiled.css +4 -0
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +18 -3
- package/dist/es2019/view/FlexibleCard/components/elements/due-on-element/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/state-element/index.js +22 -3
- package/dist/es2019/view/InlineCard/Frame/styled.compiled.css +1 -1
- package/dist/es2019/view/InlineCard/Frame/styled.js +2 -2
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +22 -4
- package/dist/es2019/view/InlineCard/common/inline-lozenge/index.compiled.css +1 -0
- package/dist/es2019/view/InlineCard/common/inline-lozenge/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-status-lozenge--default--platform-dst-lozenge-tag-badge-visual-uplifts-false.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-status-lozenge--default--platform-dst-lozenge-tag-badge-visual-uplifts-true.png +3 -0
- package/dist/esm/messages.js +8 -7
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/index.compiled.css +5 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js +18 -5
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/error-boundary/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.compiled.css +4 -0
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +19 -4
- package/dist/esm/view/FlexibleCard/components/elements/due-on-element/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/elements/state-element/index.js +22 -3
- package/dist/esm/view/InlineCard/Frame/styled.compiled.css +1 -1
- package/dist/esm/view/InlineCard/Frame/styled.js +2 -2
- package/dist/esm/view/InlineCard/ResolvedView/index.js +25 -4
- package/dist/esm/view/InlineCard/common/inline-lozenge/index.compiled.css +1 -0
- package/dist/esm/view/InlineCard/common/inline-lozenge/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/index.d.ts +9 -1
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/type.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/types.d.ts +1 -0
- package/dist/types/view/InlineCard/common/inline-lozenge/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/index.d.ts +9 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/type.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/types.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/common/inline-lozenge/index.d.ts +2 -2
- package/package.json +8 -4
package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import "./index.compiled.css";
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
6
|
import { FormattedDate } from 'react-intl-next';
|
|
6
7
|
import AtlaskitLozenge from '@atlaskit/lozenge';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { SimpleTag as Tag } from '@atlaskit/tag';
|
|
7
10
|
import { useFlexibleUiOptionContext } from '../../../../../../state/flexible-ui-context';
|
|
8
11
|
import LozengeAction from './lozenge-action';
|
|
9
12
|
const styles = null;
|
|
13
|
+
const dueOnStyles = null;
|
|
10
14
|
/**
|
|
11
15
|
* A base element that displays a Lozenge.
|
|
12
16
|
* @internal
|
|
@@ -22,13 +26,15 @@ const BaseLozengeElement = ({
|
|
|
22
26
|
onAfterChanged,
|
|
23
27
|
style,
|
|
24
28
|
text,
|
|
25
|
-
testId = 'smart-element-lozenge'
|
|
29
|
+
testId = 'smart-element-lozenge',
|
|
30
|
+
isDateTag,
|
|
31
|
+
trailingMetric
|
|
26
32
|
}) => {
|
|
27
33
|
const ui = useFlexibleUiOptionContext();
|
|
28
34
|
if (!text) {
|
|
29
35
|
return null;
|
|
30
36
|
}
|
|
31
|
-
const lozenge = action ? /*#__PURE__*/React.createElement(LozengeAction, {
|
|
37
|
+
const lozenge = action ? /*#__PURE__*/React.createElement(LozengeAction, _extends({
|
|
32
38
|
action: action,
|
|
33
39
|
appearance: appearance,
|
|
34
40
|
maxWidth: maxWidth,
|
|
@@ -36,7 +42,12 @@ const BaseLozengeElement = ({
|
|
|
36
42
|
text: text,
|
|
37
43
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex,
|
|
38
44
|
onAfterChanged: onAfterChanged
|
|
39
|
-
}
|
|
45
|
+
}, trailingMetric && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? {
|
|
46
|
+
trailingMetric
|
|
47
|
+
} : undefined)) : isDateTag ? /*#__PURE__*/React.createElement(Tag, {
|
|
48
|
+
text: text,
|
|
49
|
+
migration_fallback: "lozenge"
|
|
50
|
+
}) : /*#__PURE__*/React.createElement(AtlaskitLozenge, _extends({
|
|
40
51
|
appearance: appearance,
|
|
41
52
|
isBold: true,
|
|
42
53
|
maxWidth: maxWidth
|
|
@@ -44,14 +55,16 @@ const BaseLozengeElement = ({
|
|
|
44
55
|
,
|
|
45
56
|
style: style,
|
|
46
57
|
testId: `${testId}-lozenge`
|
|
47
|
-
},
|
|
58
|
+
}, trailingMetric && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? {
|
|
59
|
+
trailingMetric
|
|
60
|
+
} : undefined), text);
|
|
48
61
|
return /*#__PURE__*/React.createElement("span", {
|
|
49
62
|
"data-smart-element": name,
|
|
50
63
|
"data-smart-element-lozenge": true,
|
|
51
64
|
"data-testid": testId
|
|
52
65
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
53
66
|
,
|
|
54
|
-
className: ax(["_1e0c116y _1ul91ns9", className])
|
|
67
|
+
className: ax(["_1e0c116y _1ul91ns9", isDateTag && fg('platform-dst-lozenge-tag-badge-visual-uplifts') && "_19pkr5cr _2hwxr5cr _otyrr5cr _18u0r5cr", className])
|
|
55
68
|
}, lozenge);
|
|
56
69
|
};
|
|
57
70
|
export default BaseLozengeElement;
|
|
@@ -7,9 +7,10 @@ const withErrorBoundary = Component => props => {
|
|
|
7
7
|
return /*#__PURE__*/React.createElement(Lozenge, {
|
|
8
8
|
appearance: props === null || props === void 0 ? void 0 : props.appearance,
|
|
9
9
|
isBold: true,
|
|
10
|
-
testId: `${(_props$testId = props === null || props === void 0 ? void 0 : props.testId) !== null && _props$testId !== void 0 ? _props$testId : 'smart-element-lozenge-action'}-fallback
|
|
10
|
+
testId: `${(_props$testId = props === null || props === void 0 ? void 0 : props.testId) !== null && _props$testId !== void 0 ? _props$testId : 'smart-element-lozenge-action'}-fallback`,
|
|
11
|
+
trailingMetric: props === null || props === void 0 ? void 0 : props.trailingMetric
|
|
11
12
|
}, props === null || props === void 0 ? void 0 : props.text);
|
|
12
|
-
}, [props === null || props === void 0 ? void 0 : props.appearance, props === null || props === void 0 ? void 0 : props.testId, props === null || props === void 0 ? void 0 : props.text]);
|
|
13
|
+
}, [props === null || props === void 0 ? void 0 : props.appearance, props === null || props === void 0 ? void 0 : props.testId, props === null || props === void 0 ? void 0 : props.text, props === null || props === void 0 ? void 0 : props.trailingMetric]);
|
|
13
14
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
14
15
|
fallback: fallback
|
|
15
16
|
}, /*#__PURE__*/React.createElement(Component, props));
|
|
@@ -26,6 +26,7 @@ const LozengeAction = ({
|
|
|
26
26
|
text,
|
|
27
27
|
zIndex,
|
|
28
28
|
onAfterChanged,
|
|
29
|
+
trailingMetric,
|
|
29
30
|
shouldRenderToParent = false
|
|
30
31
|
}) => {
|
|
31
32
|
var _action$update;
|
|
@@ -91,8 +92,9 @@ const LozengeAction = ({
|
|
|
91
92
|
isOpen: isOpen,
|
|
92
93
|
maxWidth: maxWidth,
|
|
93
94
|
testId: testId,
|
|
94
|
-
text: selected.text
|
|
95
|
-
|
|
95
|
+
text: selected.text,
|
|
96
|
+
trailingMetric: trailingMetric
|
|
97
|
+
})), [selected.appearance, selected.text, isOpen, maxWidth, testId, trailingMetric]);
|
|
96
98
|
const handleItemClick = useCallback(async (id, text, appearance) => {
|
|
97
99
|
try {
|
|
98
100
|
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
._18m915vq{overflow-y:hidden}
|
|
12
12
|
._18u012x7{margin-left:var(--ds-space-075,6px)}
|
|
13
13
|
._18u0v77o{margin-left:var(--ds-space-025,2px)}
|
|
14
|
+
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
14
15
|
._19bvidpf{padding-left:0}
|
|
15
16
|
._19pkv77o{margin-top:var(--ds-space-025,2px)}
|
|
16
17
|
._1bto1l2s{text-overflow:ellipsis}
|
|
@@ -25,15 +26,18 @@
|
|
|
25
26
|
._6ssh1y54[aria-expanded=true]{box-shadow:0 0 0 2px var(--ds-border-focused,#4688ec)}
|
|
26
27
|
._80omtlke{cursor:pointer}
|
|
27
28
|
._bfhk1j28{background-color:transparent}
|
|
29
|
+
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
28
30
|
._ca0qidpf{padding-top:0}
|
|
29
31
|
._ect4n7od{font-family:unset}
|
|
30
32
|
._j8b81o36[aria-expanded=true]{outline-width:medium}
|
|
31
33
|
._k48pn7od{font-weight:unset}
|
|
34
|
+
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
32
35
|
._n3tdidpf{padding-bottom:0}
|
|
33
36
|
._o5721q9c{white-space:nowrap}
|
|
34
37
|
._otyrv77o{margin-bottom:var(--ds-space-025,2px)}
|
|
35
38
|
._p8tl1r31[aria-expanded=true]{outline-color:currentColor}
|
|
36
39
|
._syazn7od{color:unset}
|
|
40
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
37
41
|
._u5f3idpf{padding-right:0}
|
|
38
42
|
._vwz4idpf{line-height:0}
|
|
39
43
|
._zg8ln7od{font-style:unset}
|
|
@@ -9,14 +9,15 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
9
9
|
import { cx } from '@compiled/react';
|
|
10
10
|
import { useIntl } from 'react-intl-next';
|
|
11
11
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
12
|
-
import Lozenge from '@atlaskit/lozenge';
|
|
12
|
+
import Lozenge, { LozengeDropdownTrigger } from '@atlaskit/lozenge';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
15
15
|
import { messages } from '../../../../../../../../messages';
|
|
16
16
|
const styles = {
|
|
17
17
|
chevronDown: "_18u012x7 _1e0c1txw",
|
|
18
18
|
lozengeContainer: "_kkk2n7od _2rko12b0 _1dqonqa1 _189ee4h9 _1h6d1j28 _bfhk1j28 _1e0c1txw _4cvr1h6o _4t3i7vkz",
|
|
19
|
-
lozengeContainerSelected: "_1reo15vq _18m915vq _1h6d1v1w"
|
|
19
|
+
lozengeContainerSelected: "_1reo15vq _18m915vq _1h6d1v1w",
|
|
20
|
+
lozengeDropdownContainer: "_ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66"
|
|
20
21
|
};
|
|
21
22
|
const textStyles = null;
|
|
22
23
|
const triggerLozengeStyles = null;
|
|
@@ -28,6 +29,7 @@ const LozengeActionTrigger = ({
|
|
|
28
29
|
testId,
|
|
29
30
|
text,
|
|
30
31
|
triggerRef,
|
|
32
|
+
trailingMetric,
|
|
31
33
|
...props
|
|
32
34
|
}) => {
|
|
33
35
|
const intl = useIntl();
|
|
@@ -76,7 +78,20 @@ const LozengeActionTrigger = ({
|
|
|
76
78
|
"aria-hidden": true
|
|
77
79
|
})))));
|
|
78
80
|
}, [appearance, isPressing, text, isOpen, lozengeBackgroundColor, lozengeForegroundColor, maxWidth]);
|
|
79
|
-
return /*#__PURE__*/React.createElement(
|
|
81
|
+
return fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? /*#__PURE__*/React.createElement(Box, {
|
|
82
|
+
xcss: styles.lozengeDropdownContainer
|
|
83
|
+
}, /*#__PURE__*/React.createElement(LozengeDropdownTrigger, _extends({}, props, {
|
|
84
|
+
appearance: appearance,
|
|
85
|
+
trailingMetric: trailingMetric,
|
|
86
|
+
"data-action-open": isOpen,
|
|
87
|
+
"data-testid": `${testId}--trigger`,
|
|
88
|
+
maxWidth: maxWidth,
|
|
89
|
+
testId: testId,
|
|
90
|
+
ref: triggerRef,
|
|
91
|
+
"aria-label": fg('platform_navx_flex_card_status_dropdown_a11y_fix') ? intl.formatMessage(messages.change_status, {
|
|
92
|
+
status: text
|
|
93
|
+
}) : undefined
|
|
94
|
+
}), text)) : /*#__PURE__*/React.createElement("button", _extends({
|
|
80
95
|
type: "button"
|
|
81
96
|
}, props, {
|
|
82
97
|
"data-action-open": isOpen,
|
|
@@ -7,7 +7,8 @@ const DueOnElement = props => {
|
|
|
7
7
|
const context = useFlexibleUiContext();
|
|
8
8
|
const data = context ? toDateLozengeProps(context.dueOn) : null;
|
|
9
9
|
return data ? /*#__PURE__*/React.createElement(BaseLozengeElement, _extends({}, data, props, {
|
|
10
|
-
name: ElementName.DueOn
|
|
10
|
+
name: ElementName.DueOn,
|
|
11
|
+
isDateTag: true
|
|
11
12
|
})) : null;
|
|
12
13
|
};
|
|
13
14
|
export default DueOnElement;
|
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { ElementName } from '../../../../../constants';
|
|
4
5
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
5
6
|
import { BaseLozengeElement } from '../common';
|
|
7
|
+
const STATE_METRIC_REGEX = /^(.+?)\s+-\s+(\d+(?:\.\d+)?)$/;
|
|
6
8
|
const StateElement = props => {
|
|
7
9
|
var _context$state;
|
|
8
10
|
const context = useFlexibleUiContext();
|
|
9
11
|
const data = (_context$state = context === null || context === void 0 ? void 0 : context.state) !== null && _context$state !== void 0 ? _context$state : null;
|
|
10
|
-
|
|
12
|
+
const metricProps = fg('platform-dst-lozenge-tag-badge-visual-uplifts') ?
|
|
13
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
14
|
+
useMemo(() => {
|
|
15
|
+
if (data && typeof data.text === 'string') {
|
|
16
|
+
const match = data.text.match(STATE_METRIC_REGEX);
|
|
17
|
+
if (match) {
|
|
18
|
+
return {
|
|
19
|
+
text: match[1],
|
|
20
|
+
trailingMetric: match[2]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}, [data]) : undefined;
|
|
26
|
+
if (!data) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/React.createElement(BaseLozengeElement, _extends({}, data, props, metricProps, {
|
|
11
30
|
name: ElementName.State
|
|
12
|
-
}))
|
|
31
|
+
}));
|
|
13
32
|
};
|
|
14
33
|
export default StateElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
._19itia51{border:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}
|
|
3
3
|
._1yt4x7n9{padding:var(--ds-space-025,2px) 0}
|
|
4
|
-
.
|
|
4
|
+
._2rko1ssi{border-radius:var(--ds-radius-medium,4px)}
|
|
5
5
|
._v56415x0{transition:all .1s ease-in-out}
|
|
6
6
|
._1h6d1w55{border-color:var(--ds-border-accent-blue,#357de8)}._12ji1r31{outline-color:currentColor}
|
|
7
7
|
._12y31o36{outline-width:medium}
|
|
@@ -15,7 +15,7 @@ export const WrapperSpan = /*#__PURE__*/forwardRef(({
|
|
|
15
15
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
16
16
|
ref: ref
|
|
17
17
|
}, props, {
|
|
18
|
-
className: ax(["_1yt4x7n9
|
|
18
|
+
className: ax(["_1yt4x7n9 _2rko1ssi _v56415x0 _1e0c1nu9 _16d9qvcn _syaz13af _1rkwglyw _4cvx1w55", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && viewType === 'unauthorised' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19itia51 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6d1w55", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qsw5lj _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw7ia51 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv"])
|
|
19
19
|
}), props.children);
|
|
20
20
|
});
|
|
21
21
|
export const WrapperAnchor = /*#__PURE__*/forwardRef(({
|
|
@@ -32,7 +32,7 @@ export const WrapperAnchor = /*#__PURE__*/forwardRef(({
|
|
|
32
32
|
href: href,
|
|
33
33
|
ref: ref
|
|
34
34
|
}, props, {
|
|
35
|
-
className: ax(["_1yt4x7n9
|
|
35
|
+
className: ax(["_1yt4x7n9 _2rko1ssi _v56415x0 _1e0c1nu9 _16d9qvcn _syaz13af _1rkwglyw _4cvx1w55", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && viewType === 'unauthorised' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19itia51 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6d1w55", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qsw5lj _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw7ia51 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehiw5lj _1j5pglyw _1di615s3", viewType === 'errored' && "_4bfu1r31 _1hms8stv _ajmmnqa1 _9oik1r31 _1bnxglyw _jf4cnqa1"])
|
|
36
36
|
}), props.children);
|
|
37
37
|
});
|
|
38
38
|
const baseWrapperStyles = null;
|
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { HoverCard } from '../../HoverCard';
|
|
3
4
|
import InlineLozenge from '../common/inline-lozenge';
|
|
4
5
|
import { Frame } from '../Frame';
|
|
5
6
|
import { IconAndTitleLayout } from '../IconAndTitleLayout';
|
|
6
7
|
export class InlineCardResolvedView extends React.Component {
|
|
7
8
|
renderLozenge() {
|
|
8
|
-
var _lozenge$
|
|
9
|
+
var _lozenge$style3, _lozenge$style4;
|
|
9
10
|
const {
|
|
10
11
|
lozenge
|
|
11
12
|
} = this.props;
|
|
12
|
-
if (!lozenge) {
|
|
13
|
+
if (!lozenge || !(lozenge !== null && lozenge !== void 0 && lozenge.text)) {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
16
|
+
if (fg('platform-dst-lozenge-tag-badge-visual-uplifts')) {
|
|
17
|
+
const stateMetricMatch = lozenge.text.match(/^(.+?)\s+-\s+(\d+(?:\.\d+)?)$/);
|
|
18
|
+
if (stateMetricMatch) {
|
|
19
|
+
var _lozenge$style, _lozenge$style2;
|
|
20
|
+
const [, label, metric] = stateMetricMatch;
|
|
21
|
+
const appearance = lozenge.appearance || 'neutral';
|
|
22
|
+
return /*#__PURE__*/React.createElement(InlineLozenge, {
|
|
23
|
+
testId: "inline-card-resolved-view-lozenge",
|
|
24
|
+
appearance: appearance,
|
|
25
|
+
style: {
|
|
26
|
+
backgroundColor: lozenge === null || lozenge === void 0 ? void 0 : (_lozenge$style = lozenge.style) === null || _lozenge$style === void 0 ? void 0 : _lozenge$style.backgroundColor,
|
|
27
|
+
color: lozenge === null || lozenge === void 0 ? void 0 : (_lozenge$style2 = lozenge.style) === null || _lozenge$style2 === void 0 ? void 0 : _lozenge$style2.color
|
|
28
|
+
},
|
|
29
|
+
trailingMetric: metric
|
|
30
|
+
}, label);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
15
33
|
const appearance = lozenge.appearance || 'default';
|
|
16
34
|
return /*#__PURE__*/React.createElement(InlineLozenge, {
|
|
17
35
|
testId: "inline-card-resolved-view-lozenge",
|
|
18
36
|
appearance: appearance,
|
|
19
37
|
style: {
|
|
20
|
-
backgroundColor: lozenge === null || lozenge === void 0 ? void 0 : (_lozenge$
|
|
21
|
-
color: lozenge === null || lozenge === void 0 ? void 0 : (_lozenge$
|
|
38
|
+
backgroundColor: lozenge === null || lozenge === void 0 ? void 0 : (_lozenge$style3 = lozenge.style) === null || _lozenge$style3 === void 0 ? void 0 : _lozenge$style3.backgroundColor,
|
|
39
|
+
color: lozenge === null || lozenge === void 0 ? void 0 : (_lozenge$style4 = lozenge.style) === null || _lozenge$style4 === void 0 ? void 0 : _lozenge$style4.color
|
|
22
40
|
},
|
|
23
41
|
isBold: lozenge.isBold !== false
|
|
24
42
|
}, lozenge.text);
|
|
@@ -8,19 +8,20 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
9
|
const wrapperStylesOld = null;
|
|
10
10
|
const wrapperStylesNew = null;
|
|
11
|
+
const wrapperStylesNewLozenge = null;
|
|
11
12
|
const InlineLozenge = props => {
|
|
12
13
|
const shouldAddLozengeAttribute = expValEquals('confluence_compact_text_format', 'isEnabled', true) || expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp');
|
|
13
14
|
if (fg('jfp-magma-platform-lozenge-jump-fix')) {
|
|
14
15
|
return /*#__PURE__*/React.createElement("span", _extends({}, shouldAddLozengeAttribute && {
|
|
15
16
|
'data-inline-card-lozenge': true
|
|
16
17
|
}, {
|
|
17
|
-
className: ax(["_1e0c1o8l _154i1n1a _kqswh2mm _19pkidpf _2hwx1b66 _otyridpf _18u0v77o _p12f1osq"])
|
|
18
|
+
className: ax(["_1e0c1o8l _154i1n1a _kqswh2mm _19pkidpf _2hwx1b66 _otyridpf _18u0v77o _p12f1osq", fg('platform-dst-lozenge-tag-badge-visual-uplifts') && "_2hwxt94y"])
|
|
18
19
|
}), /*#__PURE__*/React.createElement(Lozenge, props));
|
|
19
20
|
}
|
|
20
21
|
return /*#__PURE__*/React.createElement("span", _extends({}, shouldAddLozengeAttribute && {
|
|
21
22
|
'data-inline-card-lozenge': true
|
|
22
23
|
}, {
|
|
23
|
-
className: ax(["_1e0c1o8l _s7n4t94y _19pkidpf _2hwx1b66 _otyridpf _18u0v77o _p12f1osq"])
|
|
24
|
+
className: ax(["_1e0c1o8l _s7n4t94y _19pkidpf _2hwx1b66 _otyridpf _18u0v77o _p12f1osq", fg('platform-dst-lozenge-tag-badge-visual-uplifts') && "_2hwxt94y"])
|
|
24
25
|
}), /*#__PURE__*/React.createElement(Lozenge, props));
|
|
25
26
|
};
|
|
26
27
|
export default InlineLozenge;
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "43.28.
|
|
15
|
+
packageVersion: "43.28.7",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
package/dist/esm/messages.js
CHANGED
|
@@ -3,7 +3,7 @@ export var messages = defineMessages({
|
|
|
3
3
|
actions: {
|
|
4
4
|
id: 'fabric.linking.actions',
|
|
5
5
|
defaultMessage: 'Actions',
|
|
6
|
-
description: ''
|
|
6
|
+
description: 'Title for a section or menu containing available actions for a resource.'
|
|
7
7
|
},
|
|
8
8
|
add_account: {
|
|
9
9
|
id: 'fabric.linking.add_account',
|
|
@@ -98,7 +98,7 @@ export var messages = defineMessages({
|
|
|
98
98
|
cancel: {
|
|
99
99
|
id: 'fabric.linking.cancel',
|
|
100
100
|
defaultMessage: 'Cancel',
|
|
101
|
-
description: '
|
|
101
|
+
description: 'Cancel the current action or close the modal.'
|
|
102
102
|
},
|
|
103
103
|
beta: {
|
|
104
104
|
id: 'fabric.linking.beta',
|
|
@@ -128,7 +128,7 @@ export var messages = defineMessages({
|
|
|
128
128
|
close: {
|
|
129
129
|
id: 'fabric.linking.close',
|
|
130
130
|
defaultMessage: 'Close',
|
|
131
|
-
description: ''
|
|
131
|
+
description: 'Close the current screen or modal.'
|
|
132
132
|
},
|
|
133
133
|
check_this_link: {
|
|
134
134
|
id: 'fabric.linking.check_this_link',
|
|
@@ -137,7 +137,8 @@ export var messages = defineMessages({
|
|
|
137
137
|
},
|
|
138
138
|
compass_applied_components_count: {
|
|
139
139
|
id: 'compass.applied_components_count.non-final',
|
|
140
|
-
defaultMessage: 'Applied to {numberOfComponents, plural, one {{numberOfComponents, number} component} other {{numberOfComponents, number} components}}'
|
|
140
|
+
defaultMessage: 'Applied to {numberOfComponents, plural, one {{numberOfComponents, number} component} other {{numberOfComponents, number} components}}',
|
|
141
|
+
description: 'Indicates the number of components the resource is applied to.'
|
|
141
142
|
},
|
|
142
143
|
connect_to: {
|
|
143
144
|
id: 'fabric.linking.connect_to',
|
|
@@ -187,12 +188,12 @@ export var messages = defineMessages({
|
|
|
187
188
|
continue: {
|
|
188
189
|
id: 'fabric.linking.continue',
|
|
189
190
|
defaultMessage: 'Continue',
|
|
190
|
-
description: '
|
|
191
|
+
description: 'Continue to the next step.'
|
|
191
192
|
},
|
|
192
193
|
copy_url_to_clipboard: {
|
|
193
194
|
id: 'fabric.linking.copy_url_to_clipboard',
|
|
194
195
|
defaultMessage: 'Copy link',
|
|
195
|
-
description: ''
|
|
196
|
+
description: 'Action to copy the URL of the link to the clipboard.'
|
|
196
197
|
},
|
|
197
198
|
copied_url_to_clipboard: {
|
|
198
199
|
id: 'fabric.linking.copied_url_to_clipboard',
|
|
@@ -227,7 +228,7 @@ export var messages = defineMessages({
|
|
|
227
228
|
download: {
|
|
228
229
|
id: 'fabric.linking.download',
|
|
229
230
|
defaultMessage: 'Download',
|
|
230
|
-
description: ''
|
|
231
|
+
description: 'Action to download the resource.'
|
|
231
232
|
},
|
|
232
233
|
download_description: {
|
|
233
234
|
id: 'fabric.linking.download_description',
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "43.28.
|
|
7
|
+
packageVersion: "43.28.7"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -14,7 +14,8 @@ var styles = {
|
|
|
14
14
|
var messages = defineMessages({
|
|
15
15
|
imageAltText: {
|
|
16
16
|
id: 'smart-link.image-icon.altText',
|
|
17
|
-
defaultMessage: 'Link Icon'
|
|
17
|
+
defaultMessage: 'Link Icon',
|
|
18
|
+
description: 'Alt text for a link icon.'
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
var ImageIcon = function ImageIcon(_ref) {
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
._18u0r5cr{margin-left:var(--ds-space-negative-050,-4px)}
|
|
2
|
+
._19pkr5cr{margin-top:var(--ds-space-negative-050,-4px)}
|
|
1
3
|
._1e0c116y{display:inline-flex}
|
|
2
|
-
._1ul91ns9{min-width:-moz-fit-content;min-width:fit-content}
|
|
4
|
+
._1ul91ns9{min-width:-moz-fit-content;min-width:fit-content}
|
|
5
|
+
._2hwxr5cr{margin-right:var(--ds-space-negative-050,-4px)}
|
|
6
|
+
._otyrr5cr{margin-bottom:var(--ds-space-negative-050,-4px)}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import "./index.compiled.css";
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
6
|
import { FormattedDate } from 'react-intl-next';
|
|
6
7
|
import AtlaskitLozenge from '@atlaskit/lozenge';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { SimpleTag as Tag } from '@atlaskit/tag';
|
|
7
10
|
import { useFlexibleUiOptionContext } from '../../../../../../state/flexible-ui-context';
|
|
8
11
|
import LozengeAction from './lozenge-action';
|
|
9
12
|
var styles = null;
|
|
13
|
+
var dueOnStyles = null;
|
|
10
14
|
/**
|
|
11
15
|
* A base element that displays a Lozenge.
|
|
12
16
|
* @internal
|
|
@@ -24,12 +28,14 @@ var BaseLozengeElement = function BaseLozengeElement(_ref) {
|
|
|
24
28
|
style = _ref.style,
|
|
25
29
|
text = _ref.text,
|
|
26
30
|
_ref$testId = _ref.testId,
|
|
27
|
-
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId
|
|
31
|
+
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId,
|
|
32
|
+
isDateTag = _ref.isDateTag,
|
|
33
|
+
trailingMetric = _ref.trailingMetric;
|
|
28
34
|
var ui = useFlexibleUiOptionContext();
|
|
29
35
|
if (!text) {
|
|
30
36
|
return null;
|
|
31
37
|
}
|
|
32
|
-
var lozenge = action ? /*#__PURE__*/React.createElement(LozengeAction, {
|
|
38
|
+
var lozenge = action ? /*#__PURE__*/React.createElement(LozengeAction, _extends({
|
|
33
39
|
action: action,
|
|
34
40
|
appearance: appearance,
|
|
35
41
|
maxWidth: maxWidth,
|
|
@@ -37,7 +43,12 @@ var BaseLozengeElement = function BaseLozengeElement(_ref) {
|
|
|
37
43
|
text: text,
|
|
38
44
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex,
|
|
39
45
|
onAfterChanged: onAfterChanged
|
|
40
|
-
}
|
|
46
|
+
}, trailingMetric && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? {
|
|
47
|
+
trailingMetric: trailingMetric
|
|
48
|
+
} : undefined)) : isDateTag ? /*#__PURE__*/React.createElement(Tag, {
|
|
49
|
+
text: text,
|
|
50
|
+
migration_fallback: "lozenge"
|
|
51
|
+
}) : /*#__PURE__*/React.createElement(AtlaskitLozenge, _extends({
|
|
41
52
|
appearance: appearance,
|
|
42
53
|
isBold: true,
|
|
43
54
|
maxWidth: maxWidth
|
|
@@ -45,14 +56,16 @@ var BaseLozengeElement = function BaseLozengeElement(_ref) {
|
|
|
45
56
|
,
|
|
46
57
|
style: style,
|
|
47
58
|
testId: "".concat(testId, "-lozenge")
|
|
48
|
-
},
|
|
59
|
+
}, trailingMetric && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? {
|
|
60
|
+
trailingMetric: trailingMetric
|
|
61
|
+
} : undefined), text);
|
|
49
62
|
return /*#__PURE__*/React.createElement("span", {
|
|
50
63
|
"data-smart-element": name,
|
|
51
64
|
"data-smart-element-lozenge": true,
|
|
52
65
|
"data-testid": testId
|
|
53
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
54
67
|
,
|
|
55
|
-
className: ax(["_1e0c116y _1ul91ns9", className])
|
|
68
|
+
className: ax(["_1e0c116y _1ul91ns9", isDateTag && fg('platform-dst-lozenge-tag-badge-visual-uplifts') && "_19pkr5cr _2hwxr5cr _otyrr5cr _18u0r5cr", className])
|
|
56
69
|
}, lozenge);
|
|
57
70
|
};
|
|
58
71
|
export default BaseLozengeElement;
|
|
@@ -8,9 +8,10 @@ var withErrorBoundary = function withErrorBoundary(Component) {
|
|
|
8
8
|
return /*#__PURE__*/React.createElement(Lozenge, {
|
|
9
9
|
appearance: props === null || props === void 0 ? void 0 : props.appearance,
|
|
10
10
|
isBold: true,
|
|
11
|
-
testId: "".concat((_props$testId = props === null || props === void 0 ? void 0 : props.testId) !== null && _props$testId !== void 0 ? _props$testId : 'smart-element-lozenge-action', "-fallback")
|
|
11
|
+
testId: "".concat((_props$testId = props === null || props === void 0 ? void 0 : props.testId) !== null && _props$testId !== void 0 ? _props$testId : 'smart-element-lozenge-action', "-fallback"),
|
|
12
|
+
trailingMetric: props === null || props === void 0 ? void 0 : props.trailingMetric
|
|
12
13
|
}, props === null || props === void 0 ? void 0 : props.text);
|
|
13
|
-
}, [props === null || props === void 0 ? void 0 : props.appearance, props === null || props === void 0 ? void 0 : props.testId, props === null || props === void 0 ? void 0 : props.text]);
|
|
14
|
+
}, [props === null || props === void 0 ? void 0 : props.appearance, props === null || props === void 0 ? void 0 : props.testId, props === null || props === void 0 ? void 0 : props.text, props === null || props === void 0 ? void 0 : props.trailingMetric]);
|
|
14
15
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
15
16
|
fallback: fallback
|
|
16
17
|
}, /*#__PURE__*/React.createElement(Component, props));
|
|
@@ -35,6 +35,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
35
35
|
text = _ref.text,
|
|
36
36
|
zIndex = _ref.zIndex,
|
|
37
37
|
onAfterChanged = _ref.onAfterChanged,
|
|
38
|
+
trailingMetric = _ref.trailingMetric,
|
|
38
39
|
_ref$shouldRenderToPa = _ref.shouldRenderToParent,
|
|
39
40
|
shouldRenderToParent = _ref$shouldRenderToPa === void 0 ? false : _ref$shouldRenderToPa;
|
|
40
41
|
var _useState = useState({
|
|
@@ -143,9 +144,10 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
143
144
|
isOpen: isOpen,
|
|
144
145
|
maxWidth: maxWidth,
|
|
145
146
|
testId: testId,
|
|
146
|
-
text: selected.text
|
|
147
|
+
text: selected.text,
|
|
148
|
+
trailingMetric: trailingMetric
|
|
147
149
|
}));
|
|
148
|
-
}, [selected.appearance, selected.text, isOpen, maxWidth, testId]);
|
|
150
|
+
}, [selected.appearance, selected.text, isOpen, maxWidth, testId, trailingMetric]);
|
|
149
151
|
var handleItemClick = useCallback( /*#__PURE__*/function () {
|
|
150
152
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, text, appearance) {
|
|
151
153
|
var updateAction, request;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
._18m915vq{overflow-y:hidden}
|
|
12
12
|
._18u012x7{margin-left:var(--ds-space-075,6px)}
|
|
13
13
|
._18u0v77o{margin-left:var(--ds-space-025,2px)}
|
|
14
|
+
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
14
15
|
._19bvidpf{padding-left:0}
|
|
15
16
|
._19pkv77o{margin-top:var(--ds-space-025,2px)}
|
|
16
17
|
._1bto1l2s{text-overflow:ellipsis}
|
|
@@ -25,15 +26,18 @@
|
|
|
25
26
|
._6ssh1y54[aria-expanded=true]{box-shadow:0 0 0 2px var(--ds-border-focused,#4688ec)}
|
|
26
27
|
._80omtlke{cursor:pointer}
|
|
27
28
|
._bfhk1j28{background-color:transparent}
|
|
29
|
+
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
28
30
|
._ca0qidpf{padding-top:0}
|
|
29
31
|
._ect4n7od{font-family:unset}
|
|
30
32
|
._j8b81o36[aria-expanded=true]{outline-width:medium}
|
|
31
33
|
._k48pn7od{font-weight:unset}
|
|
34
|
+
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
32
35
|
._n3tdidpf{padding-bottom:0}
|
|
33
36
|
._o5721q9c{white-space:nowrap}
|
|
34
37
|
._otyrv77o{margin-bottom:var(--ds-space-025,2px)}
|
|
35
38
|
._p8tl1r31[aria-expanded=true]{outline-color:currentColor}
|
|
36
39
|
._syazn7od{color:unset}
|
|
40
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
37
41
|
._u5f3idpf{padding-right:0}
|
|
38
42
|
._vwz4idpf{line-height:0}
|
|
39
43
|
._zg8ln7od{font-style:unset}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["appearance", "isOpen", "maxWidth", "testId", "text", "triggerRef"];
|
|
5
|
+
var _excluded = ["appearance", "isOpen", "maxWidth", "testId", "text", "triggerRef", "trailingMetric"];
|
|
6
6
|
import "./index.compiled.css";
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -12,14 +12,15 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
12
12
|
import { cx } from '@compiled/react';
|
|
13
13
|
import { useIntl } from 'react-intl-next';
|
|
14
14
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
15
|
-
import Lozenge from '@atlaskit/lozenge';
|
|
15
|
+
import Lozenge, { LozengeDropdownTrigger } from '@atlaskit/lozenge';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
17
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
18
18
|
import { messages } from '../../../../../../../../messages';
|
|
19
19
|
var styles = {
|
|
20
20
|
chevronDown: "_18u012x7 _1e0c1txw",
|
|
21
21
|
lozengeContainer: "_kkk2n7od _2rko12b0 _1dqonqa1 _189ee4h9 _1h6d1j28 _bfhk1j28 _1e0c1txw _4cvr1h6o _4t3i7vkz",
|
|
22
|
-
lozengeContainerSelected: "_1reo15vq _18m915vq _1h6d1v1w"
|
|
22
|
+
lozengeContainerSelected: "_1reo15vq _18m915vq _1h6d1v1w",
|
|
23
|
+
lozengeDropdownContainer: "_ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66"
|
|
23
24
|
};
|
|
24
25
|
var textStyles = null;
|
|
25
26
|
var triggerLozengeStyles = null;
|
|
@@ -31,6 +32,7 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
31
32
|
testId = _ref.testId,
|
|
32
33
|
text = _ref.text,
|
|
33
34
|
triggerRef = _ref.triggerRef,
|
|
35
|
+
trailingMetric = _ref.trailingMetric,
|
|
34
36
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
37
|
var intl = useIntl();
|
|
36
38
|
var _useState = useState(false),
|
|
@@ -91,7 +93,20 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
91
93
|
"aria-hidden": true
|
|
92
94
|
})))));
|
|
93
95
|
}, [appearance, isPressing, text, isOpen, lozengeBackgroundColor, lozengeForegroundColor, maxWidth]);
|
|
94
|
-
return /*#__PURE__*/React.createElement(
|
|
96
|
+
return fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? /*#__PURE__*/React.createElement(Box, {
|
|
97
|
+
xcss: styles.lozengeDropdownContainer
|
|
98
|
+
}, /*#__PURE__*/React.createElement(LozengeDropdownTrigger, _extends({}, props, {
|
|
99
|
+
appearance: appearance,
|
|
100
|
+
trailingMetric: trailingMetric,
|
|
101
|
+
"data-action-open": isOpen,
|
|
102
|
+
"data-testid": "".concat(testId, "--trigger"),
|
|
103
|
+
maxWidth: maxWidth,
|
|
104
|
+
testId: testId,
|
|
105
|
+
ref: triggerRef,
|
|
106
|
+
"aria-label": fg('platform_navx_flex_card_status_dropdown_a11y_fix') ? intl.formatMessage(messages.change_status, {
|
|
107
|
+
status: text
|
|
108
|
+
}) : undefined
|
|
109
|
+
}), text)) : /*#__PURE__*/React.createElement("button", _extends({
|
|
95
110
|
type: "button"
|
|
96
111
|
}, props, {
|
|
97
112
|
"data-action-open": isOpen,
|