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.
@@ -12,7 +12,7 @@ export interface TooltipProps {
12
12
  /**
13
13
  * Description text for the tooltip
14
14
  */
15
- description: string;
15
+ description: string | React.ReactNode;
16
16
  /**
17
17
  * Placement of the tooltip relative to the trigger
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,eAAe,yFAEpB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EACN,WAAW,GACX,KAAK,GACL,SAAS,GACT,cAAc,GACd,QAAQ,GACR,YAAY,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,OAAO,qFAuFZ,CAAC;AAIF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,eAAe,yFAEpB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EACN,WAAW,GACX,KAAK,GACL,SAAS,GACT,cAAc,GACd,QAAQ,GACR,YAAY,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,OAAO,qFAgFZ,CAAC;AAIF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC"}
package/dist/index.esm.js CHANGED
@@ -5316,7 +5316,6 @@ var Arrow2 = HoverCardArrow;
5316
5316
 
5317
5317
  const tooltipVariants = 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)]");
5318
5318
  const Tooltip = React.forwardRef(({ children, heading, description, placement = "top", showArrow = true, className, delay = 200, disabled = false, }, ref) => {
5319
- const [open, setOpen] = React.useState(false);
5320
5319
  const { side, align } = React.useMemo(() => {
5321
5320
  switch (placement) {
5322
5321
  case "top-start":
@@ -5334,14 +5333,10 @@ const Tooltip = React.forwardRef(({ children, heading, description, placement =
5334
5333
  return { side: "top", align: "center" };
5335
5334
  }
5336
5335
  }, [placement]);
5337
- const handleOpenChange = (nextOpen) => {
5338
- if (disabled) {
5339
- setOpen(false);
5340
- return;
5341
- }
5342
- setOpen(nextOpen);
5343
- };
5344
- return (jsxs(Root2, { open: disabled ? false : open, onOpenChange: handleOpenChange, openDelay: delay, closeDelay: 100, children: [jsx(Trigger, { asChild: true, children: children }), jsx(Portal, { children: jsxs(Content2, { ref: ref, role: "tooltip", side: side, align: align, sideOffset: 14, collisionPadding: 8, className: cn(tooltipVariants(), className), children: [showArrow && (jsx(Arrow2, { width: 12, height: 6, className: "fill-popup-fill-intense" })), jsxs("div", { className: "relative flex flex-col gap-2", children: [heading && (jsx(Text, { variant: "body", size: "medium", weight: "semibold", color: "onPrimary", children: heading })), jsx(Text, { variant: "body", size: "small", weight: "regular", color: "onPrimary", children: description })] })] }) })] }));
5336
+ if (disabled) {
5337
+ return children;
5338
+ }
5339
+ return (jsxs(Root2, { openDelay: delay, closeDelay: 250, children: [jsx(Trigger, { asChild: true, children: children }), jsx(Portal, { children: jsxs(Content2, { ref: ref, role: "tooltip", side: side, align: align, sideOffset: 14, collisionPadding: 8, className: cn(tooltipVariants(), className), children: [showArrow && (jsx(Arrow2, { width: 12, height: 6, className: "fill-popup-fill-intense" })), jsxs("div", { className: "relative flex flex-col gap-2", children: [heading && (jsx(Text, { variant: "body", size: "medium", weight: "semibold", color: "onPrimary", children: heading })), typeof description === "string" ? (jsx(Text, { variant: "body", size: "small", weight: "regular", color: "onPrimary", children: description })) : (description)] })] }) })] }));
5345
5340
  });
5346
5341
  Tooltip.displayName = "Tooltip";
5347
5342