"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var index_1 = require("../text-input/index");
var vdom_1 = require("@dojo/framework/core/vdom");
var icache_1 = require("@dojo/framework/core/middleware/icache");
var theme_1 = require("../middleware/theme");
var textInputCss = require("../theme/default/text-input.m.css");
var emailInputCss = require("../theme/default/email-input.m.css");
var icache = icache_1.createICacheMiddleware();
var factory = vdom_1.create({ icache: icache, theme: theme_1.default })
    .properties()
    .children();
exports.EmailInput = factory(function (_a) {
    var properties = _a.properties, children = _a.children, _b = _a.middleware, icache = _b.icache, theme = _b.theme;
    var get = icache.get, set = icache.set;
    var props = properties();
    return (vdom_1.tsx(index_1.TextInput, tslib_1.__assign({}, props, { type: 'email', onValidate: function (valid, message) {
            set('valid', valid);
            set('message', message);
            props.onValidate && props.onValidate(valid, message);
        }, valid: { valid: get('valid'), message: get('message') }, theme: theme.compose(textInputCss, emailInputCss) }), children()[0]));
});
exports.default = exports.EmailInput;

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