import { TextInput } from '../text-input/index';
import { tsx, create } from '@dojo/framework/core/vdom';
import { createICacheMiddleware } from '@dojo/framework/core/middleware/icache';
import theme from '../middleware/theme';
import * as textInputCss from '../theme/default/text-input.m.css';
import * as emailInputCss from '../theme/default/email-input.m.css';
const icache = createICacheMiddleware();
const factory = create({ icache, theme })
    .properties()
    .children();
export const EmailInput = factory(function ({ properties, children, middleware: { icache, theme } }) {
    const { get, set } = icache;
    const props = properties();
    return (tsx(TextInput, Object.assign({}, props, { type: 'email', onValidate: (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]));
});
export default EmailInput;

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