@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
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { showNavItemTooltip } from "./tooltip-manager";
|
|
2
|
-
export {
|
|
2
|
+
export { NavigationTooltip } from "./navigation-tooltip";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LitElement, html, css, unsafeCSS } from "lit";
|
|
2
|
+
import { property } from "lit/decorators.js";
|
|
3
|
+
import styles from "./styles.css?inline";
|
|
4
|
+
|
|
5
|
+
export class NavigationTooltip extends LitElement {
|
|
6
|
+
@property({ type: String }) text = "";
|
|
7
|
+
@property({ type: Number }) itemAbsoluteY = 0;
|
|
8
|
+
|
|
9
|
+
static styles = css`
|
|
10
|
+
${unsafeCSS(styles)}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
const itemHeight = 51;
|
|
15
|
+
const centerY = this.itemAbsoluteY + itemHeight / 2;
|
|
16
|
+
|
|
17
|
+
return html`
|
|
18
|
+
<div class="tooltip-overlay">
|
|
19
|
+
<div class="navigation-tooltip" style="left: 73px; top: ${centerY}px">
|
|
20
|
+
<dss-icon icon="info" size="md"></dss-icon>
|
|
21
|
+
${this.text}
|
|
22
|
+
<div class="arrow"></div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
customElements.define("navigation-tooltip", NavigationTooltip);
|
|
30
|
+
|
|
31
|
+
export const renderNavigationTooltip = (text: string, itemAbsoluteY: number) => {
|
|
32
|
+
// Remove existing tooltip if any
|
|
33
|
+
const existing = document.querySelector("navigation-tooltip");
|
|
34
|
+
if (existing) {
|
|
35
|
+
existing.remove();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Create new tooltip
|
|
39
|
+
const tooltip = document.createElement("navigation-tooltip") as NavigationTooltip;
|
|
40
|
+
tooltip.text = text;
|
|
41
|
+
tooltip.itemAbsoluteY = itemAbsoluteY;
|
|
42
|
+
document.body.appendChild(tooltip);
|
|
43
|
+
|
|
44
|
+
// Auto-remove after 5 seconds
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
if (tooltip && document.body.contains(tooltip)) {
|
|
47
|
+
tooltip.remove();
|
|
48
|
+
}
|
|
49
|
+
}, 5000);
|
|
50
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.tooltip-overlay {
|
|
2
6
|
position: fixed;
|
|
3
7
|
top: 0;
|
|
@@ -40,7 +44,7 @@
|
|
|
40
44
|
width: 0;
|
|
41
45
|
height: 0;
|
|
42
46
|
border: 12px solid transparent;
|
|
43
|
-
border-right-color: #
|
|
47
|
+
border-right-color: #0F4877;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
@keyframes fadeInOut {
|