@loomhq/lens 10.33.1 → 10.34.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const TooltipBoxWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TooltipBoxProps, object>;
|
|
3
3
|
export declare const TooltipBox: ({ children, maxWidth, onMouseEnter, onMouseLeave, layerProps, zIndex, ...rest }: TooltipBoxProps & React.ComponentProps<typeof TooltipBoxWrapper>) => JSX.Element;
|
|
4
|
-
declare function Tooltip({ children, content, placement, keepOpen, triggerOffset, maxWidth, isInline, container, zIndex, verticalAlign, ...rest }: TooltipProps): JSX.Element;
|
|
4
|
+
declare function Tooltip({ children, content, placement, keepOpen, triggerOffset, maxWidth, isInline, isDisabled, container, zIndex, verticalAlign, ...rest }: TooltipProps): JSX.Element;
|
|
5
5
|
export declare const availablePlacements: string[];
|
|
6
6
|
declare type TooltipBoxProps = {
|
|
7
7
|
children?: React.ReactNode;
|
|
@@ -12,15 +12,16 @@ declare type TooltipBoxProps = {
|
|
|
12
12
|
zIndex?: number;
|
|
13
13
|
};
|
|
14
14
|
declare type TooltipProps = {
|
|
15
|
-
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
container?: HTMLElement | (() => HTMLElement) | string;
|
|
16
17
|
content?: React.ReactNode;
|
|
17
|
-
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
isInline?: boolean;
|
|
18
20
|
keepOpen?: boolean;
|
|
19
21
|
maxWidth?: number | string | [];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
zIndex?: number;
|
|
23
|
-
children?: React.ReactNode;
|
|
22
|
+
placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'leftTop' | 'leftCenter' | 'leftBottom' | 'rightTop' | 'rightCenter' | 'rightBottom';
|
|
23
|
+
triggerOffset?: number;
|
|
24
24
|
verticalAlign?: string;
|
|
25
|
+
zIndex?: number;
|
|
25
26
|
};
|
|
26
27
|
export default Tooltip;
|
|
@@ -53,7 +53,7 @@ const TooltipChildren = styled.span `
|
|
|
53
53
|
${props => props.verticalAlign && `vertical-align: ${props.verticalAlign}`};
|
|
54
54
|
`;
|
|
55
55
|
function Tooltip(_a) {
|
|
56
|
-
var { children, content, placement = 'topCenter', keepOpen, triggerOffset = 4, maxWidth = 26, isInline = true, container, zIndex = 1100, verticalAlign = 'middle' } = _a, rest = __rest(_a, ["children", "content", "placement", "keepOpen", "triggerOffset", "maxWidth", "isInline", "container", "zIndex", "verticalAlign"]);
|
|
56
|
+
var { children, content, placement = 'topCenter', keepOpen, triggerOffset = 4, maxWidth = 26, isInline = true, isDisabled, container, zIndex = 1100, verticalAlign = 'middle' } = _a, rest = __rest(_a, ["children", "content", "placement", "keepOpen", "triggerOffset", "maxWidth", "isInline", "isDisabled", "container", "zIndex", "verticalAlign"]);
|
|
57
57
|
const [show, hoverProps] = useHover({
|
|
58
58
|
delayEnter: 100,
|
|
59
59
|
delayLeave: 100,
|
|
@@ -71,6 +71,7 @@ function Tooltip(_a) {
|
|
|
71
71
|
return (React.createElement(React.Fragment, null,
|
|
72
72
|
React.createElement(TooltipChildren, Object.assign({}, triggerProps, hoverProps, { isInline: isInline, verticalAlign: verticalAlign }), children),
|
|
73
73
|
isOpen &&
|
|
74
|
+
!isDisabled &&
|
|
74
75
|
renderLayer(React.createElement("div", Object.assign({}, layerProps, { style: Object.assign(Object.assign({}, layerProps.style), { zIndex }) }),
|
|
75
76
|
React.createElement(TooltipBox, Object.assign({ maxWidth: maxWidth, onMouseEnter: () => setIsOverTooltip(true), onMouseLeave: () => setIsOverTooltip(false) }, rest), content)))));
|
|
76
77
|
}
|