@atlaskit/smart-card 26.42.12 → 26.43.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 +6 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +2 -0
- package/dist/cjs/view/CardWithUrl/loader.js +2 -0
- package/dist/cjs/view/InlineCard/Frame/index.js +4 -2
- package/dist/cjs/view/InlineCard/Frame/styled.js +13 -4
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +2 -0
- package/dist/cjs/view/InlineCard/index.js +2 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -0
- package/dist/es2019/view/CardWithUrl/loader.js +2 -0
- package/dist/es2019/view/InlineCard/Frame/index.js +4 -2
- package/dist/es2019/view/InlineCard/Frame/styled.js +17 -5
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +2 -0
- package/dist/es2019/view/InlineCard/index.js +2 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -0
- package/dist/esm/view/CardWithUrl/loader.js +2 -0
- package/dist/esm/view/InlineCard/Frame/index.js +4 -2
- package/dist/esm/view/InlineCard/Frame/styled.js +13 -4
- package/dist/esm/view/InlineCard/ResolvedView/index.js +2 -0
- package/dist/esm/view/InlineCard/index.js +2 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +2 -0
- package/dist/types/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types/view/InlineCard/Frame/styled.d.ts +1 -0
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/types.d.ts +1 -0
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -0
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.43.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#58979](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58979) [`5fda0e961b2c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5fda0e961b2c) - [ux] Added a new prop isHovering and styles for the border around inline smart card when the prop is true
|
|
8
|
+
|
|
3
9
|
## 26.42.12
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.43.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -27,6 +27,7 @@ function Component(_ref) {
|
|
|
27
27
|
var id = _ref.id,
|
|
28
28
|
url = _ref.url,
|
|
29
29
|
isSelected = _ref.isSelected,
|
|
30
|
+
isHovered = _ref.isHovered,
|
|
30
31
|
isFrameVisible = _ref.isFrameVisible,
|
|
31
32
|
frameStyle = _ref.frameStyle,
|
|
32
33
|
platform = _ref.platform,
|
|
@@ -216,6 +217,7 @@ function Component(_ref) {
|
|
|
216
217
|
handleAuthorize: services.length && handleAuthorize || undefined,
|
|
217
218
|
handleFrameClick: handleClickWrapper,
|
|
218
219
|
isSelected: isSelected,
|
|
220
|
+
isHovered: isHovered,
|
|
219
221
|
onResolve: onResolve,
|
|
220
222
|
onError: onError,
|
|
221
223
|
testId: testId,
|
|
@@ -40,6 +40,7 @@ function CardWithURLRenderer(props) {
|
|
|
40
40
|
var url = props.url,
|
|
41
41
|
appearance = props.appearance,
|
|
42
42
|
isSelected = props.isSelected,
|
|
43
|
+
isHovered = props.isHovered,
|
|
43
44
|
isFrameVisible = props.isFrameVisible,
|
|
44
45
|
frameStyle = props.frameStyle,
|
|
45
46
|
onClick = props.onClick,
|
|
@@ -109,6 +110,7 @@ function CardWithURLRenderer(props) {
|
|
|
109
110
|
appearance: appearance,
|
|
110
111
|
onClick: onClick,
|
|
111
112
|
isSelected: isSelected,
|
|
113
|
+
isHovered: isHovered,
|
|
112
114
|
isFrameVisible: isFrameVisible,
|
|
113
115
|
frameStyle: frameStyle,
|
|
114
116
|
container: container,
|
|
@@ -18,7 +18,8 @@ var Frame = exports.Frame = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
18
18
|
link = props.link,
|
|
19
19
|
withoutBackground = props.withoutBackground,
|
|
20
20
|
testId = props.testId,
|
|
21
|
-
className = props.className
|
|
21
|
+
className = props.className,
|
|
22
|
+
isHovered = props.isHovered;
|
|
22
23
|
var handleClick = (0, _react.useCallback)(function (event) {
|
|
23
24
|
if (onClick) {
|
|
24
25
|
event.preventDefault();
|
|
@@ -57,6 +58,7 @@ var Frame = exports.Frame = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
57
58
|
onKeyPress: handleKeyPress,
|
|
58
59
|
"data-testid": testId,
|
|
59
60
|
className: className,
|
|
60
|
-
ref: ref
|
|
61
|
+
ref: ref,
|
|
62
|
+
isHovered: isHovered
|
|
61
63
|
}, children);
|
|
62
64
|
});
|
|
@@ -34,6 +34,18 @@ var isSelected = function isSelected(_ref2) {
|
|
|
34
34
|
return 'user-select: text';
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
var hoveredStyles = function hoveredStyles(props) {
|
|
38
|
+
return "\n ".concat((0, _components.themed)({
|
|
39
|
+
light: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(_colors.B200, ")"), ";"),
|
|
40
|
+
dark: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(_colors.B200, ")"), ";")
|
|
41
|
+
})(props), ";\n");
|
|
42
|
+
};
|
|
43
|
+
var activeHoveredFocusedStyles = function activeHoveredFocusedStyles(props) {
|
|
44
|
+
return "\n ".concat(props.withoutBackground ? '' : 'text-decoration: none;', ";\n");
|
|
45
|
+
};
|
|
46
|
+
var hoveredWihBorderStyles = function hoveredWihBorderStyles(props) {
|
|
47
|
+
return "\n ".concat(hoveredStyles(props), ";\n ").concat(activeHoveredFocusedStyles(props), ";\n");
|
|
48
|
+
};
|
|
37
49
|
|
|
38
50
|
/*
|
|
39
51
|
Inline smart cards should have the following layout:
|
|
@@ -57,10 +69,7 @@ var baseWrapperStyle = function baseWrapperStyle(props) {
|
|
|
57
69
|
})(props), ";\n\n ").concat(isSelected(props), ";\n\n ").concat(props.withoutBackground ? '' : (0, _components.themed)({
|
|
58
70
|
light: "border: 1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")"), ";"),
|
|
59
71
|
dark: "border: 1px solid ".concat("var(--ds-border, ".concat(_colors.N500, ")"), ";")
|
|
60
|
-
})(props), "\n &:hover {\n ").concat((
|
|
61
|
-
light: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(_colors.B200, ")"), ";"),
|
|
62
|
-
dark: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(_colors.B200, ")"), ";")
|
|
63
|
-
})(props), "\n }\n &, :hover, :focus, :active {\n ").concat(props.withoutBackground ? '' : 'text-decoration: none;', "\n }\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n");
|
|
72
|
+
})(props), "\n &:hover {\n ").concat(hoveredStyles(props), "\n }\n &, :hover, :focus, :active {\n ").concat(activeHoveredFocusedStyles(props), "\n }\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n\n ").concat(props.isHovered && hoveredWihBorderStyles(props), ";\n");
|
|
64
73
|
};
|
|
65
74
|
var WrapperAnchor = exports.WrapperAnchor = _styled.default.a(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n"])), baseWrapperStyle, isInteractive);
|
|
66
75
|
WrapperAnchor.displayName = 'WrapperAnchor';
|
|
@@ -46,6 +46,7 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
46
46
|
_this$props$title = _this$props.title,
|
|
47
47
|
title = _this$props$title === void 0 ? '' : _this$props$title,
|
|
48
48
|
isSelected = _this$props.isSelected,
|
|
49
|
+
isHovered = _this$props.isHovered,
|
|
49
50
|
onClick = _this$props.onClick,
|
|
50
51
|
icon = _this$props.icon,
|
|
51
52
|
link = _this$props.link,
|
|
@@ -61,6 +62,7 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
61
62
|
testId: testId,
|
|
62
63
|
link: link,
|
|
63
64
|
isSelected: isSelected,
|
|
65
|
+
isHovered: isHovered,
|
|
64
66
|
onClick: onClick
|
|
65
67
|
}, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
|
|
66
68
|
emoji: titlePrefix,
|
|
@@ -65,6 +65,7 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
65
65
|
handleAuthorize = _ref.handleAuthorize,
|
|
66
66
|
handleFrameClick = _ref.handleFrameClick,
|
|
67
67
|
isSelected = _ref.isSelected,
|
|
68
|
+
isHovered = _ref.isHovered,
|
|
68
69
|
renderers = _ref.renderers,
|
|
69
70
|
onResolve = _ref.onResolve,
|
|
70
71
|
onError = _ref.onError,
|
|
@@ -124,6 +125,7 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
124
125
|
showServerActions: showServerActions,
|
|
125
126
|
link: url,
|
|
126
127
|
isSelected: isSelected,
|
|
128
|
+
isHovered: isHovered,
|
|
127
129
|
onClick: handleFrameClick,
|
|
128
130
|
testId: testIdWithStatus
|
|
129
131
|
}));
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.
|
|
20
|
+
packageVersion: "26.43.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.43.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -17,6 +17,7 @@ function Component({
|
|
|
17
17
|
id,
|
|
18
18
|
url,
|
|
19
19
|
isSelected,
|
|
20
|
+
isHovered,
|
|
20
21
|
isFrameVisible,
|
|
21
22
|
frameStyle,
|
|
22
23
|
platform,
|
|
@@ -203,6 +204,7 @@ function Component({
|
|
|
203
204
|
handleAuthorize: services.length && handleAuthorize || undefined,
|
|
204
205
|
handleFrameClick: handleClickWrapper,
|
|
205
206
|
isSelected: isSelected,
|
|
207
|
+
isHovered: isHovered,
|
|
206
208
|
onResolve: onResolve,
|
|
207
209
|
onError: onError,
|
|
208
210
|
testId: testId,
|
|
@@ -20,6 +20,7 @@ export function CardWithURLRenderer(props) {
|
|
|
20
20
|
url,
|
|
21
21
|
appearance,
|
|
22
22
|
isSelected,
|
|
23
|
+
isHovered,
|
|
23
24
|
isFrameVisible,
|
|
24
25
|
frameStyle,
|
|
25
26
|
onClick,
|
|
@@ -88,6 +89,7 @@ export function CardWithURLRenderer(props) {
|
|
|
88
89
|
appearance,
|
|
89
90
|
onClick,
|
|
90
91
|
isSelected,
|
|
92
|
+
isHovered,
|
|
91
93
|
isFrameVisible,
|
|
92
94
|
frameStyle,
|
|
93
95
|
container,
|
|
@@ -10,7 +10,8 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10
10
|
link,
|
|
11
11
|
withoutBackground,
|
|
12
12
|
testId,
|
|
13
|
-
className
|
|
13
|
+
className,
|
|
14
|
+
isHovered
|
|
14
15
|
} = props;
|
|
15
16
|
const handleClick = useCallback(event => {
|
|
16
17
|
if (onClick) {
|
|
@@ -50,6 +51,7 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
50
51
|
onKeyPress: handleKeyPress,
|
|
51
52
|
"data-testid": testId,
|
|
52
53
|
className: className,
|
|
53
|
-
ref: ref
|
|
54
|
+
ref: ref,
|
|
55
|
+
isHovered: isHovered
|
|
54
56
|
}, children);
|
|
55
57
|
});
|
|
@@ -48,6 +48,19 @@ const isSelected = ({
|
|
|
48
48
|
return 'user-select: text';
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
+
const hoveredStyles = props => `
|
|
52
|
+
${themed({
|
|
53
|
+
light: `border-color: ${`var(--ds-border-accent-blue, ${B200})`};`,
|
|
54
|
+
dark: `border-color: ${`var(--ds-border-accent-blue, ${B200})`};`
|
|
55
|
+
})(props)};
|
|
56
|
+
`;
|
|
57
|
+
const activeHoveredFocusedStyles = props => `
|
|
58
|
+
${props.withoutBackground ? '' : 'text-decoration: none;'};
|
|
59
|
+
`;
|
|
60
|
+
const hoveredWihBorderStyles = props => `
|
|
61
|
+
${hoveredStyles(props)};
|
|
62
|
+
${activeHoveredFocusedStyles(props)};
|
|
63
|
+
`;
|
|
51
64
|
|
|
52
65
|
/*
|
|
53
66
|
Inline smart cards should have the following layout:
|
|
@@ -85,16 +98,15 @@ const baseWrapperStyle = props => `
|
|
|
85
98
|
dark: `border: 1px solid ${`var(--ds-border, ${N500})`};`
|
|
86
99
|
})(props)}
|
|
87
100
|
&:hover {
|
|
88
|
-
${
|
|
89
|
-
light: `border-color: ${`var(--ds-border-accent-blue, ${B200})`};`,
|
|
90
|
-
dark: `border-color: ${`var(--ds-border-accent-blue, ${B200})`};`
|
|
91
|
-
})(props)}
|
|
101
|
+
${hoveredStyles(props)}
|
|
92
102
|
}
|
|
93
103
|
&, :hover, :focus, :active {
|
|
94
|
-
${props
|
|
104
|
+
${activeHoveredFocusedStyles(props)}
|
|
95
105
|
}
|
|
96
106
|
transition: 0.1s all ease-in-out;
|
|
97
107
|
-moz-user-select: none;
|
|
108
|
+
|
|
109
|
+
${props.isHovered && hoveredWihBorderStyles(props)};
|
|
98
110
|
`;
|
|
99
111
|
export const WrapperAnchor = styled.a`
|
|
100
112
|
${baseWrapperStyle}
|
|
@@ -23,6 +23,7 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
23
23
|
id,
|
|
24
24
|
title = '',
|
|
25
25
|
isSelected,
|
|
26
|
+
isHovered,
|
|
26
27
|
onClick,
|
|
27
28
|
icon,
|
|
28
29
|
link,
|
|
@@ -36,6 +37,7 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
36
37
|
testId: testId,
|
|
37
38
|
link: link,
|
|
38
39
|
isSelected: isSelected,
|
|
40
|
+
isHovered: isHovered,
|
|
39
41
|
onClick: onClick
|
|
40
42
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
41
43
|
emoji: titlePrefix,
|
|
@@ -25,6 +25,7 @@ export const InlineCard = ({
|
|
|
25
25
|
handleAuthorize,
|
|
26
26
|
handleFrameClick,
|
|
27
27
|
isSelected,
|
|
28
|
+
isHovered,
|
|
28
29
|
renderers,
|
|
29
30
|
onResolve,
|
|
30
31
|
onError,
|
|
@@ -89,6 +90,7 @@ export const InlineCard = ({
|
|
|
89
90
|
showServerActions: showServerActions,
|
|
90
91
|
link: url,
|
|
91
92
|
isSelected: isSelected,
|
|
93
|
+
isHovered: isHovered,
|
|
92
94
|
onClick: handleFrameClick,
|
|
93
95
|
testId: testIdWithStatus
|
|
94
96
|
}));
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.
|
|
10
|
+
packageVersion: "26.43.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.43.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -17,6 +17,7 @@ function Component(_ref) {
|
|
|
17
17
|
var id = _ref.id,
|
|
18
18
|
url = _ref.url,
|
|
19
19
|
isSelected = _ref.isSelected,
|
|
20
|
+
isHovered = _ref.isHovered,
|
|
20
21
|
isFrameVisible = _ref.isFrameVisible,
|
|
21
22
|
frameStyle = _ref.frameStyle,
|
|
22
23
|
platform = _ref.platform,
|
|
@@ -206,6 +207,7 @@ function Component(_ref) {
|
|
|
206
207
|
handleAuthorize: services.length && handleAuthorize || undefined,
|
|
207
208
|
handleFrameClick: handleClickWrapper,
|
|
208
209
|
isSelected: isSelected,
|
|
210
|
+
isHovered: isHovered,
|
|
209
211
|
onResolve: onResolve,
|
|
210
212
|
onError: onError,
|
|
211
213
|
testId: testId,
|
|
@@ -28,6 +28,7 @@ export function CardWithURLRenderer(props) {
|
|
|
28
28
|
var url = props.url,
|
|
29
29
|
appearance = props.appearance,
|
|
30
30
|
isSelected = props.isSelected,
|
|
31
|
+
isHovered = props.isHovered,
|
|
31
32
|
isFrameVisible = props.isFrameVisible,
|
|
32
33
|
frameStyle = props.frameStyle,
|
|
33
34
|
onClick = props.onClick,
|
|
@@ -97,6 +98,7 @@ export function CardWithURLRenderer(props) {
|
|
|
97
98
|
appearance: appearance,
|
|
98
99
|
onClick: onClick,
|
|
99
100
|
isSelected: isSelected,
|
|
101
|
+
isHovered: isHovered,
|
|
100
102
|
isFrameVisible: isFrameVisible,
|
|
101
103
|
frameStyle: frameStyle,
|
|
102
104
|
container: container,
|
|
@@ -9,7 +9,8 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
9
9
|
link = props.link,
|
|
10
10
|
withoutBackground = props.withoutBackground,
|
|
11
11
|
testId = props.testId,
|
|
12
|
-
className = props.className
|
|
12
|
+
className = props.className,
|
|
13
|
+
isHovered = props.isHovered;
|
|
13
14
|
var handleClick = useCallback(function (event) {
|
|
14
15
|
if (onClick) {
|
|
15
16
|
event.preventDefault();
|
|
@@ -48,6 +49,7 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
48
49
|
onKeyPress: handleKeyPress,
|
|
49
50
|
"data-testid": testId,
|
|
50
51
|
className: className,
|
|
51
|
-
ref: ref
|
|
52
|
+
ref: ref,
|
|
53
|
+
isHovered: isHovered
|
|
52
54
|
}, children);
|
|
53
55
|
});
|
|
@@ -27,6 +27,18 @@ var isSelected = function isSelected(_ref2) {
|
|
|
27
27
|
return 'user-select: text';
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
+
var hoveredStyles = function hoveredStyles(props) {
|
|
31
|
+
return "\n ".concat(themed({
|
|
32
|
+
light: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(B200, ")"), ";"),
|
|
33
|
+
dark: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(B200, ")"), ";")
|
|
34
|
+
})(props), ";\n");
|
|
35
|
+
};
|
|
36
|
+
var activeHoveredFocusedStyles = function activeHoveredFocusedStyles(props) {
|
|
37
|
+
return "\n ".concat(props.withoutBackground ? '' : 'text-decoration: none;', ";\n");
|
|
38
|
+
};
|
|
39
|
+
var hoveredWihBorderStyles = function hoveredWihBorderStyles(props) {
|
|
40
|
+
return "\n ".concat(hoveredStyles(props), ";\n ").concat(activeHoveredFocusedStyles(props), ";\n");
|
|
41
|
+
};
|
|
30
42
|
|
|
31
43
|
/*
|
|
32
44
|
Inline smart cards should have the following layout:
|
|
@@ -50,10 +62,7 @@ var baseWrapperStyle = function baseWrapperStyle(props) {
|
|
|
50
62
|
})(props), ";\n\n ").concat(isSelected(props), ";\n\n ").concat(props.withoutBackground ? '' : themed({
|
|
51
63
|
light: "border: 1px solid ".concat("var(--ds-border, ".concat(N40, ")"), ";"),
|
|
52
64
|
dark: "border: 1px solid ".concat("var(--ds-border, ".concat(N500, ")"), ";")
|
|
53
|
-
})(props), "\n &:hover {\n ").concat(
|
|
54
|
-
light: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(B200, ")"), ";"),
|
|
55
|
-
dark: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(B200, ")"), ";")
|
|
56
|
-
})(props), "\n }\n &, :hover, :focus, :active {\n ").concat(props.withoutBackground ? '' : 'text-decoration: none;', "\n }\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n");
|
|
65
|
+
})(props), "\n &:hover {\n ").concat(hoveredStyles(props), "\n }\n &, :hover, :focus, :active {\n ").concat(activeHoveredFocusedStyles(props), "\n }\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n\n ").concat(props.isHovered && hoveredWihBorderStyles(props), ";\n");
|
|
57
66
|
};
|
|
58
67
|
export var WrapperAnchor = styled.a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n"])), baseWrapperStyle, isInteractive);
|
|
59
68
|
WrapperAnchor.displayName = 'WrapperAnchor';
|
|
@@ -39,6 +39,7 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
39
39
|
_this$props$title = _this$props.title,
|
|
40
40
|
title = _this$props$title === void 0 ? '' : _this$props$title,
|
|
41
41
|
isSelected = _this$props.isSelected,
|
|
42
|
+
isHovered = _this$props.isHovered,
|
|
42
43
|
onClick = _this$props.onClick,
|
|
43
44
|
icon = _this$props.icon,
|
|
44
45
|
link = _this$props.link,
|
|
@@ -54,6 +55,7 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
54
55
|
testId: testId,
|
|
55
56
|
link: link,
|
|
56
57
|
isSelected: isSelected,
|
|
58
|
+
isHovered: isHovered,
|
|
57
59
|
onClick: onClick
|
|
58
60
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
59
61
|
emoji: titlePrefix,
|
|
@@ -26,6 +26,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
26
26
|
handleAuthorize = _ref.handleAuthorize,
|
|
27
27
|
handleFrameClick = _ref.handleFrameClick,
|
|
28
28
|
isSelected = _ref.isSelected,
|
|
29
|
+
isHovered = _ref.isHovered,
|
|
29
30
|
renderers = _ref.renderers,
|
|
30
31
|
onResolve = _ref.onResolve,
|
|
31
32
|
onError = _ref.onError,
|
|
@@ -85,6 +86,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
85
86
|
showServerActions: showServerActions,
|
|
86
87
|
link: url,
|
|
87
88
|
isSelected: isSelected,
|
|
89
|
+
isHovered: isHovered,
|
|
88
90
|
onClick: handleFrameClick,
|
|
89
91
|
testId: testIdWithStatus
|
|
90
92
|
}));
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.
|
|
13
|
+
packageVersion: "26.43.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardAppearance, CardPlatform, CardProps } from './types';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "container" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "showServerActions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "container" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "showServerActions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -19,6 +19,8 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
19
19
|
id?: string;
|
|
20
20
|
platform?: CardPlatform;
|
|
21
21
|
isSelected?: boolean;
|
|
22
|
+
/** A flag that determines whether a card is in a hover state in edit mode. Currently used for inline links only */
|
|
23
|
+
isHovered?: boolean;
|
|
22
24
|
/**
|
|
23
25
|
* @deprecated please use 'frameStyle' prop instead. Current usages will be converted in the following manner:
|
|
24
26
|
* isFrameVisible: true => frameStyle: 'show', isFrameVisible: false => frameStyle: 'showOnHover'
|
|
@@ -11,5 +11,7 @@ export interface FrameViewProps {
|
|
|
11
11
|
/** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
|
|
12
12
|
testId?: string;
|
|
13
13
|
className?: string;
|
|
14
|
+
/** A flag that determines whether a card is in hover state in edit mode. */
|
|
15
|
+
isHovered?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export declare const Frame: React.ForwardRefExoticComponent<FrameViewProps & React.RefAttributes<never>>;
|
|
@@ -4,6 +4,7 @@ export interface WrapperProps {
|
|
|
4
4
|
isSelected?: boolean;
|
|
5
5
|
isInteractive?: boolean;
|
|
6
6
|
withoutBackground?: boolean;
|
|
7
|
+
isHovered?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const WrapperAnchor: import("@emotion/styled").StyledComponent<{
|
|
9
10
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -11,6 +11,8 @@ export interface InlineCardResolvedViewProps {
|
|
|
11
11
|
lozenge?: LozengeProps;
|
|
12
12
|
/** A flag that determines whether the card is selected in edit mode. */
|
|
13
13
|
isSelected?: boolean;
|
|
14
|
+
/** A flag that determines whether a card is in hover state in edit mode. Currently used for inline only */
|
|
15
|
+
isHovered?: boolean;
|
|
14
16
|
/** The optional url */
|
|
15
17
|
link?: string;
|
|
16
18
|
/** The optional click handler */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardAppearance, CardPlatform, CardProps } from './types';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "container" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "showServerActions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "container" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "showServerActions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -19,6 +19,8 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
19
19
|
id?: string;
|
|
20
20
|
platform?: CardPlatform;
|
|
21
21
|
isSelected?: boolean;
|
|
22
|
+
/** A flag that determines whether a card is in a hover state in edit mode. Currently used for inline links only */
|
|
23
|
+
isHovered?: boolean;
|
|
22
24
|
/**
|
|
23
25
|
* @deprecated please use 'frameStyle' prop instead. Current usages will be converted in the following manner:
|
|
24
26
|
* isFrameVisible: true => frameStyle: 'show', isFrameVisible: false => frameStyle: 'showOnHover'
|
|
@@ -11,5 +11,7 @@ export interface FrameViewProps {
|
|
|
11
11
|
/** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
|
|
12
12
|
testId?: string;
|
|
13
13
|
className?: string;
|
|
14
|
+
/** A flag that determines whether a card is in hover state in edit mode. */
|
|
15
|
+
isHovered?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export declare const Frame: React.ForwardRefExoticComponent<FrameViewProps & React.RefAttributes<never>>;
|
|
@@ -4,6 +4,7 @@ export interface WrapperProps {
|
|
|
4
4
|
isSelected?: boolean;
|
|
5
5
|
isInteractive?: boolean;
|
|
6
6
|
withoutBackground?: boolean;
|
|
7
|
+
isHovered?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const WrapperAnchor: import("@emotion/styled").StyledComponent<{
|
|
9
10
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -11,6 +11,8 @@ export interface InlineCardResolvedViewProps {
|
|
|
11
11
|
lozenge?: LozengeProps;
|
|
12
12
|
/** A flag that determines whether the card is selected in edit mode. */
|
|
13
13
|
isSelected?: boolean;
|
|
14
|
+
/** A flag that determines whether a card is in hover state in edit mode. Currently used for inline only */
|
|
15
|
+
isHovered?: boolean;
|
|
14
16
|
/** The optional url */
|
|
15
17
|
link?: string;
|
|
16
18
|
/** The optional click handler */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.43.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@atlaskit/avatar": "^21.4.0",
|
|
28
28
|
"@atlaskit/avatar-group": "^9.4.0",
|
|
29
29
|
"@atlaskit/badge": "^15.2.0",
|
|
30
|
-
"@atlaskit/button": "^16.
|
|
30
|
+
"@atlaskit/button": "^16.18.0",
|
|
31
31
|
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
32
32
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
33
33
|
"@atlaskit/icon": "^22.0.0",
|