@khanacademy/wonder-blocks-tooltip 1.4.5 → 1.4.6
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 +14 -0
- package/dist/index.js.flow +1 -1
- package/package.json +7 -7
- package/src/components/__docs__/tooltip-content.stories.js +1 -1
- package/src/components/__docs__/tooltip.stories.js +2 -2
- package/src/components/__tests__/tooltip-anchor.test.js +12 -12
- package/src/components/__tests__/tooltip-bubble.test.js +2 -2
- package/src/components/__tests__/tooltip-popper.test.js +2 -2
- package/src/components/__tests__/tooltip-tail.test.js +2 -2
- package/src/components/__tests__/tooltip.integration.test.js +1 -1
- package/src/components/__tests__/tooltip.test.js +1 -1
- package/src/components/tooltip-anchor.js +3 -3
- package/src/components/tooltip-bubble.js +3 -3
- package/src/components/tooltip-popper.js +3 -3
- package/src/components/tooltip-tail.js +1 -1
- package/src/components/tooltip.js +5 -5
- package/src/index.js +6 -6
- package/src/util/__tests__/active-tracker.test.js +2 -2
- package/src/util/__tests__/ref-tracker.test.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-tooltip
|
|
2
2
|
|
|
3
|
+
## 1.4.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 91cb727c: Remove file extensions from imports
|
|
8
|
+
- Updated dependencies [91cb727c]
|
|
9
|
+
- Updated dependencies [91cb727c]
|
|
10
|
+
- Updated dependencies [91cb727c]
|
|
11
|
+
- @khanacademy/wonder-blocks-color@1.2.1
|
|
12
|
+
- @khanacademy/wonder-blocks-core@4.7.0
|
|
13
|
+
- @khanacademy/wonder-blocks-layout@1.4.16
|
|
14
|
+
- @khanacademy/wonder-blocks-modal@3.0.7
|
|
15
|
+
- @khanacademy/wonder-blocks-typography@1.1.38
|
|
16
|
+
|
|
3
17
|
## 1.4.5
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js.flow
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
export * from "../src/index
|
|
2
|
+
export * from "../src/index";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-tooltip",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-color": "^1.2.
|
|
20
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
21
|
-
"@khanacademy/wonder-blocks-layout": "^1.4.
|
|
22
|
-
"@khanacademy/wonder-blocks-modal": "^3.0.
|
|
19
|
+
"@khanacademy/wonder-blocks-color": "^1.2.1",
|
|
20
|
+
"@khanacademy/wonder-blocks-core": "^4.7.0",
|
|
21
|
+
"@khanacademy/wonder-blocks-layout": "^1.4.16",
|
|
22
|
+
"@khanacademy/wonder-blocks-modal": "^3.0.7",
|
|
23
23
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
24
|
-
"@khanacademy/wonder-blocks-typography": "^1.1.
|
|
24
|
+
"@khanacademy/wonder-blocks-typography": "^1.1.38"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@popperjs/core": "^2.10.1",
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"react-popper": "^2.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"wb-dev-build-settings": "^0.7.
|
|
34
|
+
"wb-dev-build-settings": "^0.7.1"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -5,7 +5,7 @@ import {Body, LabelSmall} from "@khanacademy/wonder-blocks-typography";
|
|
|
5
5
|
|
|
6
6
|
import type {StoryComponentType} from "@storybook/react";
|
|
7
7
|
|
|
8
|
-
import ComponentInfo from "../../../../../.storybook/components/component-info
|
|
8
|
+
import ComponentInfo from "../../../../../.storybook/components/component-info";
|
|
9
9
|
import {name, version} from "../../../package.json";
|
|
10
10
|
|
|
11
11
|
export default {
|
|
@@ -17,9 +17,9 @@ import Tooltip from "@khanacademy/wonder-blocks-tooltip";
|
|
|
17
17
|
import {Body} from "@khanacademy/wonder-blocks-typography";
|
|
18
18
|
|
|
19
19
|
import type {StoryComponentType} from "@storybook/react";
|
|
20
|
-
import TooltipArgtypes from "./tooltip.argtypes
|
|
20
|
+
import TooltipArgtypes from "./tooltip.argtypes";
|
|
21
21
|
|
|
22
|
-
import ComponentInfo from "../../../../../.storybook/components/component-info
|
|
22
|
+
import ComponentInfo from "../../../../../.storybook/components/component-info";
|
|
23
23
|
import {name, version} from "../../../package.json";
|
|
24
24
|
|
|
25
25
|
export default {
|
|
@@ -4,13 +4,13 @@ import {View} from "@khanacademy/wonder-blocks-core";
|
|
|
4
4
|
import {render, screen} from "@testing-library/react";
|
|
5
5
|
import userEvent from "@testing-library/user-event";
|
|
6
6
|
|
|
7
|
-
import TooltipAnchor from "../tooltip-anchor
|
|
7
|
+
import TooltipAnchor from "../tooltip-anchor";
|
|
8
8
|
import {
|
|
9
9
|
TooltipAppearanceDelay,
|
|
10
10
|
TooltipDisappearanceDelay,
|
|
11
|
-
} from "../../util/constants
|
|
11
|
+
} from "../../util/constants";
|
|
12
12
|
|
|
13
|
-
jest.mock("../../util/active-tracker
|
|
13
|
+
jest.mock("../../util/active-tracker");
|
|
14
14
|
|
|
15
15
|
describe("TooltipAnchor", () => {
|
|
16
16
|
beforeEach(async () => {
|
|
@@ -28,7 +28,7 @@ describe("TooltipAnchor", () => {
|
|
|
28
28
|
jest.useFakeTimers();
|
|
29
29
|
|
|
30
30
|
const {default: ActiveTracker} = await import(
|
|
31
|
-
"../../util/active-tracker
|
|
31
|
+
"../../util/active-tracker"
|
|
32
32
|
);
|
|
33
33
|
// We know there's one global instance of this import, so let's
|
|
34
34
|
// reset it.
|
|
@@ -245,7 +245,7 @@ describe("TooltipAnchor", () => {
|
|
|
245
245
|
test("active state was not stolen, delays set active", async () => {
|
|
246
246
|
// Arrange
|
|
247
247
|
const {default: ActiveTracker} = await import(
|
|
248
|
-
"../../util/active-tracker
|
|
248
|
+
"../../util/active-tracker"
|
|
249
249
|
);
|
|
250
250
|
const timeoutSpy = jest.spyOn(global, "setTimeout");
|
|
251
251
|
// Let's tell the tooltip it isn't stealing and therefore it should
|
|
@@ -286,7 +286,7 @@ describe("TooltipAnchor", () => {
|
|
|
286
286
|
test("active state was stolen, set active immediately", async () => {
|
|
287
287
|
// Arrange
|
|
288
288
|
const {default: ActiveTracker} = await import(
|
|
289
|
-
"../../util/active-tracker
|
|
289
|
+
"../../util/active-tracker"
|
|
290
290
|
);
|
|
291
291
|
// Let's tell the tooltip it is stealing and therefore it should
|
|
292
292
|
// not be using a delay to show the tooltip.
|
|
@@ -360,7 +360,7 @@ describe("TooltipAnchor", () => {
|
|
|
360
360
|
// Arrange
|
|
361
361
|
const timeoutSpy = jest.spyOn(global, "setTimeout");
|
|
362
362
|
const {default: ActiveTracker} = await import(
|
|
363
|
-
"../../util/active-tracker
|
|
363
|
+
"../../util/active-tracker"
|
|
364
364
|
);
|
|
365
365
|
// Flow doesn't know this is a mock
|
|
366
366
|
// $FlowFixMe[prop-missing]
|
|
@@ -438,7 +438,7 @@ describe("TooltipAnchor", () => {
|
|
|
438
438
|
// Arrange
|
|
439
439
|
const timeoutSpy = jest.spyOn(global, "setTimeout");
|
|
440
440
|
const {default: ActiveTracker} = await import(
|
|
441
|
-
"../../util/active-tracker
|
|
441
|
+
"../../util/active-tracker"
|
|
442
442
|
);
|
|
443
443
|
// Flow doesn't know this is a mock
|
|
444
444
|
// $FlowFixMe[prop-missing]
|
|
@@ -513,7 +513,7 @@ describe("TooltipAnchor", () => {
|
|
|
513
513
|
// Arrange
|
|
514
514
|
const timeoutSpy = jest.spyOn(global, "setTimeout");
|
|
515
515
|
const {default: ActiveTracker} = await import(
|
|
516
|
-
"../../util/active-tracker
|
|
516
|
+
"../../util/active-tracker"
|
|
517
517
|
);
|
|
518
518
|
// Let's tell the tooltip it isn't stealing and therefore it should
|
|
519
519
|
// be using a delay to show the tooltip.
|
|
@@ -552,7 +552,7 @@ describe("TooltipAnchor", () => {
|
|
|
552
552
|
test("active state was stolen, set active immediately", async () => {
|
|
553
553
|
// Arrange
|
|
554
554
|
const {default: ActiveTracker} = await import(
|
|
555
|
-
"../../util/active-tracker
|
|
555
|
+
"../../util/active-tracker"
|
|
556
556
|
);
|
|
557
557
|
// Let's tell the tooltip it is stealing and therefore it should
|
|
558
558
|
// not be using a delay to show the tooltip.
|
|
@@ -624,7 +624,7 @@ describe("TooltipAnchor", () => {
|
|
|
624
624
|
// Arrange
|
|
625
625
|
const timeoutSpy = jest.spyOn(global, "setTimeout");
|
|
626
626
|
const {default: ActiveTracker} = await import(
|
|
627
|
-
"../../util/active-tracker
|
|
627
|
+
"../../util/active-tracker"
|
|
628
628
|
);
|
|
629
629
|
// Flow doesn't know this is a mock
|
|
630
630
|
// $FlowFixMe[prop-missing]
|
|
@@ -699,7 +699,7 @@ describe("TooltipAnchor", () => {
|
|
|
699
699
|
// Arrange
|
|
700
700
|
const timeoutSpy = jest.spyOn(global, "setTimeout");
|
|
701
701
|
const {default: ActiveTracker} = await import(
|
|
702
|
-
"../../util/active-tracker
|
|
702
|
+
"../../util/active-tracker"
|
|
703
703
|
);
|
|
704
704
|
// Flow doesn't know this is a mock
|
|
705
705
|
// $FlowFixMe[prop-missing]
|
|
@@ -4,8 +4,8 @@ import {render, screen} from "@testing-library/react";
|
|
|
4
4
|
|
|
5
5
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
6
6
|
|
|
7
|
-
import TooltipBubble from "../tooltip-bubble
|
|
8
|
-
import typeof TooltipContent from "../tooltip-content
|
|
7
|
+
import TooltipBubble from "../tooltip-bubble";
|
|
8
|
+
import typeof TooltipContent from "../tooltip-content";
|
|
9
9
|
|
|
10
10
|
describe("TooltipBubble", () => {
|
|
11
11
|
// A little helper method to make the actual test more readable.
|
|
@@ -5,8 +5,8 @@ import {render} from "@testing-library/react";
|
|
|
5
5
|
|
|
6
6
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
7
7
|
|
|
8
|
-
import typeof TooltipBubble from "../tooltip-bubble
|
|
9
|
-
import TooltipPopper from "../tooltip-popper
|
|
8
|
+
import typeof TooltipBubble from "../tooltip-bubble";
|
|
9
|
+
import TooltipPopper from "../tooltip-popper";
|
|
10
10
|
|
|
11
11
|
type State = {|ref: ?HTMLElement|};
|
|
12
12
|
/**
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import {render} from "@testing-library/react";
|
|
4
4
|
|
|
5
|
-
import TooltipTail from "../tooltip-tail
|
|
5
|
+
import TooltipTail from "../tooltip-tail";
|
|
6
6
|
|
|
7
|
-
import type {Placement} from "../../util/types
|
|
7
|
+
import type {Placement} from "../../util/types";
|
|
8
8
|
|
|
9
9
|
describe("TooltipTail", () => {
|
|
10
10
|
describe("#render", () => {
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import {render, screen, fireEvent} from "@testing-library/react";
|
|
5
5
|
import userEvent from "@testing-library/user-event";
|
|
6
6
|
|
|
7
|
-
import Tooltip from "../tooltip
|
|
7
|
+
import Tooltip from "../tooltip";
|
|
8
8
|
|
|
9
9
|
describe("tooltip integration tests", () => {
|
|
10
10
|
beforeEach(() => {
|
|
@@ -6,7 +6,7 @@ import userEvent from "@testing-library/user-event";
|
|
|
6
6
|
|
|
7
7
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
8
8
|
|
|
9
|
-
import Tooltip from "../tooltip
|
|
9
|
+
import Tooltip from "../tooltip";
|
|
10
10
|
|
|
11
11
|
const mockIDENTIFIER = "mock-identifier";
|
|
12
12
|
jest.mock("@khanacademy/wonder-blocks-core", () => {
|
|
@@ -9,13 +9,13 @@ import * as ReactDOM from "react-dom";
|
|
|
9
9
|
import {Text as WBText} from "@khanacademy/wonder-blocks-core";
|
|
10
10
|
import type {IIdentifierFactory} from "@khanacademy/wonder-blocks-core";
|
|
11
11
|
|
|
12
|
-
import ActiveTracker from "../util/active-tracker
|
|
12
|
+
import ActiveTracker from "../util/active-tracker";
|
|
13
13
|
import {
|
|
14
14
|
TooltipAppearanceDelay,
|
|
15
15
|
TooltipDisappearanceDelay,
|
|
16
|
-
} from "../util/constants
|
|
16
|
+
} from "../util/constants";
|
|
17
17
|
|
|
18
|
-
import type {IActiveTrackerSubscriber} from "../util/active-tracker
|
|
18
|
+
import type {IActiveTrackerSubscriber} from "../util/active-tracker";
|
|
19
19
|
|
|
20
20
|
type Props = {|
|
|
21
21
|
/**
|
|
@@ -6,10 +6,10 @@ import {View} from "@khanacademy/wonder-blocks-core";
|
|
|
6
6
|
import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
7
7
|
|
|
8
8
|
import type {StyleType} from "@khanacademy/wonder-blocks-core";
|
|
9
|
-
import typeof TooltipContent from "./tooltip-content
|
|
10
|
-
import TooltipTail from "./tooltip-tail
|
|
9
|
+
import typeof TooltipContent from "./tooltip-content";
|
|
10
|
+
import TooltipTail from "./tooltip-tail";
|
|
11
11
|
|
|
12
|
-
import type {getRefFn, Offset, Placement} from "../util/types
|
|
12
|
+
import type {getRefFn, Offset, Placement} from "../util/types";
|
|
13
13
|
|
|
14
14
|
export type PopperElementProps = {|
|
|
15
15
|
/** The placement of the bubble with respect to the anchor. */
|
|
@@ -7,9 +7,9 @@ import * as React from "react";
|
|
|
7
7
|
import {Popper} from "react-popper";
|
|
8
8
|
import type {PopperChildrenProps} from "react-popper";
|
|
9
9
|
|
|
10
|
-
import RefTracker from "../util/ref-tracker
|
|
11
|
-
import type {Placement} from "../util/types
|
|
12
|
-
import type {PopperElementProps} from "./tooltip-bubble
|
|
10
|
+
import RefTracker from "../util/ref-tracker";
|
|
11
|
+
import type {Placement} from "../util/types";
|
|
12
|
+
import type {PopperElementProps} from "./tooltip-bubble";
|
|
13
13
|
|
|
14
14
|
type Props = {|
|
|
15
15
|
/**
|
|
@@ -7,7 +7,7 @@ import {View} from "@khanacademy/wonder-blocks-core";
|
|
|
7
7
|
import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
8
8
|
|
|
9
9
|
import type {StyleType} from "@khanacademy/wonder-blocks-core";
|
|
10
|
-
import type {getRefFn, Placement, Offset} from "../util/types
|
|
10
|
+
import type {getRefFn, Placement, Offset} from "../util/types";
|
|
11
11
|
|
|
12
12
|
export type Props = {|
|
|
13
13
|
/**
|
|
@@ -29,11 +29,11 @@ import {maybeGetPortalMountedModalHostElement} from "@khanacademy/wonder-blocks-
|
|
|
29
29
|
import type {Typography} from "@khanacademy/wonder-blocks-typography";
|
|
30
30
|
import type {AriaProps} from "@khanacademy/wonder-blocks-core";
|
|
31
31
|
|
|
32
|
-
import TooltipAnchor from "./tooltip-anchor
|
|
33
|
-
import TooltipBubble from "./tooltip-bubble
|
|
34
|
-
import TooltipContent from "./tooltip-content
|
|
35
|
-
import TooltipPopper from "./tooltip-popper
|
|
36
|
-
import type {Placement} from "../util/types
|
|
32
|
+
import TooltipAnchor from "./tooltip-anchor";
|
|
33
|
+
import TooltipBubble from "./tooltip-bubble";
|
|
34
|
+
import TooltipContent from "./tooltip-content";
|
|
35
|
+
import TooltipPopper from "./tooltip-popper";
|
|
36
|
+
import type {Placement} from "../util/types";
|
|
37
37
|
|
|
38
38
|
type Props = {|
|
|
39
39
|
...AriaProps,
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import type {Placement} from "./util/types
|
|
3
|
-
import type {PopperElementProps} from "./components/tooltip-bubble
|
|
2
|
+
import type {Placement} from "./util/types";
|
|
3
|
+
import type {PopperElementProps} from "./components/tooltip-bubble";
|
|
4
4
|
|
|
5
|
-
import Tooltip from "./components/tooltip
|
|
6
|
-
import TooltipContent from "./components/tooltip-content
|
|
7
|
-
import TooltipPopper from "./components/tooltip-popper
|
|
8
|
-
import TooltipTail from "./components/tooltip-tail
|
|
5
|
+
import Tooltip from "./components/tooltip";
|
|
6
|
+
import TooltipContent from "./components/tooltip-content";
|
|
7
|
+
import TooltipPopper from "./components/tooltip-popper";
|
|
8
|
+
import TooltipTail from "./components/tooltip-tail";
|
|
9
9
|
|
|
10
10
|
export {Tooltip as default, TooltipContent, TooltipPopper, TooltipTail};
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import ActiveTracker from "../active-tracker
|
|
3
|
-
import type {IActiveTrackerSubscriber} from "../active-tracker
|
|
2
|
+
import ActiveTracker from "../active-tracker";
|
|
3
|
+
import type {IActiveTrackerSubscriber} from "../active-tracker";
|
|
4
4
|
|
|
5
5
|
class MockSubscriber implements IActiveTrackerSubscriber {
|
|
6
6
|
activeStateStolen = jest.fn();
|
|
@@ -4,7 +4,7 @@ import * as ReactDOM from "react-dom";
|
|
|
4
4
|
import {render} from "@testing-library/react";
|
|
5
5
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
6
6
|
|
|
7
|
-
import RefTracker from "../ref-tracker
|
|
7
|
+
import RefTracker from "../ref-tracker";
|
|
8
8
|
|
|
9
9
|
type CallbackFn = (?HTMLElement) => void;
|
|
10
10
|
|