infinity-ui-elements 1.15.0 → 1.15.2

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/dist/index.js CHANGED
@@ -5336,7 +5336,6 @@ var Arrow2 = HoverCardArrow;
5336
5336
 
5337
5337
  const tooltipVariants = classVarianceAuthority.cva("z-[9998] bg-popup-fill-intense text-action-ink-on-primary-normal border border-popup-outline-subtle flex flex-col p-4 rounded-xlarge min-w-[200px] max-w-[300px] shadow-[0_4px_20px_rgba(0,0,0,0.15)]");
5338
5338
  const Tooltip = React__namespace.forwardRef(({ children, heading, description, placement = "top", showArrow = true, className, delay = 200, disabled = false, }, ref) => {
5339
- const [open, setOpen] = React__namespace.useState(false);
5340
5339
  const { side, align } = React__namespace.useMemo(() => {
5341
5340
  switch (placement) {
5342
5341
  case "top-start":
@@ -5354,14 +5353,10 @@ const Tooltip = React__namespace.forwardRef(({ children, heading, description, p
5354
5353
  return { side: "top", align: "center" };
5355
5354
  }
5356
5355
  }, [placement]);
5357
- const handleOpenChange = (nextOpen) => {
5358
- if (disabled) {
5359
- setOpen(false);
5360
- return;
5361
- }
5362
- setOpen(nextOpen);
5363
- };
5364
- return (jsxRuntime.jsxs(Root2, { open: disabled ? false : open, onOpenChange: handleOpenChange, openDelay: delay, closeDelay: 100, children: [jsxRuntime.jsx(Trigger, { asChild: true, children: children }), jsxRuntime.jsx(Portal, { children: jsxRuntime.jsxs(Content2, { ref: ref, role: "tooltip", side: side, align: align, sideOffset: 14, collisionPadding: 8, className: cn(tooltipVariants(), className), children: [showArrow && (jsxRuntime.jsx(Arrow2, { width: 12, height: 6, className: "fill-popup-fill-intense" })), jsxRuntime.jsxs("div", { className: "relative flex flex-col gap-2", children: [heading && (jsxRuntime.jsx(Text, { variant: "body", size: "medium", weight: "semibold", color: "onPrimary", children: heading })), jsxRuntime.jsx(Text, { variant: "body", size: "small", weight: "regular", color: "onPrimary", children: description })] })] }) })] }));
5356
+ if (disabled) {
5357
+ return children;
5358
+ }
5359
+ return (jsxRuntime.jsxs(Root2, { openDelay: delay, closeDelay: 250, children: [jsxRuntime.jsx(Trigger, { asChild: true, children: children }), jsxRuntime.jsx(Portal, { children: jsxRuntime.jsxs(Content2, { ref: ref, role: "tooltip", side: side, align: align, sideOffset: 14, collisionPadding: 8, className: cn(tooltipVariants(), className), children: [showArrow && (jsxRuntime.jsx(Arrow2, { width: 12, height: 6, className: "fill-popup-fill-intense" })), jsxRuntime.jsxs("div", { className: "relative flex flex-col gap-2", children: [heading && (jsxRuntime.jsx(Text, { variant: "body", size: "medium", weight: "semibold", color: "onPrimary", children: heading })), typeof description === "string" ? (jsxRuntime.jsx(Text, { variant: "body", size: "small", weight: "regular", color: "onPrimary", children: description })) : (description)] })] }) })] }));
5365
5360
  });
5366
5361
  Tooltip.displayName = "Tooltip";
5367
5362