@react-text-game/ui 0.3.2 → 0.3.5
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/dist/components/InteractiveMapComponent/Hotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/Hotspot.js +1 -2
- package/dist/components/InteractiveMapComponent/Hotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenu.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenu.js +2 -7
- package/dist/components/InteractiveMapComponent/HotspotMenu.js.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.d.ts +6 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.js +13 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.js.map +1 -0
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts +4 -1
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/ImageHotspot.js +29 -17
- package/dist/components/InteractiveMapComponent/ImageHotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts +4 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.js +6 -4
- package/dist/components/InteractiveMapComponent/LabelHotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/SideHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/SideHotspot.js +1 -2
- package/dist/components/InteractiveMapComponent/SideHotspot.js.map +1 -1
- package/dist/components/StoryComponent/components/Actions.d.ts.map +1 -1
- package/dist/components/StoryComponent/components/Actions.js +8 -2
- package/dist/components/StoryComponent/components/Actions.js.map +1 -1
- package/dist/components/common/Tooltip.d.ts +3 -3
- package/dist/components/common/Tooltip.d.ts.map +1 -1
- package/dist/components/common/Tooltip.js +124 -23
- package/dist/components/common/Tooltip.js.map +1 -1
- package/dist/styles/index.css +7 -45
- package/dist/tests/common/Tooltip.test.d.ts +2 -0
- package/dist/tests/common/Tooltip.test.d.ts.map +1 -0
- package/dist/tests/common/Tooltip.test.js +400 -0
- package/dist/tests/common/Tooltip.test.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,eAAe,EACf,eAAe,EAClB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"Hotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,eAAe,EACf,eAAe,EAClB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,YAAY,GAAG;IAChB,OAAO,EAAE,eAAe,GAAG,eAAe,CAAC;IAC3C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,gCAAgC,YAAY,4CAgDnE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
|
-
import { Tooltip } from "../../components/common/Tooltip";
|
|
5
4
|
import { callIfFunction } from "./helpers";
|
|
6
5
|
import { ImageHotspot } from "./ImageHotspot";
|
|
7
6
|
import { LabelHotspot } from "./LabelHotspot";
|
|
@@ -25,6 +24,6 @@ export const Hotspot = ({ hotspot, imagePositionInfo }) => {
|
|
|
25
24
|
hotspotRef.current.style.transform = "translate(-50%, -50%)";
|
|
26
25
|
}
|
|
27
26
|
}, [hotspot.position, imagePositionInfo]);
|
|
28
|
-
return (_jsx("div", { ref: hotspotRef, className: "absolute z-10", children:
|
|
27
|
+
return (_jsx("div", { ref: hotspotRef, className: "absolute z-10", children: hotspot.type === "image" ? (_jsx(ImageHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position, ...(imagePositionInfo && { imagePositionInfo }) })) : hotspot.type === "label" ? (_jsx(LabelHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position })) : (_jsx("div", { children: "Unknown Hotspot Type" })) }));
|
|
29
28
|
};
|
|
30
29
|
//# sourceMappingURL=Hotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAMb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Hotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAMb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAgB,EAAE,EAAE;IACpE,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAEhE,+EAA+E;IAC/E,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,UAAU,CAAC,OAAO,IAAI,iBA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AC,CAAC,CAAC,CAC3B,KAAC,YAAY,IACT,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,GAC7C,CACL,CAAC,CAAC,CAAC,CACA,iDAA+B,CAClC,GACC,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotspotMenu.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"HotspotMenu.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,KAAK,GAAG,QAAQ,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACzC,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,6BAA6B,KAAK,mDAiD7D,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { twMerge } from "tailwind-merge";
|
|
5
|
-
import { Button, Tooltip } from "../../components/common";
|
|
6
5
|
import { callIfFunction } from "./helpers";
|
|
6
|
+
import { HotspotMenuItem } from "./HotspotMenuItem";
|
|
7
7
|
export const HotspotMenu = ({ menu, imagePositionInfo }) => {
|
|
8
8
|
const menuRef = useRef(null);
|
|
9
9
|
const items = useMemo(() => menu.items
|
|
@@ -27,11 +27,6 @@ export const HotspotMenu = ({ menu, imagePositionInfo }) => {
|
|
|
27
27
|
if (items.length === 0) {
|
|
28
28
|
return null; // Don't render the menu if there are no items
|
|
29
29
|
}
|
|
30
|
-
return (_jsx("div", { ref: menuRef, className: twMerge("absolute z-10 flex gap-2 p-2 bg-popover/95 border border-border rounded-lg shadow-md", menu.direction === "horizontal" ? "flex-row" : "flex-col"), children: items.map((item, index) => {
|
|
31
|
-
const tooltipContent = callIfFunction(item.tooltip?.content);
|
|
32
|
-
const isDisabled = callIfFunction(item.isDisabled) || false;
|
|
33
|
-
const content = callIfFunction(item.content);
|
|
34
|
-
return (_jsx(Tooltip, { content: tooltipContent, placement: item.tooltip?.position || "top", disabled: !tooltipContent, children: _jsx("div", { children: _jsx(Button, { className: item?.props?.classNames?.button, variant: item?.props?.variant, color: item?.props?.color, disabled: isDisabled, onClick: item.action, children: content }) }) }, index));
|
|
35
|
-
}) }));
|
|
30
|
+
return (_jsx("div", { ref: menuRef, className: twMerge("absolute z-10 flex gap-2 p-2 bg-popover/95 border ", "border-border rounded-lg shadow-md", menu.direction === "horizontal" ? "flex-row" : "flex-col"), children: items.map((item, index) => (_jsx(HotspotMenuItem, { item: item }, index))) }));
|
|
36
31
|
};
|
|
37
32
|
//# sourceMappingURL=HotspotMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotspotMenu.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"HotspotMenu.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,E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AAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC;YACzC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC;YACxC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,uBAAuB,CAAC;QAC9D,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAErD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC,CAAC,8CAA8C;IAC/D,CAAC;IAED,OAAO,CACH,cACI,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,OAAO,CACd,oDAAoD,EACpD,oCAAoC,EACpC,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAC5D,YAEA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,IAAO,KAAK,CAAI,CAC9C,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LabelHotspot } from "@react-text-game/core";
|
|
2
|
+
export type HotspotMenuItemProps = {
|
|
3
|
+
item: LabelHotspot;
|
|
4
|
+
};
|
|
5
|
+
export declare const HotspotMenuItem: ({ item }: HotspotMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=HotspotMenuItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotspotMenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenuItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMrD,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,oBAAoB,4CA2B7D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { Button, Tooltip } from "../../components";
|
|
5
|
+
import { callIfFunction } from "../../components/InteractiveMapComponent/helpers";
|
|
6
|
+
export const HotspotMenuItem = ({ item }) => {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const tooltipContent = callIfFunction(item.tooltip?.content);
|
|
9
|
+
const isDisabled = callIfFunction(item.isDisabled) || false;
|
|
10
|
+
const content = callIfFunction(item.content);
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref, children: _jsx(Button, { className: item.props?.classNames?.button, variant: item.props?.variant, color: item.props?.color, disabled: isDisabled, onClick: item.action, children: content }) }), _jsx(Tooltip, { targetRef: ref, content: tooltipContent, placement: item.tooltip?.position || "top", disabled: !tooltipContent })] }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=HotspotMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotspotMenuItem.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenuItem.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAM7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,IAAI,EAAwB,EAAE,EAAE;IAC9D,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;IAC5D,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE7C,OAAO,CACH,8BACI,cAAK,GAAG,EAAE,GAAG,YACT,KAAC,MAAM,IACH,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EACzC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAC5B,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EACxB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,IAAI,CAAC,MAAM,YAEnB,OAAO,GACH,GACP,EACN,KAAC,OAAO,IACJ,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,EAC1C,QAAQ,EAAE,CAAC,cAAc,GAC3B,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ImageHotspot as ImageHotspotType, MapImageHotspot } from "@react-text-game/core/passages";
|
|
2
|
+
import { Placement } from "../../components";
|
|
2
3
|
import { ImagePositionInfo } from "./types";
|
|
3
4
|
type ImageHotspotProps = {
|
|
4
5
|
hotspot: MapImageHotspot | ImageHotspotType;
|
|
5
6
|
imagePositionInfo?: ImagePositionInfo;
|
|
7
|
+
tooltipContent?: string | undefined;
|
|
8
|
+
tooltipPlacement?: Placement | undefined;
|
|
6
9
|
};
|
|
7
|
-
export declare const ImageHotspot: ({ hotspot, imagePositionInfo, }: ImageHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ImageHotspot: ({ hotspot, imagePositionInfo, tooltipContent, tooltipPlacement, }: ImageHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
9
12
|
//# sourceMappingURL=ImageHotspot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"AAGA,OAAO,EACH,YAAY,IAAI,gBAAgB,EAEhC,eAAe,EAClB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAE,SAAS,EAAW,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,iBAAiB,GAAG;IACrB,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAAC;IAC5C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,mEAK1B,iBAAiB,4CAwFnB,CAAC"}
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState } from "react";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useRef, useState } from "react";
|
|
4
4
|
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { Tooltip } from "../../components";
|
|
5
6
|
import { callIfFunction } from "./helpers";
|
|
6
|
-
export const ImageHotspot = ({ hotspot, imagePositionInfo, }) => {
|
|
7
|
+
export const ImageHotspot = ({ hotspot, imagePositionInfo, tooltipContent, tooltipPlacement = "top", }) => {
|
|
8
|
+
const ref = useRef(null);
|
|
7
9
|
const [isHovering, setIsHovering] = useState(false);
|
|
8
10
|
const [isActive, setIsActive] = useState(false);
|
|
9
11
|
const classNames = hotspot.props?.classNames || {};
|
|
10
12
|
const isDisabled = callIfFunction(hotspot.isDisabled);
|
|
11
|
-
const content = useMemo(() =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const content = useMemo(() => {
|
|
14
|
+
const isObject = typeof hotspot.content === "object";
|
|
15
|
+
if (!isObject) {
|
|
16
|
+
const stringContent = hotspot.content;
|
|
17
|
+
return {
|
|
18
|
+
idle: callIfFunction(stringContent), hover: undefined, active: undefined, disabled: undefined
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const content = hotspot.content;
|
|
22
|
+
return {
|
|
23
|
+
idle: callIfFunction(content.idle),
|
|
24
|
+
hover: callIfFunction(content.hover),
|
|
25
|
+
active: callIfFunction(content.active),
|
|
26
|
+
disabled: callIfFunction(content.disabled),
|
|
27
|
+
};
|
|
28
|
+
}, [hotspot.content]);
|
|
17
29
|
// Calculate the combined scale factor from both the map scaling and custom zoom
|
|
18
30
|
const combinedScale = useMemo(() => {
|
|
19
31
|
const scaleFactor = imagePositionInfo?.scaleFactor ?? 1;
|
|
@@ -21,13 +33,13 @@ export const ImageHotspot = ({ hotspot, imagePositionInfo, }) => {
|
|
|
21
33
|
const zoomValue = parseFloat(customZoom) / 100;
|
|
22
34
|
return scaleFactor * zoomValue;
|
|
23
35
|
}, [imagePositionInfo?.scaleFactor, hotspot.props?.zoom]);
|
|
24
|
-
return (_jsx("button", { className: twMerge("cursor-pointer disabled:cursor-not-allowed relative", classNames.container), style: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { ref: ref, className: twMerge("cursor-pointer disabled:cursor-not-allowed relative", classNames.container), style: {
|
|
37
|
+
transform: `scale(${combinedScale})`,
|
|
38
|
+
transformOrigin: "center center",
|
|
39
|
+
}, disabled: isDisabled, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false), onClick: () => {
|
|
40
|
+
setIsActive(true);
|
|
41
|
+
hotspot.action();
|
|
42
|
+
setTimeout(() => setIsActive(false), 100);
|
|
43
|
+
}, children: isActive && content.active ? (_jsx("img", { className: twMerge("max-w-none", classNames.active), src: content.active, alt: "hotspot active" })) : isHovering && content.hover ? (_jsx("img", { className: twMerge("max-w-none", classNames.hover), src: content.hover, alt: "hotspot hover" })) : isDisabled && content.disabled ? (_jsx("img", { className: twMerge("max-w-none", classNames.disabled), src: content.disabled, alt: "hotspot disabled" })) : (_jsx("img", { className: twMerge("max-w-none", classNames.idle), src: content.idle, alt: hotspot.id || "hotspot" })) }), _jsx(Tooltip, { content: tooltipContent, placement: tooltipPlacement, targetRef: ref, disabled: !tooltipContent })] }));
|
|
32
44
|
};
|
|
33
45
|
//# sourceMappingURL=ImageHotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"ImageHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAQb,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAa,OAAO,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAU3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EACzB,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,g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C,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CACjC,cACI,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,QAAQ,CAAC,EACrD,GAAG,EAAE,OAAO,CAAC,QAAQ,EACrB,GAAG,EAAC,kBAAkB,GACxB,CACL,CAAC,CAAC,CAAC,CACA,cACI,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,EACjD,GAAG,EAAE,OAAO,CAAC,IAAI,EACjB,GAAG,EAAE,OAAO,CAAC,EAAE,IAAI,SAAS,GAC9B,CACL,GACI,EACT,KAAC,OAAO,IACJ,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,CAAC,cAAc,GAC3B,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { LabelHotspot as LabelHotspotType, MapLabelHotspot } from "@react-text-game/core/passages";
|
|
2
|
+
import { Placement } from "../../components/common";
|
|
2
3
|
type LabelHotspotProps = {
|
|
3
4
|
hotspot: MapLabelHotspot | LabelHotspotType;
|
|
5
|
+
tooltipContent?: string | undefined;
|
|
6
|
+
tooltipPlacement?: Placement | undefined;
|
|
4
7
|
};
|
|
5
|
-
export declare const LabelHotspot: ({ hotspot }: LabelHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const LabelHotspot: ({ hotspot, tooltipContent, tooltipPlacement, }: LabelHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export {};
|
|
7
10
|
//# sourceMappingURL=LabelHotspot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,IAAI,gBAAgB,EAChC,eAAe,EAClB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"LabelHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,IAAI,gBAAgB,EAChC,eAAe,EAClB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAU,SAAS,EAAW,MAAM,oBAAoB,CAAC;AAIhE,KAAK,iBAAiB,GAAG;IACrB,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,gDAI1B,iBAAiB,4CA0BnB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { Button, Tooltip } from "../../components/common";
|
|
4
5
|
import { callIfFunction } from "./helpers";
|
|
5
|
-
export const LabelHotspot = ({ hotspot }) => {
|
|
6
|
+
export const LabelHotspot = ({ hotspot, tooltipContent, tooltipPlacement = "top", }) => {
|
|
7
|
+
const ref = useRef(null);
|
|
6
8
|
const content = callIfFunction(hotspot.content);
|
|
7
9
|
const isDisabled = callIfFunction(hotspot.isDisabled);
|
|
8
|
-
return (_jsx("div", { children: _jsx(Button, { onClick: () => hotspot.action(), disabled: isDisabled, className: hotspot.props?.classNames?.button, variant: hotspot.props?.variant, color: hotspot.props?.color, children: content }) }));
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref, children: _jsx(Button, { onClick: () => hotspot.action(), disabled: isDisabled, className: hotspot.props?.classNames?.button, variant: hotspot.props?.variant, color: hotspot.props?.color, children: content }) }), _jsx(Tooltip, { content: tooltipContent, placement: tooltipPlacement, targetRef: ref, disabled: !tooltipContent })] }));
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=LabelHotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"LabelHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAMb,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAa,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAQ3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EACzB,OAAO,EACP,cAAc,EACd,gBAAgB,GAAG,KAAK,GACR,EAAE,EAAE;IACpB,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAEtD,OAAO,CACH,8BACI,cAAK,GAAG,EAAE,GAAG,YACT,KAAC,MAAM,IACH,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAC/B,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAC5C,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,EAC/B,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,YAE1B,OAAO,GACH,GACP,EACN,KAAC,OAAO,IACJ,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,CAAC,cAAc,GAC3B,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"SideHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,gCAAgC,CAAC;AAMxC,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,aAAa,KAAK,4CAsB7C,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Tooltip } from "../../components/common";
|
|
4
3
|
import { callIfFunction } from "./helpers";
|
|
5
4
|
import { ImageHotspot } from "./ImageHotspot";
|
|
6
5
|
import { LabelHotspot } from "./LabelHotspot";
|
|
7
6
|
export const SideHotspot = ({ hotspot }) => {
|
|
8
7
|
const tooltipContent = callIfFunction(hotspot.tooltip?.content);
|
|
9
|
-
return (_jsx(
|
|
8
|
+
return (_jsx("div", { children: hotspot.type === "image" ? (_jsx(ImageHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position })) : hotspot.type === "label" ? (_jsx(LabelHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position })) : (_jsx("div", { children: "Unknown Hotspot Type" })) }));
|
|
10
9
|
};
|
|
11
10
|
//# sourceMappingURL=SideHotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SideHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE;IAC9C,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAEhE,OAAO,CACH,wBACK,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CACxB,KAAC,YAAY,IACT,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,GAC7C,CACL,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAC3B,KAAC,YAAY,IACT,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,GAC7C,CACL,CAAC,CAAC,CAAC,CACA,iDAA+B,CAClC,GACC,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAc,MAAM,gCAAgC,CAAC;AAO9E,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAChC,SAAS,EAAE,gBAAgB,CAAC;CAC/B,CAAC,CAAC;AA6BH,eAAO,MAAM,OAAO,GAAI,eAAe,YAAY,4CAYlD,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
2
4
|
import { twMerge } from "tailwind-merge";
|
|
3
5
|
import { Button } from "../../../components/common/Button";
|
|
4
6
|
import { Tooltip } from "../../../components/common/Tooltip";
|
|
5
|
-
|
|
7
|
+
const Action = ({ action }) => {
|
|
8
|
+
const ref = useRef(null);
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref, children: _jsx(Button, { color: action.color, variant: action.variant, className: action.className, disabled: action.isDisabled, onClick: action.action, children: action.label }) }), _jsx(Tooltip, { targetRef: ref, content: action.tooltip?.content, placement: action.tooltip?.position, disabled: !action.tooltip?.content, className: action.tooltip?.className })] }));
|
|
10
|
+
};
|
|
11
|
+
export const Actions = ({ component }) => (_jsx("div", { className: twMerge("flex flex-wrap gap-2 justify-center items-center", component.props?.direction === "vertical" ? "flex-col" : "flex-row", component.props?.className), children: component.content.map((action, index) => (_jsx(Action, { action: action }, index))) }));
|
|
6
12
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[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AK,EAAE,EAAE,CAAC,CACtC,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,IAAO,KAAK,CAAI,CACzC,CAAC,GACA,CACT,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactNode, RefObject } from "react";
|
|
2
2
|
export type Placement = "top" | "top-right" | "top-left" | "bottom" | "bottom-right" | "bottom-left" | "right" | "left";
|
|
3
3
|
export type TooltipProps = Readonly<{
|
|
4
|
-
|
|
4
|
+
targetRef: RefObject<HTMLElement | HTMLDivElement | HTMLButtonElement | null>;
|
|
5
5
|
disabled?: boolean | undefined;
|
|
6
6
|
content: ReactNode;
|
|
7
7
|
className?: string | undefined;
|
|
8
8
|
placement?: Placement | undefined;
|
|
9
9
|
}>;
|
|
10
|
-
export declare const Tooltip: ({
|
|
10
|
+
export declare const Tooltip: ({ targetRef, disabled, content, className, placement, }: TooltipProps) => import("react").ReactPortal | null;
|
|
11
11
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,SAAS,GACf,KAAK,GACL,WAAW,GACX,UAAU,GACV,QAAQ,GACR,cAAc,GACd,aAAa,GACb,OAAO,GACP,MAAM,CAAC;AAEb,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAChC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,cAAc,GAAG,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC9E,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACrC,CAAC,CAAC;AAgFH,eAAO,MAAM,OAAO,GAAI,yDAMrB,YAAY,uCAsFd,CAAC"}
|
|
@@ -1,28 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
const ARROW_SIZE = 4;
|
|
6
|
+
const TOOLTIP_OFFSET = 8;
|
|
7
|
+
const getArrowRotation = (placement) => {
|
|
8
|
+
if (placement.startsWith("top"))
|
|
9
|
+
return "rotate-45";
|
|
10
|
+
if (placement.startsWith("bottom"))
|
|
11
|
+
return "rotate-45";
|
|
12
|
+
if (placement === "right")
|
|
13
|
+
return "rotate-45";
|
|
14
|
+
if (placement === "left")
|
|
15
|
+
return "rotate-45";
|
|
16
|
+
return "rotate-45";
|
|
11
17
|
};
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const calculatePosition = (targetRect, tooltipRect, placement) => {
|
|
19
|
+
let top = 0;
|
|
20
|
+
let left = 0;
|
|
21
|
+
let arrowTop = 0;
|
|
22
|
+
let arrowLeft = 0;
|
|
23
|
+
const targetCenterX = targetRect.left + targetRect.width / 2;
|
|
24
|
+
const targetCenterY = targetRect.top + targetRect.height / 2;
|
|
25
|
+
switch (placement) {
|
|
26
|
+
case "top":
|
|
27
|
+
top = targetRect.top - tooltipRect.height - TOOLTIP_OFFSET;
|
|
28
|
+
left = targetCenterX - tooltipRect.width / 2;
|
|
29
|
+
arrowTop = tooltipRect.height - ARROW_SIZE;
|
|
30
|
+
arrowLeft = tooltipRect.width / 2 - ARROW_SIZE;
|
|
31
|
+
break;
|
|
32
|
+
case "top-right":
|
|
33
|
+
top = targetRect.top - tooltipRect.height - TOOLTIP_OFFSET;
|
|
34
|
+
left = targetRect.right - tooltipRect.width;
|
|
35
|
+
arrowTop = tooltipRect.height - ARROW_SIZE;
|
|
36
|
+
arrowLeft = tooltipRect.width - 16;
|
|
37
|
+
break;
|
|
38
|
+
case "top-left":
|
|
39
|
+
top = targetRect.top - tooltipRect.height - TOOLTIP_OFFSET;
|
|
40
|
+
left = targetRect.left;
|
|
41
|
+
arrowTop = tooltipRect.height - ARROW_SIZE;
|
|
42
|
+
arrowLeft = 12;
|
|
43
|
+
break;
|
|
44
|
+
case "bottom":
|
|
45
|
+
top = targetRect.bottom + TOOLTIP_OFFSET;
|
|
46
|
+
left = targetCenterX - tooltipRect.width / 2;
|
|
47
|
+
arrowTop = -ARROW_SIZE;
|
|
48
|
+
arrowLeft = tooltipRect.width / 2 - ARROW_SIZE;
|
|
49
|
+
break;
|
|
50
|
+
case "bottom-right":
|
|
51
|
+
top = targetRect.bottom + TOOLTIP_OFFSET;
|
|
52
|
+
left = targetRect.right - tooltipRect.width;
|
|
53
|
+
arrowTop = -ARROW_SIZE;
|
|
54
|
+
arrowLeft = tooltipRect.width - 16;
|
|
55
|
+
break;
|
|
56
|
+
case "bottom-left":
|
|
57
|
+
top = targetRect.bottom + TOOLTIP_OFFSET;
|
|
58
|
+
left = targetRect.left;
|
|
59
|
+
arrowTop = -ARROW_SIZE;
|
|
60
|
+
arrowLeft = 12;
|
|
61
|
+
break;
|
|
62
|
+
case "right":
|
|
63
|
+
top = targetCenterY - tooltipRect.height / 2;
|
|
64
|
+
left = targetRect.right + TOOLTIP_OFFSET;
|
|
65
|
+
arrowTop = tooltipRect.height / 2 - ARROW_SIZE;
|
|
66
|
+
arrowLeft = -ARROW_SIZE;
|
|
67
|
+
break;
|
|
68
|
+
case "left":
|
|
69
|
+
top = targetCenterY - tooltipRect.height / 2;
|
|
70
|
+
left = targetRect.left - tooltipRect.width - TOOLTIP_OFFSET;
|
|
71
|
+
arrowTop = tooltipRect.height / 2 - ARROW_SIZE;
|
|
72
|
+
arrowLeft = tooltipRect.width - ARROW_SIZE;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return { top, left, arrowTop, arrowLeft };
|
|
21
76
|
};
|
|
22
|
-
export const Tooltip = ({
|
|
23
|
-
|
|
24
|
-
|
|
77
|
+
export const Tooltip = ({ targetRef, disabled = false, content, className = "", placement = "top", }) => {
|
|
78
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
79
|
+
const [position, setPosition] = useState({ top: 0, left: 0 });
|
|
80
|
+
const [arrowPosition, setArrowPosition] = useState({ top: 0, left: 0 });
|
|
81
|
+
const [tooltipElement, setTooltipElement] = useState(null);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const target = targetRef.current;
|
|
84
|
+
if (!target || disabled)
|
|
85
|
+
return;
|
|
86
|
+
const handleMouseEnter = () => {
|
|
87
|
+
setIsVisible(true);
|
|
88
|
+
};
|
|
89
|
+
const handleMouseLeave = () => {
|
|
90
|
+
setIsVisible(false);
|
|
91
|
+
};
|
|
92
|
+
target.addEventListener("mouseenter", handleMouseEnter);
|
|
93
|
+
target.addEventListener("mouseleave", handleMouseLeave);
|
|
94
|
+
return () => {
|
|
95
|
+
target.removeEventListener("mouseenter", handleMouseEnter);
|
|
96
|
+
target.removeEventListener("mouseleave", handleMouseLeave);
|
|
97
|
+
};
|
|
98
|
+
}, [targetRef, disabled]);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (!isVisible || !tooltipElement || !targetRef.current)
|
|
101
|
+
return;
|
|
102
|
+
const updatePosition = () => {
|
|
103
|
+
const targetRect = targetRef.current.getBoundingClientRect();
|
|
104
|
+
const tooltipRect = tooltipElement.getBoundingClientRect();
|
|
105
|
+
const { top, left, arrowTop, arrowLeft } = calculatePosition(targetRect, tooltipRect, placement);
|
|
106
|
+
setPosition({ top, left });
|
|
107
|
+
setArrowPosition({ top: arrowTop, left: arrowLeft });
|
|
108
|
+
};
|
|
109
|
+
updatePosition();
|
|
110
|
+
// Update position on scroll or resize
|
|
111
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
112
|
+
window.addEventListener("resize", updatePosition);
|
|
113
|
+
return () => {
|
|
114
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
115
|
+
window.removeEventListener("resize", updatePosition);
|
|
116
|
+
};
|
|
117
|
+
}, [isVisible, tooltipElement, targetRef, placement]);
|
|
118
|
+
if (disabled || !isVisible) {
|
|
119
|
+
return null;
|
|
25
120
|
}
|
|
26
|
-
return (_jsxs("div", {
|
|
121
|
+
return createPortal(_jsxs("div", { ref: setTooltipElement, className: `fixed z-50 px-3 py-2 text-sm font-medium text-popover-foreground bg-popover border border-border rounded-lg shadow-lg whitespace-nowrap transition-opacity duration-200 ${isVisible ? "opacity-100" : "opacity-0"} ${className}`, style: {
|
|
122
|
+
top: `${position.top}px`,
|
|
123
|
+
left: `${position.left}px`,
|
|
124
|
+
}, role: "tooltip", "data-testid": "tooltip-content", children: [content, _jsx("div", { className: `absolute w-2 h-2 bg-popover border-border ${getArrowRotation(placement)}`, style: {
|
|
125
|
+
top: `${arrowPosition.top}px`,
|
|
126
|
+
left: `${arrowPosition.left}px`,
|
|
127
|
+
} })] }), document.body);
|
|
27
128
|
};
|
|
28
129
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAwB,SAAS,EAAE,QAA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
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -284,9 +284,6 @@
|
|
|
284
284
|
.inset-0 {
|
|
285
285
|
inset: calc(var(--spacing) * 0);
|
|
286
286
|
}
|
|
287
|
-
.top-1\/2 {
|
|
288
|
-
top: calc(1/2 * 100%);
|
|
289
|
-
}
|
|
290
287
|
.top-2 {
|
|
291
288
|
top: calc(var(--spacing) * 2);
|
|
292
289
|
}
|
|
@@ -296,45 +293,24 @@
|
|
|
296
293
|
.top-10 {
|
|
297
294
|
top: calc(var(--spacing) * 10);
|
|
298
295
|
}
|
|
299
|
-
.top-\[-4px\] {
|
|
300
|
-
top: -4px;
|
|
301
|
-
}
|
|
302
296
|
.top-full {
|
|
303
297
|
top: 100%;
|
|
304
298
|
}
|
|
305
|
-
.right-0 {
|
|
306
|
-
right: calc(var(--spacing) * 0);
|
|
307
|
-
}
|
|
308
299
|
.right-2 {
|
|
309
300
|
right: calc(var(--spacing) * 2);
|
|
310
301
|
}
|
|
311
|
-
.right-3 {
|
|
312
|
-
right: calc(var(--spacing) * 3);
|
|
313
|
-
}
|
|
314
302
|
.right-4 {
|
|
315
303
|
right: calc(var(--spacing) * 4);
|
|
316
304
|
}
|
|
317
305
|
.right-20 {
|
|
318
306
|
right: calc(var(--spacing) * 20);
|
|
319
307
|
}
|
|
320
|
-
.right-\[-4px\] {
|
|
321
|
-
right: -4px;
|
|
322
|
-
}
|
|
323
|
-
.right-full {
|
|
324
|
-
right: 100%;
|
|
325
|
-
}
|
|
326
308
|
.bottom-0 {
|
|
327
309
|
bottom: calc(var(--spacing) * 0);
|
|
328
310
|
}
|
|
329
311
|
.bottom-3 {
|
|
330
312
|
bottom: calc(var(--spacing) * 3);
|
|
331
313
|
}
|
|
332
|
-
.bottom-\[-4px\] {
|
|
333
|
-
bottom: -4px;
|
|
334
|
-
}
|
|
335
|
-
.bottom-full {
|
|
336
|
-
bottom: 100%;
|
|
337
|
-
}
|
|
338
314
|
.left-0 {
|
|
339
315
|
left: calc(var(--spacing) * 0);
|
|
340
316
|
}
|
|
@@ -344,15 +320,9 @@
|
|
|
344
320
|
.left-2 {
|
|
345
321
|
left: calc(var(--spacing) * 2);
|
|
346
322
|
}
|
|
347
|
-
.left-3 {
|
|
348
|
-
left: calc(var(--spacing) * 3);
|
|
349
|
-
}
|
|
350
323
|
.left-10 {
|
|
351
324
|
left: calc(var(--spacing) * 10);
|
|
352
325
|
}
|
|
353
|
-
.left-\[-4px\] {
|
|
354
|
-
left: -4px;
|
|
355
|
-
}
|
|
356
326
|
.left-full {
|
|
357
327
|
left: 100%;
|
|
358
328
|
}
|
|
@@ -419,9 +389,6 @@
|
|
|
419
389
|
.mt-1 {
|
|
420
390
|
margin-top: calc(var(--spacing) * 1);
|
|
421
391
|
}
|
|
422
|
-
.mt-2 {
|
|
423
|
-
margin-top: calc(var(--spacing) * 2);
|
|
424
|
-
}
|
|
425
392
|
.mt-4 {
|
|
426
393
|
margin-top: calc(var(--spacing) * 4);
|
|
427
394
|
}
|
|
@@ -578,6 +545,9 @@
|
|
|
578
545
|
.max-w-full {
|
|
579
546
|
max-width: 100%;
|
|
580
547
|
}
|
|
548
|
+
.max-w-none {
|
|
549
|
+
max-width: none;
|
|
550
|
+
}
|
|
581
551
|
.min-w-full {
|
|
582
552
|
min-width: 100%;
|
|
583
553
|
}
|
|
@@ -594,10 +564,6 @@
|
|
|
594
564
|
--tw-translate-x: calc(calc(1/2 * 100%) * -1);
|
|
595
565
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
596
566
|
}
|
|
597
|
-
.-translate-y-1\/2 {
|
|
598
|
-
--tw-translate-y: calc(calc(1/2 * 100%) * -1);
|
|
599
|
-
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
600
|
-
}
|
|
601
567
|
.translate-y-0 {
|
|
602
568
|
--tw-translate-y: calc(var(--spacing) * 0);
|
|
603
569
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -1138,6 +1104,9 @@
|
|
|
1138
1104
|
.opacity-0 {
|
|
1139
1105
|
opacity: 0%;
|
|
1140
1106
|
}
|
|
1107
|
+
.opacity-100 {
|
|
1108
|
+
opacity: 100%;
|
|
1109
|
+
}
|
|
1141
1110
|
.shadow {
|
|
1142
1111
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
1143
1112
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -1240,13 +1209,6 @@
|
|
|
1240
1209
|
--tw-duration: 300ms;
|
|
1241
1210
|
transition-duration: 300ms;
|
|
1242
1211
|
}
|
|
1243
|
-
.group-hover\:opacity-100 {
|
|
1244
|
-
&:is(:where(.group):hover *) {
|
|
1245
|
-
@media (hover: hover) {
|
|
1246
|
-
opacity: 100%;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
1212
|
.peer-checked\/modal\:pointer-events-auto {
|
|
1251
1213
|
&:is(:where(.peer\/modal):checked ~ *) {
|
|
1252
1214
|
pointer-events: auto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.test.d.ts","sourceRoot":"","sources":["../../../src/tests/common/Tooltip.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { cleanup, render, screen, waitFor } from "@testing-library/react";
|
|
2
|
+
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, test } from "bun:test";
|
|
4
|
+
import { createElement, createRef } from "react";
|
|
5
|
+
import { Tooltip } from "../../components/common/Tooltip";
|
|
6
|
+
describe("Tooltip", () => {
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
// Clean up document.body between tests since tooltips are portaled
|
|
9
|
+
document.body.innerHTML = "";
|
|
10
|
+
});
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
cleanup();
|
|
13
|
+
});
|
|
14
|
+
describe("Basic Rendering", () => {
|
|
15
|
+
test("does not render when disabled is true", () => {
|
|
16
|
+
const targetRef = createRef();
|
|
17
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
18
|
+
targetRef,
|
|
19
|
+
content: "Tooltip content",
|
|
20
|
+
disabled: true,
|
|
21
|
+
})));
|
|
22
|
+
// Tooltip should not be in the document
|
|
23
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
24
|
+
});
|
|
25
|
+
test("does not render when not visible", () => {
|
|
26
|
+
const targetRef = createRef();
|
|
27
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
28
|
+
targetRef,
|
|
29
|
+
content: "Tooltip content",
|
|
30
|
+
disabled: false,
|
|
31
|
+
})));
|
|
32
|
+
// Tooltip should not be visible initially
|
|
33
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
34
|
+
});
|
|
35
|
+
test("renders when visible after hover", async () => {
|
|
36
|
+
const user = userEvent.setup();
|
|
37
|
+
const targetRef = createRef();
|
|
38
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
39
|
+
targetRef,
|
|
40
|
+
content: "Tooltip content",
|
|
41
|
+
disabled: false,
|
|
42
|
+
})));
|
|
43
|
+
const button = screen.getByText("Hover me");
|
|
44
|
+
await user.hover(button);
|
|
45
|
+
await waitFor(() => {
|
|
46
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
47
|
+
expect(screen.getByText("Tooltip content")).toBeTruthy();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
test("applies custom className", async () => {
|
|
51
|
+
const user = userEvent.setup();
|
|
52
|
+
const targetRef = createRef();
|
|
53
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
54
|
+
targetRef,
|
|
55
|
+
content: "Tooltip content",
|
|
56
|
+
className: "custom-tooltip-class",
|
|
57
|
+
})));
|
|
58
|
+
const button = screen.getByText("Hover me");
|
|
59
|
+
await user.hover(button);
|
|
60
|
+
await waitFor(() => {
|
|
61
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
62
|
+
expect(tooltip.className).toContain("custom-tooltip-class");
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
test("renders with ReactNode content", async () => {
|
|
66
|
+
const user = userEvent.setup();
|
|
67
|
+
const targetRef = createRef();
|
|
68
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
69
|
+
targetRef,
|
|
70
|
+
content: createElement("strong", null, "Bold tooltip"),
|
|
71
|
+
})));
|
|
72
|
+
const button = screen.getByText("Hover me");
|
|
73
|
+
await user.hover(button);
|
|
74
|
+
await waitFor(() => {
|
|
75
|
+
expect(screen.getByText("Bold tooltip")).toBeTruthy();
|
|
76
|
+
const strong = screen.getByText("Bold tooltip").tagName;
|
|
77
|
+
expect(strong).toBe("STRONG");
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
describe("Visibility Control", () => {
|
|
82
|
+
test("shows tooltip on mouseenter", async () => {
|
|
83
|
+
const user = userEvent.setup();
|
|
84
|
+
const targetRef = createRef();
|
|
85
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
86
|
+
targetRef,
|
|
87
|
+
content: "Tooltip content",
|
|
88
|
+
})));
|
|
89
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
90
|
+
const button = screen.getByText("Hover me");
|
|
91
|
+
await user.hover(button);
|
|
92
|
+
await waitFor(() => {
|
|
93
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
test("hides tooltip on mouseleave", async () => {
|
|
97
|
+
const user = userEvent.setup();
|
|
98
|
+
const targetRef = createRef();
|
|
99
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
100
|
+
targetRef,
|
|
101
|
+
content: "Tooltip content",
|
|
102
|
+
})));
|
|
103
|
+
const button = screen.getByText("Hover me");
|
|
104
|
+
await user.hover(button);
|
|
105
|
+
await waitFor(() => {
|
|
106
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
107
|
+
});
|
|
108
|
+
await user.unhover(button);
|
|
109
|
+
await waitFor(() => {
|
|
110
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
test("does not show tooltip when disabled", async () => {
|
|
114
|
+
const user = userEvent.setup();
|
|
115
|
+
const targetRef = createRef();
|
|
116
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
117
|
+
targetRef,
|
|
118
|
+
content: "Tooltip content",
|
|
119
|
+
disabled: true,
|
|
120
|
+
})));
|
|
121
|
+
const button = screen.getByText("Hover me");
|
|
122
|
+
await user.hover(button);
|
|
123
|
+
// Wait a bit to ensure it doesn't appear
|
|
124
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
125
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
describe("Placement Positioning", () => {
|
|
129
|
+
const placements = [
|
|
130
|
+
"top",
|
|
131
|
+
"top-right",
|
|
132
|
+
"top-left",
|
|
133
|
+
"bottom",
|
|
134
|
+
"bottom-right",
|
|
135
|
+
"bottom-left",
|
|
136
|
+
"right",
|
|
137
|
+
"left",
|
|
138
|
+
];
|
|
139
|
+
placements.forEach((placement) => {
|
|
140
|
+
test(`renders with ${placement} placement`, async () => {
|
|
141
|
+
const user = userEvent.setup();
|
|
142
|
+
const targetRef = createRef();
|
|
143
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
144
|
+
targetRef,
|
|
145
|
+
content: "Tooltip content",
|
|
146
|
+
placement,
|
|
147
|
+
})));
|
|
148
|
+
const button = screen.getByText("Hover me");
|
|
149
|
+
await user.hover(button);
|
|
150
|
+
await waitFor(() => {
|
|
151
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
152
|
+
expect(tooltip).toBeTruthy();
|
|
153
|
+
// Tooltip should have positioning styles
|
|
154
|
+
expect(tooltip.style.top).toBeTruthy();
|
|
155
|
+
expect(tooltip.style.left).toBeTruthy();
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
test("defaults to top placement when not specified", async () => {
|
|
160
|
+
const user = userEvent.setup();
|
|
161
|
+
const targetRef = createRef();
|
|
162
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
163
|
+
targetRef,
|
|
164
|
+
content: "Tooltip content",
|
|
165
|
+
})));
|
|
166
|
+
const button = screen.getByText("Hover me");
|
|
167
|
+
await user.hover(button);
|
|
168
|
+
await waitFor(() => {
|
|
169
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
describe("Arrow Rendering", () => {
|
|
174
|
+
test("renders arrow element", async () => {
|
|
175
|
+
const user = userEvent.setup();
|
|
176
|
+
const targetRef = createRef();
|
|
177
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
178
|
+
targetRef,
|
|
179
|
+
content: "Tooltip content",
|
|
180
|
+
})));
|
|
181
|
+
const button = screen.getByText("Hover me");
|
|
182
|
+
await user.hover(button);
|
|
183
|
+
await waitFor(() => {
|
|
184
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
185
|
+
const arrow = tooltip.querySelector(".rotate-45");
|
|
186
|
+
expect(arrow).toBeTruthy();
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
test("arrow has correct styles", async () => {
|
|
190
|
+
const user = userEvent.setup();
|
|
191
|
+
const targetRef = createRef();
|
|
192
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
193
|
+
targetRef,
|
|
194
|
+
content: "Tooltip content",
|
|
195
|
+
})));
|
|
196
|
+
const button = screen.getByText("Hover me");
|
|
197
|
+
await user.hover(button);
|
|
198
|
+
await waitFor(() => {
|
|
199
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
200
|
+
const arrow = tooltip.querySelector(".rotate-45");
|
|
201
|
+
expect(arrow).toBeTruthy();
|
|
202
|
+
// Arrow should have position styles
|
|
203
|
+
expect(arrow.style.top).toBeTruthy();
|
|
204
|
+
expect(arrow.style.left).toBeTruthy();
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
describe("Portal Behavior", () => {
|
|
209
|
+
test("renders tooltip in document.body via portal", async () => {
|
|
210
|
+
const user = userEvent.setup();
|
|
211
|
+
const targetRef = createRef();
|
|
212
|
+
const { container } = render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
213
|
+
targetRef,
|
|
214
|
+
content: "Tooltip content",
|
|
215
|
+
})));
|
|
216
|
+
const button = screen.getByText("Hover me");
|
|
217
|
+
await user.hover(button);
|
|
218
|
+
await waitFor(() => {
|
|
219
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
220
|
+
expect(tooltip).toBeTruthy();
|
|
221
|
+
// Tooltip should be in document.body, not in the container
|
|
222
|
+
expect(container.contains(tooltip)).toBe(false);
|
|
223
|
+
expect(document.body.contains(tooltip)).toBe(true);
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
describe("Edge Cases", () => {
|
|
228
|
+
test("handles null targetRef gracefully", () => {
|
|
229
|
+
const targetRef = createRef();
|
|
230
|
+
// Don't attach the ref to anything
|
|
231
|
+
render(createElement("div", null, createElement(Tooltip, {
|
|
232
|
+
targetRef,
|
|
233
|
+
content: "Tooltip content",
|
|
234
|
+
})));
|
|
235
|
+
// Should not error, just not render
|
|
236
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
237
|
+
});
|
|
238
|
+
test("cleans up event listeners on unmount", async () => {
|
|
239
|
+
const user = userEvent.setup();
|
|
240
|
+
const targetRef = createRef();
|
|
241
|
+
const { unmount } = render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
242
|
+
targetRef,
|
|
243
|
+
content: "Tooltip content",
|
|
244
|
+
})));
|
|
245
|
+
const button = screen.getByText("Hover me");
|
|
246
|
+
await user.hover(button);
|
|
247
|
+
await waitFor(() => {
|
|
248
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
249
|
+
});
|
|
250
|
+
// Unmount the component
|
|
251
|
+
unmount();
|
|
252
|
+
// Tooltip should be removed
|
|
253
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
254
|
+
});
|
|
255
|
+
test("shows tooltip when disabled changes from true to false", async () => {
|
|
256
|
+
const user = userEvent.setup();
|
|
257
|
+
const targetRef = createRef();
|
|
258
|
+
const { rerender } = render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
259
|
+
targetRef,
|
|
260
|
+
content: "Tooltip content",
|
|
261
|
+
disabled: true,
|
|
262
|
+
})));
|
|
263
|
+
const button = screen.getByText("Hover me");
|
|
264
|
+
await user.hover(button);
|
|
265
|
+
expect(screen.queryByTestId("tooltip-content")).toBeNull();
|
|
266
|
+
// Unhover first
|
|
267
|
+
await user.unhover(button);
|
|
268
|
+
// Re-render with disabled: false
|
|
269
|
+
rerender(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
270
|
+
targetRef,
|
|
271
|
+
content: "Tooltip content",
|
|
272
|
+
disabled: false,
|
|
273
|
+
})));
|
|
274
|
+
// Hover again to trigger the tooltip
|
|
275
|
+
await user.hover(button);
|
|
276
|
+
await waitFor(() => {
|
|
277
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
test("handles placement change while visible", async () => {
|
|
281
|
+
const user = userEvent.setup();
|
|
282
|
+
const targetRef = createRef();
|
|
283
|
+
const { rerender } = render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
284
|
+
targetRef,
|
|
285
|
+
content: "Tooltip content",
|
|
286
|
+
placement: "top",
|
|
287
|
+
})));
|
|
288
|
+
const button = screen.getByText("Hover me");
|
|
289
|
+
await user.hover(button);
|
|
290
|
+
await waitFor(() => {
|
|
291
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
292
|
+
});
|
|
293
|
+
// Change placement
|
|
294
|
+
rerender(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
295
|
+
targetRef,
|
|
296
|
+
content: "Tooltip content",
|
|
297
|
+
placement: "bottom",
|
|
298
|
+
})));
|
|
299
|
+
await waitFor(() => {
|
|
300
|
+
// Position should update based on new placement
|
|
301
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
test("tooltip has correct ARIA attributes", async () => {
|
|
305
|
+
const user = userEvent.setup();
|
|
306
|
+
const targetRef = createRef();
|
|
307
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
308
|
+
targetRef,
|
|
309
|
+
content: "Tooltip content",
|
|
310
|
+
})));
|
|
311
|
+
const button = screen.getByText("Hover me");
|
|
312
|
+
await user.hover(button);
|
|
313
|
+
await waitFor(() => {
|
|
314
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
315
|
+
expect(tooltip.getAttribute("role")).toBe("tooltip");
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
test("handles rapid hover/unhover without errors", async () => {
|
|
319
|
+
const user = userEvent.setup();
|
|
320
|
+
const targetRef = createRef();
|
|
321
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
322
|
+
targetRef,
|
|
323
|
+
content: "Tooltip content",
|
|
324
|
+
})));
|
|
325
|
+
const button = screen.getByText("Hover me");
|
|
326
|
+
// Rapidly hover and unhover
|
|
327
|
+
await user.hover(button);
|
|
328
|
+
await user.unhover(button);
|
|
329
|
+
await user.hover(button);
|
|
330
|
+
await user.unhover(button);
|
|
331
|
+
await user.hover(button);
|
|
332
|
+
// Should handle this gracefully
|
|
333
|
+
await waitFor(() => {
|
|
334
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
describe("Styling", () => {
|
|
339
|
+
test("applies correct CSS classes", async () => {
|
|
340
|
+
const user = userEvent.setup();
|
|
341
|
+
const targetRef = createRef();
|
|
342
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
343
|
+
targetRef,
|
|
344
|
+
content: "Tooltip content",
|
|
345
|
+
})));
|
|
346
|
+
const button = screen.getByText("Hover me");
|
|
347
|
+
await user.hover(button);
|
|
348
|
+
await waitFor(() => {
|
|
349
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
350
|
+
expect(tooltip.className).toContain("fixed");
|
|
351
|
+
expect(tooltip.className).toContain("z-50");
|
|
352
|
+
expect(tooltip.className).toContain("bg-popover");
|
|
353
|
+
expect(tooltip.className).toContain("border");
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
test("has visible opacity when shown", async () => {
|
|
357
|
+
const user = userEvent.setup();
|
|
358
|
+
const targetRef = createRef();
|
|
359
|
+
render(createElement("div", null, createElement("button", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
360
|
+
targetRef,
|
|
361
|
+
content: "Tooltip content",
|
|
362
|
+
})));
|
|
363
|
+
const button = screen.getByText("Hover me");
|
|
364
|
+
await user.hover(button);
|
|
365
|
+
await waitFor(() => {
|
|
366
|
+
const tooltip = screen.getByTestId("tooltip-content");
|
|
367
|
+
expect(tooltip.className).toContain("opacity-100");
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
describe("Different Target Types", () => {
|
|
372
|
+
test("works with HTMLDivElement ref", async () => {
|
|
373
|
+
const user = userEvent.setup();
|
|
374
|
+
const targetRef = createRef();
|
|
375
|
+
render(createElement("div", null, createElement("div", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
376
|
+
targetRef,
|
|
377
|
+
content: "Tooltip content",
|
|
378
|
+
})));
|
|
379
|
+
const div = screen.getByText("Hover me");
|
|
380
|
+
await user.hover(div);
|
|
381
|
+
await waitFor(() => {
|
|
382
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
test("works with HTMLElement ref", async () => {
|
|
386
|
+
const user = userEvent.setup();
|
|
387
|
+
const targetRef = createRef();
|
|
388
|
+
render(createElement("div", null, createElement("span", { ref: targetRef }, "Hover me"), createElement(Tooltip, {
|
|
389
|
+
targetRef,
|
|
390
|
+
content: "Tooltip content",
|
|
391
|
+
})));
|
|
392
|
+
const span = screen.getByText("Hover me");
|
|
393
|
+
await user.hover(span);
|
|
394
|
+
await waitFor(() => {
|
|
395
|
+
expect(screen.getByTestId("tooltip-content")).toBeTruthy();
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
//# sourceMappingURL=Tooltip.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../../src/tests/common/Tooltip.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE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"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Themeable React UI component library for text-based games with Tailwind CSS v4, featuring story passages, interactive maps, and customizable game interfaces",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tsc-alias": "^1.8.16",
|
|
49
49
|
"@tailwindcss/postcss": "^4.0.0",
|
|
50
50
|
"postcss": "^8.4.49",
|
|
51
|
-
"@react-text-game/core": "0.5.
|
|
51
|
+
"@react-text-game/core": "0.5.2"
|
|
52
52
|
},
|
|
53
53
|
"imports": {
|
|
54
54
|
"#*": "./dist/*"
|