'use strict';
'use client';
import { jsx, jsxs } from 'react/jsx-runtime';
import React from 'react';
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
import { cn } from '../../../fd-toolbox/lib/utils.js';
import { alignPositions, wellKnownPositions } from '../../../base-repo/constants/tools-constants.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
function Tooltip({
  children,
  content,
  key,
  delayDuration,
  skipDelayDuration,
  side,
  sideOffset,
  align,
  className,
  disabled,
  arrow
}) {
  return /* @__PURE__ */jsx(Tooltip$1.Provider, {
    delay: delayDuration ?? 350,
    timeout: skipDelayDuration ?? 0,
    children: /* @__PURE__ */jsxs(Tooltip$1.Root, {
      children: [/* @__PURE__ */jsx(Tooltip$1.Trigger, {
        disabled,
        render: React.isValidElement(children) ? children : /* @__PURE__ */jsx("span", {
          children
        })
      }), /* @__PURE__ */jsx(Tooltip$1.Portal, {
        children: /* @__PURE__ */jsx(Tooltip$1.Positioner, {
          side: side ?? wellKnownPositions.top,
          sideOffset: sideOffset ?? 4,
          align: align ?? alignPositions.center,
          className: "z-50",
          children: /* @__PURE__ */jsxs(Tooltip$1.Popup, {
            className: cn("bg-fd-tertiary-900 text-primary-foreground shadow-fd-tertiary-600 z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs shadow-md", "animate-in fade-in-0 zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", "transition-all duration-200 ease-in-out", "dark:bg-primary dark:shadow-none", className),
            children: [arrow && /* @__PURE__ */jsx(Tooltip$1.Arrow, {
              className: "fill-fd-tertiary-900 z-50"
            }), content]
          })
        })
      })]
    })
  }, key);
}
__name(Tooltip, "Tooltip");
Tooltip.displayName = "Tooltip";

export { Tooltip };
