"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var vdom_1 = require("@dojo/framework/core/vdom");
var theme_1 = require("../middleware/theme");
var css = require("../theme/default/text.m.css");
var fixedCss = require("./styles/Text.m.css");
var factory = vdom_1.create({ theme: theme_1.default }).properties();
var Text = factory(function Text(_a) {
    var theme = _a.middleware.theme, properties = _a.properties, children = _a.children;
    var themedCss = theme.classes(css);
    var _b = properties(), _c = _b.as, as = _c === void 0 ? 'p' : _c, _d = _b.truncated, truncated = _d === void 0 ? false : _d, _e = _b.size, size = _e === void 0 ? 'm' : _e, _f = _b.inverse, inverse = _f === void 0 ? false : _f, _g = _b.uppercase, uppercase = _g === void 0 ? false : _g, _h = _b.weight, weight = _h === void 0 ? 'normal' : _h;
    var sizeClass = themedCss.medium;
    switch (size) {
        case 'x-small':
            sizeClass = themedCss.xSmall;
            break;
        case 'small':
            sizeClass = themedCss.small;
            break;
        case 'large':
            sizeClass = themedCss.large;
            break;
        case 'x-large':
            sizeClass = themedCss.xLarge;
            break;
        case 'xx-large':
            sizeClass = themedCss.xxLarge;
            break;
    }
    var weightClass = themedCss.normal;
    switch (weight) {
        case 'light':
            weightClass = themedCss.light;
            break;
        case 'heavy':
            weightClass = themedCss.heavy;
            break;
    }
    return vdom_1.v(as, {
        classes: [
            theme.variant(),
            themedCss.root,
            sizeClass,
            weightClass,
            truncated && fixedCss.truncate,
            inverse && themedCss.inverse,
            themedCss.primary,
            uppercase && fixedCss.uppercase
        ]
    }, children());
});
exports.default = Text;

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