@konturio/ui-kit
Advanced tools
Comparing version 3.12.0 to 3.12.1
{ | ||
"name": "@konturio/ui-kit", | ||
"version": "3.12.0", | ||
"version": "3.12.1", | ||
"repository": { | ||
@@ -34,3 +34,3 @@ "type": "git", | ||
}, | ||
"gitHead": "46c244e810f248b304696bd122ccd05aadc785b5" | ||
"gitHead": "3f2e22b680851c029a6ccf3e0f87cf877c00b88c" | ||
} |
/// <reference types="react" /> | ||
import type { TooltipProps } from '../types'; | ||
export declare type MouseClickEvent = React.MouseEvent<HTMLDivElement, MouseEvent>; | ||
export declare function Tooltip({ children, anchor, placement: placementProp, getPlacement, classes, hoverBehavior, onOuterClick, onClose, open, offset: offsetValue, }: TooltipProps): JSX.Element | null; | ||
export declare function Tooltip({ children, anchor, transitionRef, placement: placementProp, getPlacement, classes, hoverBehavior, onOuterClick, onClose, open, offset: offsetValue, }: TooltipProps): JSX.Element | null; | ||
//# sourceMappingURL=Tooltip.d.ts.map |
@@ -10,3 +10,3 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
const defaultPlacement = 'top'; | ||
export function Tooltip({ children, anchor, placement: placementProp, getPlacement, classes, hoverBehavior = false, onOuterClick, onClose, open = true, offset: offsetValue = 7, }) { | ||
export function Tooltip({ children, anchor, transitionRef, placement: placementProp, getPlacement, classes, hoverBehavior = false, onOuterClick, onClose, open = true, offset: offsetValue = 7, }) { | ||
const onClickOuter = useCallback((e) => { | ||
@@ -71,3 +71,3 @@ if (onOuterClick && hoverBehavior === true) { | ||
return null; | ||
return (_jsx("div", { ref: targetRef, className: clsx(s.tooltipContainer, { [s.hoverTooltip]: hoverBehavior }), onClick: onClickOuter, style: positionVariables, children: _jsxs(TooltipContent, { ref: refs.setFloating, className: classes?.popupContent, onClose: hoverBehavior ? undefined : onClose, children: [children, _jsx("div", { ref: arrowRef, className: clsx(s.arrow, s[arrowSide]), children: _jsx("div", { className: s.arrowInner }) })] }) })); | ||
return (_jsx("div", { ref: transitionRef, className: clsx(s.tooltipContainer, { [s.hoverTooltip]: hoverBehavior }), onClick: onClickOuter, style: positionVariables, children: _jsxs(TooltipContent, { ref: refs.setFloating, className: classes?.popupContent, onClose: hoverBehavior ? undefined : onClose, children: [children, _jsx("div", { ref: arrowRef, className: clsx(s.arrow, s[arrowSide]), children: _jsx("div", { className: s.arrowInner }) })] }) })); | ||
} |
@@ -1,2 +0,2 @@ | ||
import type { MutableRefObject, PropsWithChildren } from 'react'; | ||
import type { LegacyRef, MutableRefObject, PropsWithChildren } from 'react'; | ||
import type { Placement } from '@floating-ui/react-dom'; | ||
@@ -11,2 +11,3 @@ export declare type TooltipCoords = { | ||
export declare type TooltipProps = PropsWithChildren<{ | ||
transitionRef?: LegacyRef<any> | MutableRefObject<any>; | ||
anchor: TooltipCoords | MutableRefObject<any> | null; | ||
@@ -13,0 +14,0 @@ onClose?: (e: MouseClickEvent) => void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
437968
8006