"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var vdom_1 = require("@dojo/framework/core/vdom");
var theme_1 = require("../middleware/theme");
var fixedCss = require("./styles/tooltip.m.css");
var css = require("../theme/default/tooltip.m.css");
var util_1 = require("../common/util");
/**
 * @deprecated this enum will be removed in the next major release
 */
var Orientation;
(function (Orientation) {
    Orientation["bottom"] = "bottom";
    Orientation["left"] = "left";
    Orientation["right"] = "right";
    Orientation["top"] = "top";
})(Orientation = exports.Orientation || (exports.Orientation = {}));
var factory = vdom_1.create({ theme: theme_1.default })
    .properties()
    .children();
exports.Tooltip = factory(function Tooltip(_a) {
    var children = _a.children, properties = _a.properties, theme = _a.middleware.theme;
    var _b = properties(), open = _b.open, _c = _b.aria, aria = _c === void 0 ? {} : _c, _d = _b.orientation, orientation = _d === void 0 ? 'right' : _d;
    var classes = theme.classes(css);
    var fixedClasses = theme.classes(fixedCss);
    var _e = tslib_1.__read(children(), 1), _f = _e[0], trigger = _f.trigger, content = _f.content;
    var fixedOrientation;
    var classesOrientation;
    if (orientation === 'bottom') {
        fixedOrientation = fixedClasses.bottomFixed;
        classesOrientation = classes.bottom;
    }
    else if (orientation === 'right') {
        fixedOrientation = fixedClasses.rightFixed;
        classesOrientation = classes.right;
    }
    else if (orientation === 'left') {
        fixedOrientation = fixedClasses.leftFixed;
        classesOrientation = classes.left;
    }
    else if (orientation === 'top') {
        fixedOrientation = fixedClasses.topFixed;
        classesOrientation = classes.top;
    }
    return (vdom_1.tsx("div", { classes: [
            theme.variant(),
            classesOrientation,
            fixedClasses.rootFixed,
            fixedOrientation
        ] },
        vdom_1.tsx("div", { key: "target" },
            trigger,
            open ? (vdom_1.tsx("div", tslib_1.__assign({ key: "content" }, util_1.formatAriaProperties(aria), { classes: [classes.content, fixedClasses.contentFixed] }), content)) : null)));
});
exports.default = exports.Tooltip;

/*# sourceMappingURL=index.js.map*/