/**
 * amis-ui v6.14.0-beta.1
 * Copyright 2018-2025 fex
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var React = require('react');
var amisCore = require('amis-core');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
(__react_jsx__["default"] || __react_jsx__).Fragment;
var Tooltip = /** @class */ (function (_super) {
    tslib.__extends(Tooltip, _super);
    function Tooltip() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Tooltip.prototype.render = function () {
        var _a = this.props; _a.classPrefix; var className = _a.className, tooltipTheme = _a.tooltipTheme, title = _a.title, children = _a.children, arrowProps = _a.arrowProps, style = _a.style; _a.placement; _a.arrowOffsetLeft; _a.arrowOffsetTop; _a.positionLeft; _a.positionTop; var cx = _a.classnames, activePlacement = _a.activePlacement, showArrow = _a.showArrow, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, arrowClassName = _a.arrowClassName, bodyClassName = _a.bodyClassName; _a.componentId; var rest = tslib.__rest(_a, ["classPrefix", "className", "tooltipTheme", "title", "children", "arrowProps", "style", "placement", "arrowOffsetLeft", "arrowOffsetTop", "positionLeft", "positionTop", "classnames", "activePlacement", "showArrow", "onMouseEnter", "onMouseLeave", "arrowClassName", "bodyClassName", "componentId"]);
        return (_J$X_("div", tslib.__assign({}, rest, { className: cx("Tooltip", activePlacement ? "Tooltip--".concat(activePlacement) : '', className, "Tooltip--".concat(tooltipTheme === 'dark' ? 'dark' : 'light')), style: style, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, role: "tooltip" }),
            showArrow ? (_J$X_("div", tslib.__assign({ className: cx(arrowClassName, 'Tooltip-arrow') }, arrowProps))) : null,
            title ? _J$X_("div", { className: cx('Tooltip-title') }, title) : null,
            _J$X_("div", { className: cx(bodyClassName, 'Tooltip-body') }, children)));
    };
    Tooltip.defaultProps = {
        className: '',
        tooltipTheme: 'light',
        showArrow: true
    };
    return Tooltip;
}(React__default["default"].Component));
var Tooltip$1 = amisCore.themeable(Tooltip);

exports.Tooltip = Tooltip;
exports["default"] = Tooltip$1;
