@sybilion/uilib 1.3.51 → 1.3.52
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.
|
@@ -85,6 +85,7 @@ function applyOverTriggerStyles(contentEl, triggerEl) {
|
|
|
85
85
|
wrapper.style.setProperty('left', `${rect.left - paddingLeft - borderLeft}px`, 'important');
|
|
86
86
|
wrapper.style.setProperty('top', `${rect.top - paddingTop - borderTop}px`, 'important');
|
|
87
87
|
wrapper.style.setProperty('transform', 'none', 'important');
|
|
88
|
+
wrapper.style.setProperty('pointer-events', 'none');
|
|
88
89
|
wrapper.style.setProperty('min-width', '0', 'important');
|
|
89
90
|
wrapper.style.setProperty('width', `${rect.width + paddingLeft + paddingRight + borderLeft + borderRight}px`, 'important');
|
|
90
91
|
contentEl.style.width = '100%';
|
|
@@ -101,6 +102,7 @@ function clearOverTriggerStyles(contentEl) {
|
|
|
101
102
|
wrapper.style.removeProperty('left');
|
|
102
103
|
wrapper.style.removeProperty('top');
|
|
103
104
|
wrapper.style.removeProperty('transform');
|
|
105
|
+
wrapper.style.removeProperty('pointer-events');
|
|
104
106
|
wrapper.style.removeProperty('min-width');
|
|
105
107
|
wrapper.style.removeProperty('width');
|
|
106
108
|
contentEl.style.removeProperty('width');
|
package/package.json
CHANGED
|
@@ -126,6 +126,7 @@ function applyOverTriggerStyles(
|
|
|
126
126
|
'important',
|
|
127
127
|
);
|
|
128
128
|
wrapper.style.setProperty('transform', 'none', 'important');
|
|
129
|
+
wrapper.style.setProperty('pointer-events', 'none');
|
|
129
130
|
wrapper.style.setProperty('min-width', '0', 'important');
|
|
130
131
|
wrapper.style.setProperty(
|
|
131
132
|
'width',
|
|
@@ -148,6 +149,7 @@ function clearOverTriggerStyles(contentEl: HTMLElement | null) {
|
|
|
148
149
|
wrapper.style.removeProperty('left');
|
|
149
150
|
wrapper.style.removeProperty('top');
|
|
150
151
|
wrapper.style.removeProperty('transform');
|
|
152
|
+
wrapper.style.removeProperty('pointer-events');
|
|
151
153
|
wrapper.style.removeProperty('min-width');
|
|
152
154
|
wrapper.style.removeProperty('width');
|
|
153
155
|
|
|
@@ -11,6 +11,9 @@ import { DocsHeaderActions } from '../docsHeaderActions';
|
|
|
11
11
|
|
|
12
12
|
const TOOLTIP_SIDES = ['left', 'top', 'bottom', 'right'] as const;
|
|
13
13
|
|
|
14
|
+
const LONG_TEXT =
|
|
15
|
+
'This is a long text that should overflow and show a tooltip on hover.';
|
|
16
|
+
|
|
14
17
|
export default function TooltipPage() {
|
|
15
18
|
return (
|
|
16
19
|
<>
|
|
@@ -33,6 +36,34 @@ export default function TooltipPage() {
|
|
|
33
36
|
</Tooltip>
|
|
34
37
|
))}
|
|
35
38
|
</div>
|
|
39
|
+
|
|
40
|
+
<div
|
|
41
|
+
style={{
|
|
42
|
+
display: 'inline-block',
|
|
43
|
+
padding: 'var(--p-4)',
|
|
44
|
+
marginTop: 'var(--p-4)',
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<h3>Tooltip over trigger:</h3>
|
|
48
|
+
<br />
|
|
49
|
+
<Tooltip>
|
|
50
|
+
<TooltipTrigger asChild>
|
|
51
|
+
<div
|
|
52
|
+
style={{
|
|
53
|
+
maxWidth: '200px',
|
|
54
|
+
textOverflow: 'ellipsis',
|
|
55
|
+
overflow: 'hidden',
|
|
56
|
+
whiteSpace: 'nowrap',
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{LONG_TEXT}
|
|
60
|
+
</div>
|
|
61
|
+
</TooltipTrigger>
|
|
62
|
+
<TooltipContent side="bottom" overTrigger>
|
|
63
|
+
{LONG_TEXT}
|
|
64
|
+
</TooltipContent>
|
|
65
|
+
</Tooltip>
|
|
66
|
+
</div>
|
|
36
67
|
</PageContentSection>
|
|
37
68
|
</>
|
|
38
69
|
);
|