@loomhq/lens 10.57.2 → 10.57.4
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.
|
@@ -89,7 +89,7 @@ const IconSection = styled.div `
|
|
|
89
89
|
pointer-events: none;
|
|
90
90
|
width: ${props => sizesStyles[props.size].width};
|
|
91
91
|
// Width isn't equal to iconPadding because we want more space on the left than the right
|
|
92
|
-
height:
|
|
92
|
+
height: 100%;
|
|
93
93
|
display: flex;
|
|
94
94
|
align-items: center;
|
|
95
95
|
justify-content: center;
|
|
@@ -51,6 +51,12 @@ export const TooltipBox = (_a) => {
|
|
|
51
51
|
const TooltipChildren = styled.div `
|
|
52
52
|
display: ${props => (props.isInline ? 'inline-block' : 'block')};
|
|
53
53
|
${props => props.verticalAlign && `vertical-align: ${props.verticalAlign}`};
|
|
54
|
+
&:focus-visible {
|
|
55
|
+
// Note: 0px solid transparent prevents focus rings from disappearing for -ms-high-contrast.
|
|
56
|
+
// TODO(LNS-183): Provide more robust polyfill/support for :focus for older versions of Safari, which don't support :focus-visible
|
|
57
|
+
outline: 0px solid transparent;
|
|
58
|
+
box-shadow: var(--lns-formFieldBorderShadowFocus);
|
|
59
|
+
}
|
|
54
60
|
`;
|
|
55
61
|
function getInitialDelaySpeed(delay) {
|
|
56
62
|
switch (delay) {
|
|
@@ -66,7 +72,7 @@ const Tooltip = (_a) => {
|
|
|
66
72
|
var { children, content, placement = 'topCenter', keepOpen, triggerOffset = 4, maxWidth = 26, isInline = true, isDisabled, container, tabIndex = 0, zIndex = 1100, verticalAlign = 'middle', delay = 'immediate' } = _a, rest = __rest(_a, ["children", "content", "placement", "keepOpen", "triggerOffset", "maxWidth", "isInline", "isDisabled", "container", "tabIndex", "zIndex", "verticalAlign", "delay"]);
|
|
67
73
|
const [show, hoverProps] = useHover({
|
|
68
74
|
delayEnter: getInitialDelaySpeed(delay),
|
|
69
|
-
delayLeave:
|
|
75
|
+
delayLeave: 200,
|
|
70
76
|
});
|
|
71
77
|
const [isOverTooltip, setIsOverTooltip] = useState(false);
|
|
72
78
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -82,7 +88,7 @@ const Tooltip = (_a) => {
|
|
|
82
88
|
setIsOpen(true);
|
|
83
89
|
}
|
|
84
90
|
// We have to watch this separately since hover and focus are managed separately. So, an element can be keyboard focused while another element is mouse hovered.
|
|
85
|
-
if (!show) {
|
|
91
|
+
if (!show && !keepTooltipOpenOnHover) {
|
|
86
92
|
setIsOpen(false);
|
|
87
93
|
}
|
|
88
94
|
}, [
|