@uxland/primary-shell 7.28.0 → 7.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{component-Dk1hmoTY.js → component-tlTej8-E.js} +2 -2
- package/dist/{component-Dk1hmoTY.js.map → component-tlTej8-E.js.map} +1 -1
- package/dist/{index-DSoZpzbx.js → index-DOWczb4l.js} +195 -171
- package/dist/index-DOWczb4l.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +50 -40
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/components/navigation-tooltip/index.d.ts +1 -1
- package/dist/primary/shell/src/UI/components/navigation-tooltip/navigation-tooltip.d.ts +4 -4
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/UI/components/navigation-tooltip/index.ts +1 -1
- package/src/UI/components/navigation-tooltip/navigation-tooltip.ts +50 -0
- package/src/UI/components/navigation-tooltip/styles.css +5 -1
- package/dist/index-DSoZpzbx.js.map +0 -1
- package/src/UI/components/navigation-tooltip/navigation-tooltip.tsx +0 -64
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { createRoot, Root } from "react-dom/client";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
|
|
5
|
-
interface NavigationTooltipProps {
|
|
6
|
-
text: string;
|
|
7
|
-
itemAbsoluteY: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const NavigationTooltip: React.FC<NavigationTooltipProps> = ({ text, itemAbsoluteY }) => {
|
|
11
|
-
const itemHeight = 51;
|
|
12
|
-
const centerY = itemAbsoluteY + itemHeight / 2;
|
|
13
|
-
|
|
14
|
-
const style = {
|
|
15
|
-
left: "73px", // 60px (sidebar width) + 13px offset
|
|
16
|
-
top: `${centerY}px`,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div className="tooltip-overlay">
|
|
21
|
-
<div className="navigation-tooltip" style={style}>
|
|
22
|
-
<dss-icon icon="info" size="md" />
|
|
23
|
-
{text}
|
|
24
|
-
<div className="arrow" />
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default NavigationTooltip;
|
|
31
|
-
|
|
32
|
-
// Singleton root to manage the tooltip rendering
|
|
33
|
-
let tooltipRoot: Root | null = null;
|
|
34
|
-
let tooltipContainer: HTMLDivElement | null = null;
|
|
35
|
-
|
|
36
|
-
export const renderNavigationTooltip = (text: string, itemAbsoluteY: number) => {
|
|
37
|
-
// Clean up existing tooltip if any
|
|
38
|
-
if (tooltipRoot && tooltipContainer) {
|
|
39
|
-
tooltipRoot.unmount();
|
|
40
|
-
if (document.body.contains(tooltipContainer)) {
|
|
41
|
-
document.body.removeChild(tooltipContainer);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Create new container
|
|
46
|
-
tooltipContainer = document.createElement("div");
|
|
47
|
-
document.body.appendChild(tooltipContainer);
|
|
48
|
-
|
|
49
|
-
// Create root and render
|
|
50
|
-
tooltipRoot = createRoot(tooltipContainer);
|
|
51
|
-
tooltipRoot.render(<NavigationTooltip text={text} itemAbsoluteY={itemAbsoluteY} />);
|
|
52
|
-
|
|
53
|
-
// Auto-remove after 5 seconds
|
|
54
|
-
setTimeout(() => {
|
|
55
|
-
if (tooltipRoot && tooltipContainer) {
|
|
56
|
-
tooltipRoot.unmount();
|
|
57
|
-
if (document.body.contains(tooltipContainer)) {
|
|
58
|
-
document.body.removeChild(tooltipContainer);
|
|
59
|
-
}
|
|
60
|
-
tooltipRoot = null;
|
|
61
|
-
tooltipContainer = null;
|
|
62
|
-
}
|
|
63
|
-
}, 5000);
|
|
64
|
-
};
|