@atlaskit/tooltip 18.1.2 → 18.2.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/tooltip
2
2
 
3
+ ## 18.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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.
8
+
9
+ ## 18.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
14
+
3
15
  ## 18.1.2
4
16
 
5
17
  ### Patch Changes
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/Tooltip.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/Tooltip.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/TooltipContainer.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/TooltipContainer.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/TooltipPrimitive.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/TooltipPrimitive.d.ts"
12
12
  ]
@@ -24,15 +24,15 @@ var _tooltipManager = require("./internal/tooltip-manager");
24
24
  var _useUniqueId = _interopRequireDefault(require("./internal/use-unique-id"));
25
25
  var _TooltipContainer = _interopRequireDefault(require("./TooltipContainer"));
26
26
  var _utilities = require("./utilities");
27
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
28
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
28
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
29
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
30
30
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
31
  var tooltipZIndex = _constants.layers.tooltip();
32
32
  var analyticsAttributes = {
33
33
  componentName: 'tooltip',
34
34
  packageName: "@atlaskit/tooltip",
35
- packageVersion: "18.1.2"
35
+ packageVersion: "18.2.0"
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, ")"),
@@ -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.2"
21
+ packageVersion: "18.2.0"
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})`,
@@ -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.2"
25
+ packageVersion: "18.2.0"
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,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.2",
3
+ "version": "18.2.0",
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.38.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.5.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",
@@ -72,7 +72,7 @@
72
72
  "react-dom": "^16.8.0",
73
73
  "react-redux": "^5.1.2",
74
74
  "storybook-addon-performance": "^0.16.0",
75
- "typescript": "~4.9.5",
75
+ "typescript": "~5.4.2",
76
76
  "wait-for-expect": "^1.2.0"
77
77
  },
78
78
  "keywords": [
@@ -101,4 +101,4 @@
101
101
  },
102
102
  "homepage": "https://atlassian.design/components/tooltip/",
103
103
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
104
- }
104
+ }
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/types.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/utilities.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/utilities.d.ts"
12
12
  ]