import * as React from 'react';
import TooltipElement from './TooltipElement';
import TooltipTrigger from './TooltipTrigger';
import { TooltipContext } from './useTooltipContext';
import useTooltip from './useTooltip';

var Tooltip = function Tooltip(_ref) {
  var children = _ref.children,
      placement = _ref.placement,
      id = _ref.id,
      size = _ref.size,
      color = _ref.color,
      asLabel = _ref.asLabel,
      _ref$defaultOpen = _ref.defaultOpen,
      defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,
      open = _ref.open,
      onOpenChange = _ref.onOpenChange;
  var tooltip = useTooltip({
    placement: placement,
    customId: id,
    size: size,
    color: color,
    defaultOpen: defaultOpen,
    open: open,
    onOpenChange: onOpenChange,
    asLabel: asLabel
  });
  return /*#__PURE__*/React.createElement(TooltipContext.Provider, {
    value: tooltip
  }, children);
};

Tooltip.Trigger = TooltipTrigger;
Tooltip.Element = TooltipElement;
export default Tooltip;