"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "HoverButton", {
    enumerable: true,
    get: function() {
        return HoverButton;
    }
});
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
var _define_property = require("@swc/helpers/_/_define_property");
var _object_spread = require("@swc/helpers/_/_object_spread");
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
var _components = require("@tarojs/components");
var _typings = require("../../utils/typings");
var _index = require("../configprovider/index");
var _index1 = /*#__PURE__*/ _interop_require_default._(require("../hoverbuttonitem/index"));
var _index2 = /*#__PURE__*/ _interop_require_default._(require("../safearea/index"));
var _pxtransform = require("../../utils/taro/px-transform");
var _utils = require("./utils");
var defaultProps = (0, _object_spread._)({}, _typings.ComponentDefaults);
var classPrefix = 'nut-hoverbutton';
var HoverButton = function HoverButton(props) {
    var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), children = _$_object_spread.children, zIndex = _$_object_spread.zIndex, tabbarHeight = _$_object_spread.tabbarHeight, className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick;
    var rtl = (0, _index.useRtl)();
    var baseStyle = (0, _object_spread._)({}, style);
    if (tabbarHeight) {
        baseStyle.bottom = (0, _pxtransform.pxTransform)(tabbarHeight + _utils.UI_BOTTOM_DISTANCE);
    }
    if (typeof zIndex !== 'undefined') {
        baseStyle.zIndex = zIndex;
    }
    return /*#__PURE__*/ _react.default.createElement(_components.View, {
        className: (0, _classnames.default)([
            "".concat(classPrefix, "-container"),
            className
        ], (0, _define_property._)({}, "".concat(classPrefix, "-container-rtl"), rtl)),
        style: baseStyle
    }, /*#__PURE__*/ _react.default.createElement(_components.View, {
        className: classPrefix
    }, children || icon && /*#__PURE__*/ _react.default.createElement(_index1.default, {
        icon: icon,
        onClick: onClick
    })), /*#__PURE__*/ _react.default.createElement(_index2.default, {
        position: "bottom"
    }));
};
HoverButton.displayName = 'NutHoverButton';
HoverButton.Item = _index1.default;
