@atlaskit/tooltip 18.1.3 → 18.2.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/tooltip
2
2
 
3
+ ## 18.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#88717](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88717) [`d92770eae702`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d92770eae702) - Adding internal eslint opt outs for a new rule `@atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop`.
8
+
9
+ ## 18.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#87879](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87879) [`40c7b496eacd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40c7b496eacd) - [ux] Internal changes to typography, small visual change to tooltip text line height.
14
+
3
15
  ## 18.1.3
4
16
 
5
17
  ### Patch Changes
@@ -32,7 +32,7 @@ var tooltipZIndex = _constants.layers.tooltip();
32
32
  var analyticsAttributes = {
33
33
  componentName: 'tooltip',
34
34
  packageName: "@atlaskit/tooltip",
35
- packageVersion: "18.1.3"
35
+ packageVersion: "18.2.1"
36
36
  };
37
37
 
38
38
  // Inverts motion direction
@@ -18,8 +18,7 @@ var baseStyles = (0, _react2.css)({
18
18
  insetBlockStart: "var(--ds-space-0, 0px)",
19
19
  insetInlineStart: "var(--ds-space-0, 0px)",
20
20
  borderRadius: "var(--ds-border-radius, 3px)",
21
- fontSize: "var(--ds-font-size-075, 12px)",
22
- lineHeight: 1.3,
21
+ font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
23
22
  overflowWrap: 'break-word',
24
23
  wordWrap: 'break-word',
25
24
  backgroundColor: "var(--ds-background-neutral-bold, ".concat(_colors.N800, ")"),
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.register = register;
7
7
  var _bindEventListener = require("bind-event-listener");
8
+ /* eslint-disable @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop */
8
9
  /**
9
10
  * We are listening directly to drag events instead of using a monitor from
10
11
  * `@atlaskit/pragmatic-drag-and-drop` to avoid the bundle size cost, as it
@@ -18,7 +18,7 @@ const tooltipZIndex = layers.tooltip();
18
18
  const analyticsAttributes = {
19
19
  componentName: 'tooltip',
20
20
  packageName: "@atlaskit/tooltip",
21
- packageVersion: "18.1.3"
21
+ packageVersion: "18.2.1"
22
22
  };
23
23
 
24
24
  // Inverts motion direction
@@ -10,8 +10,7 @@ const baseStyles = css({
10
10
  insetBlockStart: "var(--ds-space-0, 0px)",
11
11
  insetInlineStart: "var(--ds-space-0, 0px)",
12
12
  borderRadius: "var(--ds-border-radius, 3px)",
13
- fontSize: "var(--ds-font-size-075, 12px)",
14
- lineHeight: 1.3,
13
+ font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
15
14
  overflowWrap: 'break-word',
16
15
  wordWrap: 'break-word',
17
16
  backgroundColor: `var(--ds-background-neutral-bold, ${N800})`,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop */
1
2
  /**
2
3
  * We are listening directly to drag events instead of using a monitor from
3
4
  * `@atlaskit/pragmatic-drag-and-drop` to avoid the bundle size cost, as it
@@ -22,7 +22,7 @@ var tooltipZIndex = layers.tooltip();
22
22
  var analyticsAttributes = {
23
23
  componentName: 'tooltip',
24
24
  packageName: "@atlaskit/tooltip",
25
- packageVersion: "18.1.3"
25
+ packageVersion: "18.2.1"
26
26
  };
27
27
 
28
28
  // Inverts motion direction
@@ -10,8 +10,7 @@ var baseStyles = css({
10
10
  insetBlockStart: "var(--ds-space-0, 0px)",
11
11
  insetInlineStart: "var(--ds-space-0, 0px)",
12
12
  borderRadius: "var(--ds-border-radius, 3px)",
13
- fontSize: "var(--ds-font-size-075, 12px)",
14
- lineHeight: 1.3,
13
+ font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
15
14
  overflowWrap: 'break-word',
16
15
  wordWrap: 'break-word',
17
16
  backgroundColor: "var(--ds-background-neutral-bold, ".concat(N800, ")"),
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop */
1
2
  /**
2
3
  * We are listening directly to drag events instead of using a monitor from
3
4
  * `@atlaskit/pragmatic-drag-and-drop` to avoid the bundle size cost, as it
@@ -1,4 +1,4 @@
1
1
  export { default } from './Tooltip';
2
2
  export { default as TooltipPrimitive } from './TooltipPrimitive';
3
3
  export type { TooltipPrimitiveProps } from './TooltipPrimitive';
4
- export type { PositionType, TooltipProps } from './types';
4
+ export type { PositionType, TooltipProps, TriggerProps } from './types';
@@ -20,7 +20,6 @@ export interface TooltipProps {
20
20
  * The content of the tooltip. It can be either a:
21
21
  * 1. `ReactNode`
22
22
  * 2. Function which returns a `ReactNode`
23
-
24
23
  * The benefit of the second approach is that it allows you to consume the `update` render prop.
25
24
  * This `update` function can be called to manually recalculate the position of the tooltip.
26
25
  */
@@ -36,8 +35,7 @@ export interface TooltipProps {
36
35
  */
37
36
  delay?: number;
38
37
  /**
39
- * Hide the tooltip when the click event is triggered. This should be
40
- * used when tooltip should be hidden if `onClick` react synthetic event
38
+ * Hide the tooltip when the click event is triggered. Use this when the tooltip should be hidden if `onClick` react synthetic event
41
39
  * is triggered, which happens after `onMouseDown` event.
42
40
  */
43
41
  hideTooltipOnClick?: boolean;
@@ -49,36 +47,36 @@ export interface TooltipProps {
49
47
  hideTooltipOnMouseDown?: boolean;
50
48
  /**
51
49
  * Where the tooltip should appear relative to the mouse pointer.
52
- * Only used when the `position` prop is set to `"mouse"`.
53
- * When interacting with the target element using the keyboard will use this position against the target element instead.
50
+ * Only use this when the `position` prop is set to `"mouse"`.
51
+ * When interacting with the target element using a keyboard, it will use this position against the target element instead.
54
52
  */
55
53
  mousePosition?: PositionTypeBase;
56
54
  /**
57
- * Function to be called when the tooltip will be shown. It is called when the
55
+ * Function to be called when the tooltip will be shown. It's called when the
58
56
  * tooltip begins to animate in.
59
57
  */
60
58
  onShow?: (analyticsEvent: UIAnalyticsEvent) => void;
61
59
  /**
62
- * Function to be called when the tooltip will be hidden. It is called after the
60
+ * Function to be called when the tooltip will be hidden. It's called after the
63
61
  * delay, when the tooltip begins to animate out.
64
62
  */
65
63
  onHide?: (analyticsEvent: UIAnalyticsEvent) => void;
66
64
  /**
67
- * Where the tooltip should appear relative to its target.
68
- * If set to `"mouse"` the tooltip will display next to the mouse pointer instead.
65
+ * Where the tooltip should appear relative to its' target.
66
+ * If set to `"mouse"`, the tooltip will display next to the mouse pointer instead.
69
67
  * Make sure to utilize the `mousePosition` if you want to customize where the tooltip will show in relation to the mouse.
70
68
  */
71
69
  position?: PositionType;
72
70
  /**
73
71
  * Replace the wrapping element. This accepts the name of a html tag which will
74
72
  * be used to wrap the element.
75
- * If you provide a component it needs to support a ref prop which is used by popper for positioning.
73
+ * If you provide a component, it needs to support a ref prop which is used by popper for positioning.
76
74
  */
77
75
  tag?: keyof JSX.IntrinsicElements | React.ComponentType<React.AllHTMLAttributes<HTMLElement> & {
78
76
  ref: React.Ref<HTMLElement>;
79
77
  }>;
80
78
  /**
81
- * Used to show only one line of text, and truncate when too long. Avoid this wherever possible, as any important information that is truncated will be visually hidden to the person reading the tooltip.
79
+ * Use this to show only one line of text, and truncate the text when it's too long. We no longer support truncating text in the tooltip as it's inaccessible, and this will be removed in a future release.
82
80
  */
83
81
  truncate?: boolean;
84
82
  /**
@@ -96,7 +94,7 @@ export interface TooltipProps {
96
94
  /** Analytics context metadata. */
97
95
  analyticsContext?: Record<string, any>;
98
96
  /**
99
- * Used to define the strategy of popper.
97
+ * Use this to define the strategy of popper.
100
98
  */
101
99
  strategy?: 'absolute' | 'fixed' | undefined;
102
100
  }
@@ -1,4 +1,4 @@
1
1
  export { default } from './Tooltip';
2
2
  export { default as TooltipPrimitive } from './TooltipPrimitive';
3
3
  export type { TooltipPrimitiveProps } from './TooltipPrimitive';
4
- export type { PositionType, TooltipProps } from './types';
4
+ export type { PositionType, TooltipProps, TriggerProps } from './types';
@@ -20,7 +20,6 @@ export interface TooltipProps {
20
20
  * The content of the tooltip. It can be either a:
21
21
  * 1. `ReactNode`
22
22
  * 2. Function which returns a `ReactNode`
23
-
24
23
  * The benefit of the second approach is that it allows you to consume the `update` render prop.
25
24
  * This `update` function can be called to manually recalculate the position of the tooltip.
26
25
  */
@@ -36,8 +35,7 @@ export interface TooltipProps {
36
35
  */
37
36
  delay?: number;
38
37
  /**
39
- * Hide the tooltip when the click event is triggered. This should be
40
- * used when tooltip should be hidden if `onClick` react synthetic event
38
+ * Hide the tooltip when the click event is triggered. Use this when the tooltip should be hidden if `onClick` react synthetic event
41
39
  * is triggered, which happens after `onMouseDown` event.
42
40
  */
43
41
  hideTooltipOnClick?: boolean;
@@ -49,36 +47,36 @@ export interface TooltipProps {
49
47
  hideTooltipOnMouseDown?: boolean;
50
48
  /**
51
49
  * Where the tooltip should appear relative to the mouse pointer.
52
- * Only used when the `position` prop is set to `"mouse"`.
53
- * When interacting with the target element using the keyboard will use this position against the target element instead.
50
+ * Only use this when the `position` prop is set to `"mouse"`.
51
+ * When interacting with the target element using a keyboard, it will use this position against the target element instead.
54
52
  */
55
53
  mousePosition?: PositionTypeBase;
56
54
  /**
57
- * Function to be called when the tooltip will be shown. It is called when the
55
+ * Function to be called when the tooltip will be shown. It's called when the
58
56
  * tooltip begins to animate in.
59
57
  */
60
58
  onShow?: (analyticsEvent: UIAnalyticsEvent) => void;
61
59
  /**
62
- * Function to be called when the tooltip will be hidden. It is called after the
60
+ * Function to be called when the tooltip will be hidden. It's called after the
63
61
  * delay, when the tooltip begins to animate out.
64
62
  */
65
63
  onHide?: (analyticsEvent: UIAnalyticsEvent) => void;
66
64
  /**
67
- * Where the tooltip should appear relative to its target.
68
- * If set to `"mouse"` the tooltip will display next to the mouse pointer instead.
65
+ * Where the tooltip should appear relative to its' target.
66
+ * If set to `"mouse"`, the tooltip will display next to the mouse pointer instead.
69
67
  * Make sure to utilize the `mousePosition` if you want to customize where the tooltip will show in relation to the mouse.
70
68
  */
71
69
  position?: PositionType;
72
70
  /**
73
71
  * Replace the wrapping element. This accepts the name of a html tag which will
74
72
  * be used to wrap the element.
75
- * If you provide a component it needs to support a ref prop which is used by popper for positioning.
73
+ * If you provide a component, it needs to support a ref prop which is used by popper for positioning.
76
74
  */
77
75
  tag?: keyof JSX.IntrinsicElements | React.ComponentType<React.AllHTMLAttributes<HTMLElement> & {
78
76
  ref: React.Ref<HTMLElement>;
79
77
  }>;
80
78
  /**
81
- * Used to show only one line of text, and truncate when too long. Avoid this wherever possible, as any important information that is truncated will be visually hidden to the person reading the tooltip.
79
+ * Use this to show only one line of text, and truncate the text when it's too long. We no longer support truncating text in the tooltip as it's inaccessible, and this will be removed in a future release.
82
80
  */
83
81
  truncate?: boolean;
84
82
  /**
@@ -96,7 +94,7 @@ export interface TooltipProps {
96
94
  /** Analytics context metadata. */
97
95
  analyticsContext?: Record<string, any>;
98
96
  /**
99
- * Used to define the strategy of popper.
97
+ * Use this to define the strategy of popper.
100
98
  */
101
99
  strategy?: 'absolute' | 'fixed' | undefined;
102
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tooltip",
3
- "version": "18.1.3",
3
+ "version": "18.2.1",
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/"
@@ -47,8 +47,8 @@
47
47
  "@atlaskit/motion": "^1.5.0",
48
48
  "@atlaskit/popper": "^5.5.0",
49
49
  "@atlaskit/portal": "^4.4.0",
50
- "@atlaskit/theme": "^12.6.0",
51
- "@atlaskit/tokens": "^1.42.0",
50
+ "@atlaskit/theme": "^12.7.0",
51
+ "@atlaskit/tokens": "^1.43.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",
54
54
  "bind-event-listener": "^2.1.1",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@af/accessibility-testing": "*",
63
- "@atlaskit/button": "^17.7.0",
63
+ "@atlaskit/button": "^17.11.0",
64
64
  "@atlaskit/ssr": "*",
65
65
  "@atlaskit/visual-regression": "*",
66
66
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",