triiiceratops 0.12.1 → 0.12.2
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/actions/tooltip.js
CHANGED
|
@@ -4,16 +4,20 @@ export function tooltip(node, params) {
|
|
|
4
4
|
if (tip)
|
|
5
5
|
return;
|
|
6
6
|
tip = document.createElement('div');
|
|
7
|
-
// Mimic DaisyUI tooltip style
|
|
8
|
-
// tooltip: --tooltip-color: #e5e7eb; --tooltip-text-color: #000000; ...
|
|
9
|
-
// We'll use standard utility classes that match the theme roughly
|
|
10
|
-
// bg-neutral text-neutral-content is usually closest to daisyui tooltip default
|
|
11
7
|
tip.className =
|
|
12
|
-
'fixed z-[9999] px-2 py-1 text-xs rounded
|
|
8
|
+
'fixed z-[9999] px-2 py-1 text-xs rounded shadow-sm pointer-events-none opacity-0 transition-opacity duration-150 whitespace-nowrap max-w-xs';
|
|
13
9
|
tip.textContent = params.content;
|
|
10
|
+
const computedStyle = getComputedStyle(node);
|
|
11
|
+
const bgColor = computedStyle.getPropertyValue('--color-base-200').trim() ||
|
|
12
|
+
computedStyle.getPropertyValue('--color-neutral').trim() ||
|
|
13
|
+
'oklch(0.95 0 0)';
|
|
14
|
+
const textColor = computedStyle.getPropertyValue('--color-base-content').trim() ||
|
|
15
|
+
computedStyle.getPropertyValue('--color-neutral-content').trim() ||
|
|
16
|
+
'oklch(0.2 0 0)';
|
|
17
|
+
tip.style.backgroundColor = bgColor;
|
|
18
|
+
tip.style.color = textColor;
|
|
14
19
|
document.body.appendChild(tip);
|
|
15
20
|
updatePosition();
|
|
16
|
-
// Trigger reflow/paint for transition
|
|
17
21
|
requestAnimationFrame(() => {
|
|
18
22
|
if (tip)
|
|
19
23
|
tip.style.opacity = '1';
|