@trackunit/react-components 0.1.412 → 0.1.414
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/index.cjs.js
CHANGED
|
@@ -3673,7 +3673,7 @@ const PopoverTrigger = React.forwardRef(function PopoverTrigger({ children, rend
|
|
|
3673
3673
|
}
|
|
3674
3674
|
});
|
|
3675
3675
|
|
|
3676
|
-
const
|
|
3676
|
+
const cvaTooltipFlexContainer = cssClassVarianceUtilities.cvaMerge(["inline-flex"]);
|
|
3677
3677
|
const cvaTooltipIcon = cssClassVarianceUtilities.cvaMerge(["flex", "h-max", "w-fit", "text-slate-300", "transition", "hover:cursor-pointer", "hover:text-slate-400"], {
|
|
3678
3678
|
variants: {
|
|
3679
3679
|
color: {
|
|
@@ -3696,11 +3696,11 @@ const cvaTooltipPopoverTail = cssClassVarianceUtilities.cvaMerge("", {
|
|
|
3696
3696
|
"bottom-start": "bottom-full left-[5%]",
|
|
3697
3697
|
"bottom-end": "bottom-full right-[5%]",
|
|
3698
3698
|
left: "left-full top-2/4 mt-[-6px]",
|
|
3699
|
-
"left-start": "top-[8%]",
|
|
3700
|
-
"left-end": "bottom-[8%]",
|
|
3699
|
+
"left-start": "top-1/4 top-[8%]",
|
|
3700
|
+
"left-end": "bottom-1/4 bottom-[8%]",
|
|
3701
3701
|
right: "right-full top-2/4 mt-[-6px] ",
|
|
3702
|
-
"right-start": "top-[8%]",
|
|
3703
|
-
"right-end": "bottom-[8%]",
|
|
3702
|
+
"right-start": "top-1/4 top-[8%]",
|
|
3703
|
+
"right-end": "bottom-1/4 bottom-[8%]",
|
|
3704
3704
|
},
|
|
3705
3705
|
mode: {
|
|
3706
3706
|
light: "fill-white",
|
|
@@ -3757,10 +3757,13 @@ const Tooltip = ({ children, dataTestId = "tool-tip", disabled, className, label
|
|
|
3757
3757
|
whileElementsMounted: react.autoUpdate,
|
|
3758
3758
|
});
|
|
3759
3759
|
const { isMounted } = react.useTransitionStatus(context);
|
|
3760
|
+
// Please don't try to move this into the component body directly
|
|
3761
|
+
// I tried and it caused infinite re-renders some places (for whatever reason)
|
|
3762
|
+
const wrappedChildren = (jsxRuntime.jsx("div", { className: cvaTooltipFlexContainer({ className }), "data-testid": dataTestId ? `${dataTestId}-parent` : undefined, children: children }));
|
|
3760
3763
|
if (disabled) {
|
|
3761
|
-
return
|
|
3764
|
+
return wrappedChildren;
|
|
3762
3765
|
}
|
|
3763
|
-
return (jsxRuntime.jsxs(Popover, { activation: { hover: true }, className: cvaTooltipPopover(), dataTestId: dataTestId, id: id, placement: placement === "auto" ? "bottom" : placement, children: [jsxRuntime.jsx(PopoverTrigger, { className: cvaTooltipIcon({ color: mode, className }), "data-testid": dataTestId ? `${dataTestId}-trigger` : null, onMouseEnter: () => setIsOpen(true), onMouseLeave: () => setIsOpen(false), ref: refs.setReference, children: children === undefined ? (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Icon, { dataTestId: dataTestId ? `${dataTestId}-icon` : undefined, name: "QuestionMarkCircle", size: "small", ...iconProps }) })) : (
|
|
3766
|
+
return (jsxRuntime.jsxs(Popover, { activation: { hover: true }, className: cvaTooltipPopover(), dataTestId: dataTestId, id: id, placement: placement === "auto" ? "bottom" : placement, children: [jsxRuntime.jsx(PopoverTrigger, { className: cvaTooltipIcon({ color: mode, className }), "data-testid": dataTestId ? `${dataTestId}-trigger` : null, onMouseEnter: () => setIsOpen(true), onMouseLeave: () => setIsOpen(false), ref: refs.setReference, children: children === undefined ? (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Icon, { dataTestId: dataTestId ? `${dataTestId}-icon` : undefined, name: "QuestionMarkCircle", size: "small", ...iconProps }) })) : (wrappedChildren) }), isMounted ? (jsxRuntime.jsx("div", { ref: refs.setFloating, style: floatingStyles, children: jsxRuntime.jsx(PopoverContent, { children: jsxRuntime.jsxs("div", { "aria-label": typeof label === "string" ? label : undefined, className: cvaTooltipPopoverContent({ color: mode }), "data-testid": `${dataTestId}-content`, children: [jsxRuntime.jsx(Text, { inverted: mode === "dark", type: typeof label === "string" ? "p" : "span", children: label }), placement !== "auto" && jsxRuntime.jsx(FloatingArrowContainer, { arrowRef: arrowRef, mode: mode })] }) }) })) : null] }));
|
|
3764
3767
|
};
|
|
3765
3768
|
|
|
3766
3769
|
const cvaIndicator = cssClassVarianceUtilities.cvaMerge(["flex", "items-center"]);
|
package/index.esm.js
CHANGED
|
@@ -3653,7 +3653,7 @@ const PopoverTrigger = forwardRef(function PopoverTrigger({ children, renderButt
|
|
|
3653
3653
|
}
|
|
3654
3654
|
});
|
|
3655
3655
|
|
|
3656
|
-
const
|
|
3656
|
+
const cvaTooltipFlexContainer = cvaMerge(["inline-flex"]);
|
|
3657
3657
|
const cvaTooltipIcon = cvaMerge(["flex", "h-max", "w-fit", "text-slate-300", "transition", "hover:cursor-pointer", "hover:text-slate-400"], {
|
|
3658
3658
|
variants: {
|
|
3659
3659
|
color: {
|
|
@@ -3676,11 +3676,11 @@ const cvaTooltipPopoverTail = cvaMerge("", {
|
|
|
3676
3676
|
"bottom-start": "bottom-full left-[5%]",
|
|
3677
3677
|
"bottom-end": "bottom-full right-[5%]",
|
|
3678
3678
|
left: "left-full top-2/4 mt-[-6px]",
|
|
3679
|
-
"left-start": "top-[8%]",
|
|
3680
|
-
"left-end": "bottom-[8%]",
|
|
3679
|
+
"left-start": "top-1/4 top-[8%]",
|
|
3680
|
+
"left-end": "bottom-1/4 bottom-[8%]",
|
|
3681
3681
|
right: "right-full top-2/4 mt-[-6px] ",
|
|
3682
|
-
"right-start": "top-[8%]",
|
|
3683
|
-
"right-end": "bottom-[8%]",
|
|
3682
|
+
"right-start": "top-1/4 top-[8%]",
|
|
3683
|
+
"right-end": "bottom-1/4 bottom-[8%]",
|
|
3684
3684
|
},
|
|
3685
3685
|
mode: {
|
|
3686
3686
|
light: "fill-white",
|
|
@@ -3737,10 +3737,13 @@ const Tooltip = ({ children, dataTestId = "tool-tip", disabled, className, label
|
|
|
3737
3737
|
whileElementsMounted: autoUpdate,
|
|
3738
3738
|
});
|
|
3739
3739
|
const { isMounted } = useTransitionStatus(context);
|
|
3740
|
+
// Please don't try to move this into the component body directly
|
|
3741
|
+
// I tried and it caused infinite re-renders some places (for whatever reason)
|
|
3742
|
+
const wrappedChildren = (jsx("div", { className: cvaTooltipFlexContainer({ className }), "data-testid": dataTestId ? `${dataTestId}-parent` : undefined, children: children }));
|
|
3740
3743
|
if (disabled) {
|
|
3741
|
-
return
|
|
3744
|
+
return wrappedChildren;
|
|
3742
3745
|
}
|
|
3743
|
-
return (jsxs(Popover, { activation: { hover: true }, className: cvaTooltipPopover(), dataTestId: dataTestId, id: id, placement: placement === "auto" ? "bottom" : placement, children: [jsx(PopoverTrigger, { className: cvaTooltipIcon({ color: mode, className }), "data-testid": dataTestId ? `${dataTestId}-trigger` : null, onMouseEnter: () => setIsOpen(true), onMouseLeave: () => setIsOpen(false), ref: refs.setReference, children: children === undefined ? (jsx("div", { children: jsx(Icon, { dataTestId: dataTestId ? `${dataTestId}-icon` : undefined, name: "QuestionMarkCircle", size: "small", ...iconProps }) })) : (
|
|
3746
|
+
return (jsxs(Popover, { activation: { hover: true }, className: cvaTooltipPopover(), dataTestId: dataTestId, id: id, placement: placement === "auto" ? "bottom" : placement, children: [jsx(PopoverTrigger, { className: cvaTooltipIcon({ color: mode, className }), "data-testid": dataTestId ? `${dataTestId}-trigger` : null, onMouseEnter: () => setIsOpen(true), onMouseLeave: () => setIsOpen(false), ref: refs.setReference, children: children === undefined ? (jsx("div", { children: jsx(Icon, { dataTestId: dataTestId ? `${dataTestId}-icon` : undefined, name: "QuestionMarkCircle", size: "small", ...iconProps }) })) : (wrappedChildren) }), isMounted ? (jsx("div", { ref: refs.setFloating, style: floatingStyles, children: jsx(PopoverContent, { children: jsxs("div", { "aria-label": typeof label === "string" ? label : undefined, className: cvaTooltipPopoverContent({ color: mode }), "data-testid": `${dataTestId}-content`, children: [jsx(Text, { inverted: mode === "dark", type: typeof label === "string" ? "p" : "span", children: label }), placement !== "auto" && jsx(FloatingArrowContainer, { arrowRef: arrowRef, mode: mode })] }) }) })) : null] }));
|
|
3744
3747
|
};
|
|
3745
3748
|
|
|
3746
3749
|
const cvaIndicator = cvaMerge(["flex", "items-center"]);
|
package/package.json
CHANGED
|
@@ -42,4 +42,4 @@ export interface TooltipProps extends CommonProps {
|
|
|
42
42
|
* @param {TooltipProps} props - The props for the Tooltip component
|
|
43
43
|
* @returns {JSX.Element} Tooltip component
|
|
44
44
|
*/
|
|
45
|
-
export declare const Tooltip: ({ children, dataTestId, disabled, className, label, placement, mode, iconProps, id, }: TooltipProps) =>
|
|
45
|
+
export declare const Tooltip: ({ children, dataTestId, disabled, className, label, placement, mode, iconProps, id, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const cvaTooltipFlexContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
2
2
|
export declare const cvaTooltipIcon: (props?: ({
|
|
3
3
|
color?: "light" | "dark" | null | undefined;
|
|
4
4
|
defaultVariants?: "color" | null | undefined;
|