@atlaskit/tooltip 17.8.2 → 17.8.3

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,11 @@
1
1
  # @atlaskit/tooltip
2
2
 
3
+ ## 17.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
8
+
3
9
  ## 17.8.2
4
10
 
5
11
  ### 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: "17.8.2"
35
+ packageVersion: "17.8.3"
36
36
  };
37
37
 
38
38
  // Inverts motion direction
@@ -18,7 +18,7 @@ var baseStyles = (0, _react2.css)({
18
18
  padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)"),
19
19
  top: "var(--ds-space-0, 0px)",
20
20
  left: "var(--ds-space-0, 0px)",
21
- borderRadius: "var(--ds-radius-100, 3px)",
21
+ borderRadius: "var(--ds-border-radius, 3px)",
22
22
  fontSize: "var(--ds-font-size-075, 12px)",
23
23
  lineHeight: 1.3,
24
24
  overflowWrap: 'break-word',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/tooltip",
3
- "version": "17.8.2",
3
+ "version": "17.8.3",
4
4
  "sideEffects": false
5
5
  }
@@ -20,7 +20,7 @@ const tooltipZIndex = layers.tooltip();
20
20
  const analyticsAttributes = {
21
21
  componentName: 'tooltip',
22
22
  packageName: "@atlaskit/tooltip",
23
- packageVersion: "17.8.2"
23
+ packageVersion: "17.8.3"
24
24
  };
25
25
 
26
26
  // Inverts motion direction
@@ -10,7 +10,7 @@ const baseStyles = css({
10
10
  padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-075, 6px)"}`,
11
11
  top: "var(--ds-space-0, 0px)",
12
12
  left: "var(--ds-space-0, 0px)",
13
- borderRadius: "var(--ds-radius-100, 3px)",
13
+ borderRadius: "var(--ds-border-radius, 3px)",
14
14
  fontSize: "var(--ds-font-size-075, 12px)",
15
15
  lineHeight: 1.3,
16
16
  overflowWrap: 'break-word',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/tooltip",
3
- "version": "17.8.2",
3
+ "version": "17.8.3",
4
4
  "sideEffects": false
5
5
  }
@@ -24,7 +24,7 @@ var tooltipZIndex = layers.tooltip();
24
24
  var analyticsAttributes = {
25
25
  componentName: 'tooltip',
26
26
  packageName: "@atlaskit/tooltip",
27
- packageVersion: "17.8.2"
27
+ packageVersion: "17.8.3"
28
28
  };
29
29
 
30
30
  // Inverts motion direction
