@atlaskit/tooltip 17.6.2 → 17.6.4
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 +12 -0
- package/dist/cjs/Tooltip.js +10 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/Tooltip.js +10 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/Tooltip.js +10 -5
- package/dist/esm/version.json +1 -1
- package/dist/types/types.d.ts +2 -0
- package/package.json +4 -4
- package/report.api.md +22 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/tooltip
|
|
2
2
|
|
|
3
|
+
## 17.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 17.6.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4fd77eaf22b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4fd77eaf22b) - Align TriggerProps with the actual output, and make data-testid explicit
|
|
14
|
+
|
|
3
15
|
## 17.6.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/Tooltip.js
CHANGED
|
@@ -58,7 +58,7 @@ var tooltipZIndex = _constants.layers.tooltip();
|
|
|
58
58
|
var analyticsAttributes = {
|
|
59
59
|
componentName: 'tooltip',
|
|
60
60
|
packageName: "@atlaskit/tooltip",
|
|
61
|
-
packageVersion: "17.6.
|
|
61
|
+
packageVersion: "17.6.4"
|
|
62
62
|
}; // Inverts motion direction
|
|
63
63
|
|
|
64
64
|
var invertedDirection = {
|
|
@@ -399,14 +399,19 @@ function Tooltip(_ref) {
|
|
|
399
399
|
onMouseOver: onMouseOver,
|
|
400
400
|
onMouseOut: onMouseOut,
|
|
401
401
|
onMouseMove: onMouseMove,
|
|
402
|
-
onClick: onClick,
|
|
403
402
|
onMouseDown: onMouseDown,
|
|
403
|
+
onClick: onClick,
|
|
404
404
|
onFocus: onFocus,
|
|
405
405
|
onBlur: onBlur,
|
|
406
406
|
ref: setRef,
|
|
407
|
-
'aria-describedby': tooltipId
|
|
408
|
-
|
|
409
|
-
|
|
407
|
+
'aria-describedby': tooltipId
|
|
408
|
+
}; // Don't set `data-testid` unless it's defined, as it's not in the interface.
|
|
409
|
+
|
|
410
|
+
if (testId) {
|
|
411
|
+
// @ts-expect-error - Adding `data-testid` to the TriggerProps interface breaks Buttons.
|
|
412
|
+
tooltipTriggerProps['data-testid'] = "".concat(testId, "--container");
|
|
413
|
+
}
|
|
414
|
+
|
|
410
415
|
return (0, _react2.jsx)(_react.default.Fragment, null, typeof children === 'function' ? children(tooltipTriggerProps) : (0, _react2.jsx)(CastTargetContainer, (0, _extends2.default)({}, tooltipTriggerProps, {
|
|
411
416
|
role: "presentation"
|
|
412
417
|
}), children), shouldRenderTooltipContainer ? (0, _react2.jsx)(_portal.default, {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/Tooltip.js
CHANGED
|
@@ -20,7 +20,7 @@ const tooltipZIndex = layers.tooltip();
|
|
|
20
20
|
const analyticsAttributes = {
|
|
21
21
|
componentName: 'tooltip',
|
|
22
22
|
packageName: "@atlaskit/tooltip",
|
|
23
|
-
packageVersion: "17.6.
|
|
23
|
+
packageVersion: "17.6.4"
|
|
24
24
|
}; // Inverts motion direction
|
|
25
25
|
|
|
26
26
|
const invertedDirection = {
|
|
@@ -346,14 +346,19 @@ function Tooltip({
|
|
|
346
346
|
onMouseOver,
|
|
347
347
|
onMouseOut,
|
|
348
348
|
onMouseMove,
|
|
349
|
-
onClick,
|
|
350
349
|
onMouseDown,
|
|
350
|
+
onClick,
|
|
351
351
|
onFocus,
|
|
352
352
|
onBlur,
|
|
353
353
|
ref: setRef,
|
|
354
|
-
'aria-describedby': tooltipId
|
|
355
|
-
|
|
356
|
-
|
|
354
|
+
'aria-describedby': tooltipId
|
|
355
|
+
}; // Don't set `data-testid` unless it's defined, as it's not in the interface.
|
|
356
|
+
|
|
357
|
+
if (testId) {
|
|
358
|
+
// @ts-expect-error - Adding `data-testid` to the TriggerProps interface breaks Buttons.
|
|
359
|
+
tooltipTriggerProps['data-testid'] = `${testId}--container`;
|
|
360
|
+
}
|
|
361
|
+
|
|
357
362
|
return jsx(React.Fragment, null, typeof children === 'function' ? children(tooltipTriggerProps) : jsx(CastTargetContainer, _extends({}, tooltipTriggerProps, {
|
|
358
363
|
role: "presentation"
|
|
359
364
|
}), children), shouldRenderTooltipContainer ? jsx(Portal, {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/Tooltip.js
CHANGED
|
@@ -26,7 +26,7 @@ var tooltipZIndex = layers.tooltip();
|
|
|
26
26
|
var analyticsAttributes = {
|
|
27
27
|
componentName: 'tooltip',
|
|
28
28
|
packageName: "@atlaskit/tooltip",
|
|
29
|
-
packageVersion: "17.6.
|
|
29
|
+
packageVersion: "17.6.4"
|
|
30
30
|
}; // Inverts motion direction
|
|
31
31
|
|
|
32
32
|
var invertedDirection = {
|
|
@@ -367,14 +367,19 @@ function Tooltip(_ref) {
|
|
|
367
367
|
onMouseOver: onMouseOver,
|
|
368
368
|
onMouseOut: onMouseOut,
|
|
369
369
|
onMouseMove: onMouseMove,
|
|
370
|
-
onClick: onClick,
|
|
371
370
|
onMouseDown: onMouseDown,
|
|
371
|
+
onClick: onClick,
|
|
372
372
|
onFocus: onFocus,
|
|
373
373
|
onBlur: onBlur,
|
|
374
374
|
ref: setRef,
|
|
375
|
-
'aria-describedby': tooltipId
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
'aria-describedby': tooltipId
|
|
376
|
+
}; // Don't set `data-testid` unless it's defined, as it's not in the interface.
|
|
377
|
+
|
|
378
|
+
if (testId) {
|
|
379
|
+
// @ts-expect-error - Adding `data-testid` to the TriggerProps interface breaks Buttons.
|
|
380
|
+
tooltipTriggerProps['data-testid'] = "".concat(testId, "--container");
|
|
381
|
+
}
|
|
382
|
+
|
|
378
383
|
return jsx(React.Fragment, null, typeof children === 'function' ? children(tooltipTriggerProps) : jsx(CastTargetContainer, _extends({}, tooltipTriggerProps, {
|
|
379
384
|
role: "presentation"
|
|
380
385
|
}), children), shouldRenderTooltipContainer ? jsx(Portal, {
|
package/dist/esm/version.json
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -7,11 +7,13 @@ export declare type PositionType = PositionTypeBase | 'mouse';
|
|
|
7
7
|
export interface TriggerProps {
|
|
8
8
|
onMouseOver: (event: React.MouseEvent<HTMLElement>) => void;
|
|
9
9
|
onMouseOut: (event: React.MouseEvent<HTMLElement>) => void;
|
|
10
|
+
onMouseMove: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
10
11
|
onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
|
|
11
12
|
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
12
13
|
onFocus: (event: React.FocusEvent<HTMLElement>) => void;
|
|
13
14
|
onBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
14
15
|
ref: (node: HTMLElement | null) => void;
|
|
16
|
+
'aria-describedby': string | undefined;
|
|
15
17
|
}
|
|
16
18
|
export interface TooltipProps {
|
|
17
19
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tooltip",
|
|
3
|
-
"version": "17.6.
|
|
3
|
+
"version": "17.6.4",
|
|
4
4
|
"description": "A tooltip is a floating, non-actionable label used to explain a user interface element or feature.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
36
36
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
37
37
|
"@atlaskit/motion": "^1.3.0",
|
|
38
|
-
"@atlaskit/popper": "^5.
|
|
38
|
+
"@atlaskit/popper": "^5.4.0",
|
|
39
39
|
"@atlaskit/portal": "^4.1.0",
|
|
40
40
|
"@atlaskit/theme": "^12.2.0",
|
|
41
|
-
"@atlaskit/tokens": "^0.
|
|
41
|
+
"@atlaskit/tokens": "^0.12.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/react": "^11.7.1",
|
|
44
44
|
"bind-event-listener": "^2.1.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-dom": "^16.8.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@atlaskit/button": "^16.
|
|
52
|
+
"@atlaskit/button": "^16.5.0",
|
|
53
53
|
"@atlaskit/docs": "*",
|
|
54
54
|
"@atlaskit/icon": "^21.11.0",
|
|
55
55
|
"@atlaskit/section-message": "^6.3.0",
|
package/report.api.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
<!-- API Report Version: 2.2 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/tooltip"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
### Main Entry Types
|
|
13
|
+
|
|
14
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
15
|
|
|
11
16
|
```ts
|
|
12
17
|
import { ComponentType } from 'react';
|
|
@@ -19,7 +24,7 @@ import { RefAttributes } from 'react';
|
|
|
19
24
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
20
25
|
|
|
21
26
|
// @public (undocumented)
|
|
22
|
-
export type PositionType =
|
|
27
|
+
export type PositionType = 'mouse' | PositionTypeBase;
|
|
23
28
|
|
|
24
29
|
// @public (undocumented)
|
|
25
30
|
type PositionTypeBase = Placement;
|
|
@@ -54,14 +59,14 @@ export default Tooltip;
|
|
|
54
59
|
export const TooltipPrimitive: ForwardRefExoticComponent<
|
|
55
60
|
Pick<
|
|
56
61
|
TooltipPrimitiveProps,
|
|
57
|
-
| 'style'
|
|
58
|
-
| 'className'
|
|
59
62
|
| 'children'
|
|
60
|
-
| '
|
|
61
|
-
| '
|
|
63
|
+
| 'className'
|
|
64
|
+
| 'id'
|
|
62
65
|
| 'onMouseOut'
|
|
63
66
|
| 'onMouseOver'
|
|
64
|
-
| '
|
|
67
|
+
| 'placement'
|
|
68
|
+
| 'style'
|
|
69
|
+
| 'testId'
|
|
65
70
|
| 'truncate'
|
|
66
71
|
> &
|
|
67
72
|
RefAttributes<HTMLDivElement>
|
|
@@ -94,9 +99,9 @@ export interface TooltipPrimitiveProps {
|
|
|
94
99
|
// @public (undocumented)
|
|
95
100
|
export interface TooltipProps {
|
|
96
101
|
analyticsContext?: Record<string, any>;
|
|
97
|
-
children:
|
|
102
|
+
children: ((props: TriggerProps) => ReactNode) | ReactNode;
|
|
98
103
|
component?: ComponentType<TooltipPrimitiveProps>;
|
|
99
|
-
content:
|
|
104
|
+
content: (({ update }: { update: () => void }) => ReactNode) | ReactNode;
|
|
100
105
|
delay?: number;
|
|
101
106
|
hideTooltipOnClick?: boolean;
|
|
102
107
|
hideTooltipOnMouseDown?: boolean;
|
|
@@ -106,12 +111,12 @@ export interface TooltipProps {
|
|
|
106
111
|
position?: PositionType;
|
|
107
112
|
strategy?: 'absolute' | 'fixed' | undefined;
|
|
108
113
|
tag?:
|
|
109
|
-
| keyof JSX.IntrinsicElements
|
|
110
114
|
| React.ComponentType<
|
|
111
115
|
React.AllHTMLAttributes<HTMLElement> & {
|
|
112
116
|
ref: React.Ref<HTMLElement>;
|
|
113
117
|
}
|
|
114
|
-
|
|
118
|
+
>
|
|
119
|
+
| keyof JSX.IntrinsicElements;
|
|
115
120
|
testId?: string;
|
|
116
121
|
truncate?: boolean;
|
|
117
122
|
}
|
|
@@ -136,3 +141,5 @@ interface TriggerProps {
|
|
|
136
141
|
|
|
137
142
|
// (No @packageDocumentation comment for this package)
|
|
138
143
|
```
|
|
144
|
+
|
|
145
|
+
<!--SECTION END: Main Entry Types-->
|