@@ -10,7 +10,7 @@ var baseStyles = css({
10
10
  padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)"),
11
11
  top: "var(--ds-space-0, 0px)",
12
12
  left: "var(--ds-space-0, 0px)",
13
- borderRadius: "var(--ds-radius-100, 3px)",
13
+ borderRadius: "var(--ds-border-radius, 3px)",
14
14
  fontSize: "var(--ds-font-size-075, 12px)",
15
15
  lineHeight: 1.3,
16
16
  overflowWrap: 'break-word',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/tooltip",
3
- "version": "17.8.2",
3
+ "version": "17.8.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tooltip",
3
- "version": "17.8.2",
3
+ "version": "17.8.3",
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/"
@@ -24,7 +24,7 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Design System Team",
27
- "releaseModel": "scheduled",
27
+ "releaseModel": "continuous",
28
28
  "website": {
29
29
  "name": "Tooltip",
30
30
  "category": "Components"
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/popper": "^5.5.0",
46
46
  "@atlaskit/portal": "^4.3.0",
47
47
  "@atlaskit/theme": "^12.5.0",
48
- "@atlaskit/tokens": "^1.4.0",
48
+ "@atlaskit/tokens": "^1.11.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@emotion/react": "^11.7.1",
51
51
  "bind-event-listener": "^2.1.1",
@@ -56,17 +56,17 @@
56
56
  "react-dom": "^16.8.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@atlaskit/button": "^16.7.0",
59
+ "@atlaskit/button": "^16.8.0",
60
60
  "@atlaskit/docs": "*",
61
61
  "@atlaskit/icon": "^21.12.0",
62
62
  "@atlaskit/section-message": "^6.4.0",
63
63
  "@atlaskit/ssr": "*",
64
64
  "@atlaskit/visual-regression": "*",
65
- "@atlaskit/webdriver-runner": "*",
66
65
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
67
66
  "@emotion/styled": "^11.0.0",
68
67
  "@testing-library/dom": "^8.17.1",
69
68
  "@testing-library/react": "^12.1.5",
69
+ "jest-axe": "^4.0.0",
70
70
  "jest-in-case": "^1.0.2",
71
71
  "react-dom": "^16.8.0",
72
72
  "react-redux": "^5.1.2",
@@ -0,0 +1,106 @@
1
+ ## API Report File for "@atlaskit/tooltip"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { ComponentType } from 'react';
8
+ import { CSSProperties } from 'react';
9
+ import { ForwardRefExoticComponent } from 'react';
10
+ import { jsx } from '@emotion/react';
11
+ import { Placement } from '@atlaskit/popper';
12
+ import { ReactNode } from 'react';
13
+ import { RefAttributes } from 'react';
14
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
15
+
16
+ // @public (undocumented)
17
+ export type PositionType = 'mouse' | PositionTypeBase;
18
+
19
+ // @public (undocumented)
20
+ type PositionTypeBase = Placement;
21
+
22
+ // @public (undocumented)
23
+ function Tooltip({ children, position, mousePosition, content, truncate, component: Container, tag: TargetContainer, testId, delay, onShow, onHide, hideTooltipOnClick, hideTooltipOnMouseDown, analyticsContext, strategy, }: TooltipProps): jsx.JSX.Element;
24
+
25
+ // @public (undocumented)
26
+ namespace Tooltip {
27
+ var // (undocumented)
28
+ displayName: string;
29
+ }
30
+ export default Tooltip;
31
+
32
+ // @public (undocumented)
33
+ export const TooltipPrimitive: ForwardRefExoticComponent<Pick<TooltipPrimitiveProps, "children" | "className" | "id" | "onMouseOut" | "onMouseOver" | "placement" | "style" | "testId" | "truncate"> & RefAttributes<HTMLDivElement>>;
34
+
35
+ // @public (undocumented)
36
+ export interface TooltipPrimitiveProps {
37
+ // (undocumented)
38
+ children: ReactNode;
39
+ // (undocumented)
40
+ className?: string;
41
+ // (undocumented)
42
+ id?: string;
43
+ // (undocumented)
44
+ onMouseOut?: (e: React.MouseEvent<HTMLElement>) => void;
45
+ // (undocumented)
46
+ onMouseOver?: (e: React.MouseEvent<HTMLElement>) => void;
47
+ // (undocumented)
48
+ placement: PositionType;
49
+ // (undocumented)
50
+ ref: React.Ref<any>;
51
+ // (undocumented)
52
+ style?: CSSProperties;
53
+ // (undocumented)
54
+ testId?: string;
55
+ // (undocumented)
56
+ truncate?: boolean;
57
+ }
58
+
59
+ // @public (undocumented)
60
+ export interface TooltipProps {
61
+ analyticsContext?: Record<string, any>;
62
+ children: ((props: TriggerProps) => ReactNode) | ReactNode;
63
+ component?: ComponentType<TooltipPrimitiveProps>;
64
+ content: (({ update }: {
65
+ update: () => void;
66
+ }) => ReactNode) | ReactNode;
67
+ delay?: number;
68
+ hideTooltipOnClick?: boolean;
69
+ hideTooltipOnMouseDown?: boolean;
70
+ mousePosition?: PositionTypeBase;
71
+ onHide?: (analyticsEvent: UIAnalyticsEvent) => void;
72
+ onShow?: (analyticsEvent: UIAnalyticsEvent) => void;
73
+ position?: PositionType;
74
+ strategy?: 'absolute' | 'fixed' | undefined;
75
+ tag?: React.ComponentType<React.AllHTMLAttributes<HTMLElement> & {
76
+ ref: React.Ref<HTMLElement>;
77
+ }> | keyof JSX.IntrinsicElements;
78
+ testId?: string;
79
+ truncate?: boolean;
80
+ }
81
+
82
+ // @public (undocumented)
83
+ interface TriggerProps {
84
+ // (undocumented)
85
+ 'aria-describedby'?: string | undefined;
86
+ // (undocumented)
87
+ onBlur: (event: React.FocusEvent<HTMLElement>) => void;
88
+ // (undocumented)
89
+ onClick: (event: React.MouseEvent<HTMLElement>) => void;
90
+ // (undocumented)
91
+ onFocus: (event: React.FocusEvent<HTMLElement>) => void;
92
+ // (undocumented)
93
+ onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
94
+ // (undocumented)
95
+ onMouseMove: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
96
+ // (undocumented)
97
+ onMouseOut: (event: React.MouseEvent<HTMLElement>) => void;
98
+ // (undocumented)
99
+ onMouseOver: (event: React.MouseEvent<HTMLElement>) => void;
100
+ // (undocumented)
101
+ ref: (node: HTMLElement | null) => void;
102
+ }
103
+
104
+ // (No @packageDocumentation comment for this package)
105
+
106
+ ```
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = PropsHack;
7
- /* Note: this file is a workaround because extract-react-types cannot correctly process the "tag" prop
8
- It is a copy paste of the `TooltipProps` from `types.ts` except for the `tag` prop which is different */
9
-
10
- function PropsHack(props) {
11
- return null;
12
- }
@@ -1,6 +0,0 @@
1
- /* Note: this file is a workaround because extract-react-types cannot correctly process the "tag" prop
2
- It is a copy paste of the `TooltipProps` from `types.ts` except for the `tag` prop which is different */
3
-
4
- export default function PropsHack(props) {
5
- return null;
6
- }
@@ -1,6 +0,0 @@
1
- /* Note: this file is a workaround because extract-react-types cannot correctly process the "tag" prop
2
- It is a copy paste of the `TooltipProps` from `types.ts` except for the `tag` prop which is different */
3
-
4
- export default function PropsHack(props) {
5
- return null;
6
- }
@@ -1,84 +0,0 @@
1
- import { ComponentType, ElementType, ReactNode } from 'react';
2
- import { TooltipPrimitiveProps } from '../TooltipPrimitive';
3
- import { PositionType, PositionTypeBase } from '../types';
4
- type Props = {
5
- /**
6
- * The content of the tooltip. It can be either a:
7
- * 1. `ReactNode`
8
- * 2. Function which returns a `ReactNode`
9
-
10
- * The benefit of the second approach is that it allows you to consume the `update` render prop.
11
- * This `update` function can be called to manually recalculate the position of the tooltip.
12
- */
13
- content: ReactNode | (({ update }: {
14
- update: () => void;
15
- }) => ReactNode);
16
- /**
17
- * Extend `TooltipPrimitive` to create your own tooltip and pass it as component
18
- */
19
- component?: ComponentType<TooltipPrimitiveProps>;
20
- /**
21
- * Time in milliseconds to wait before showing and hiding the tooltip. Defaults to 300.
22
- */
23
- delay?: number;
24
- /**
25
- * Hide the tooltip when the click event is triggered. This should be
26
- * used when tooltip should be hidden if `onClick` react synthetic event
27
- * is triggered, which happens after `onMouseDown` event
28
- */
29
- hideTooltipOnClick?: boolean;
30
- /**
31
- * Hide the tooltip when the mousedown event is triggered. This should be
32
- * used when tooltip should be hidden if `onMouseDown` react synthetic event
33
- * is triggered, which happens before `onClick` event
34
- */
35
- hideTooltipOnMouseDown?: boolean;
36
- /**
37
- * Where the tooltip should appear relative to the mouse pointer.
38
- * Only used when the `position` prop is set to `"mouse"`.
39
- * When interacting with the target element using the keyboard will use this position against the target element instead.
40
- */
41
- mousePosition?: PositionTypeBase;
42
- /**
43
- * Function to be called when the tooltip will be shown. It is called when the
44
- * tooltip begins to animate in.
45
- */
46
- onShow?: () => void;
47
- /**
48
- * Function to be called when the tooltip will be hidden. It is called after the
49
- * delay, when the tooltip begins to animate out.
50
- */
51
- onHide?: () => void;
52
- /**
53
- * Where the tooltip should appear relative to its target.
54
- * If set to `"mouse"` the tooltip will display next to the mouse pointer instead.
55
- * Make sure to utilize the `mousePosition` if you want to customize where the tooltip will show in relation to the mouse.
56
- */
57
- position?: PositionType;
58
- /**
59
- * Replace the wrapping element. This accepts the name of a html tag which will
60
- * be used to wrap the element.
61
- * If you provide a component it needs to support a ref prop which is used by popper for positioning
62
- * Note: actual type is not ElementType, it is either a JSX.IntrinsticElement (eg "div")
63
- * or a component that supports React.AllHTMLAttributes<HTMLElement> has a ref prop (React.Ref<HTMLElement>).
64
- * Using ElementType here for documentation because it is close and works with our prop extraction tool
65
- */
66
- tag?: ElementType;
67
- /**
68
- * Show only one line of text, and truncate when too long
69
- */
70
- truncate?: boolean;
71
- /**
72
- * Elements to be wrapped by the tooltip
73
- */
74
- children: ReactNode;
75
- /**
76
- * A `testId` prop is provided for specified elements, which is a unique
77
- * string that appears as a data attribute `data-testid` in the rendered code,
78
- * serving as a hook for automated tests */
79
- testId?: string;
80
- /** Analytics context metadata */
81
- analyticsContext?: Record<string, any>;
82
- };
83
- export default function PropsHack(props: Props): null;
84
- export {};
@@ -1,84 +0,0 @@
1
- import { ComponentType, ElementType, ReactNode } from 'react';
2
- import { TooltipPrimitiveProps } from '../TooltipPrimitive';
3
- import { PositionType, PositionTypeBase } from '../types';
4
- type Props = {
5
- /**
6
- * The content of the tooltip. It can be either a:
7
- * 1. `ReactNode`
8
- * 2. Function which returns a `ReactNode`
9
-
10
- * The benefit of the second approach is that it allows you to consume the `update` render prop.
11
- * This `update` function can be called to manually recalculate the position of the tooltip.
12
- */
13
- content: ReactNode | (({ update }: {
14
- update: () => void;
15
- }) => ReactNode);
16
- /**
17
- * Extend `TooltipPrimitive` to create your own tooltip and pass it as component
18
- */
19
- component?: ComponentType<TooltipPrimitiveProps>;
20
- /**
21
- * Time in milliseconds to wait before showing and hiding the tooltip. Defaults to 300.
22
- */
23
- delay?: number;
24
- /**
25
- * Hide the tooltip when the click event is triggered. This should be
26
- * used when tooltip should be hidden if `onClick` react synthetic event
27
- * is triggered, which happens after `onMouseDown` event
28
- */
29
- hideTooltipOnClick?: boolean;
30
- /**
31
- * Hide the tooltip when the mousedown event is triggered. This should be
32
- * used when tooltip should be hidden if `onMouseDown` react synthetic event
33
- * is triggered, which happens before `onClick` event
34
- */
35
- hideTooltipOnMouseDown?: boolean;
36
- /**
37
- * Where the tooltip should appear relative to the mouse pointer.
38
- * Only used when the `position` prop is set to `"mouse"`.
39
- * When interacting with the target element using the keyboard will use this position against the target element instead.
40
- */
41
- mousePosition?: PositionTypeBase;
42
- /**
43
- * Function to be called when the tooltip will be shown. It is called when the
44
- * tooltip begins to animate in.
45
- */
46
- onShow?: () => void;
47
- /**
48
- * Function to be called when the tooltip will be hidden. It is called after the
49
- * delay, when the tooltip begins to animate out.
50
- */
51
- onHide?: () => void;
52
- /**
53
- * Where the tooltip should appear relative to its target.
54
- * If set to `"mouse"` the tooltip will display next to the mouse pointer instead.
55
- * Make sure to utilize the `mousePosition` if you want to customize where the tooltip will show in relation to the mouse.
56
- */
57
- position?: PositionType;
58
- /**
59
- * Replace the wrapping element. This accepts the name of a html tag which will
60
- * be used to wrap the element.
61
- * If you provide a component it needs to support a ref prop which is used by popper for positioning
62
- * Note: actual type is not ElementType, it is either a JSX.IntrinsticElement (eg "div")
63
- * or a component that supports React.AllHTMLAttributes<HTMLElement> has a ref prop (React.Ref<HTMLElement>).
64
- * Using ElementType here for documentation because it is close and works with our prop extraction tool
65
- */
66
- tag?: ElementType;
67
- /**
68
- * Show only one line of text, and truncate when too long
69
- */
70
- truncate?: boolean;
71
- /**
72
- * Elements to be wrapped by the tooltip
73
- */
74
- children: ReactNode;
75
- /**
76
- * A `testId` prop is provided for specified elements, which is a unique
77
- * string that appears as a data attribute `data-testid` in the rendered code,
78
- * serving as a hook for automated tests */
79
- testId?: string;
80
- /** Analytics context metadata */
81
- analyticsContext?: Record<string, any>;
82
- };
83
- export default function PropsHack(props: Props): null;
84
- export {};