"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __assign = (this && this.__assign) || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
            t[p] = s[p];
    }
    return t;
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
            t[p[i]] = s[p[i]];
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var recompose_1 = require("recompose");
var styled_components_1 = require("styled-components");
var asRendition_1 = require("../asRendition");
var theme_1 = require("../theme");
var utils_1 = require("../utils");
var Base = utils_1.withProps()(styled_components_1.default.select)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  border-radius: ", ";\n  height: ", ";\n  font-size: inherit;\n  border: 1px solid ", ";\n  padding-top: 0px;\n  padding-bottom: 0px;\n  padding-left: 16px;\n  padding-right: ", ";\n  background-color: white;\n  appearance: none;\n  width: 100%;\n  min-width: 90px;\n\n  &:hover {\n    box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);\n  }\n"], ["\n  border-radius: ", ";\n  height: ",
    ";\n  font-size: inherit;\n  border: 1px solid ", ";\n  padding-top: 0px;\n  padding-bottom: 0px;\n  padding-left: 16px;\n  padding-right: ",
    ";\n  background-color: white;\n  appearance: none;\n  width: 100%;\n  min-width: 90px;\n\n  &:hover {\n    box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);\n  }\n"])), utils_1.px(theme_1.radius), function (props) {
    return utils_1.px(props.emphasized ? props.theme.space[5] : props.theme.space[4]);
}, function (props) { return props.theme.colors.gray.main; }, function (props) {
    return utils_1.px(props.emphasized ? props.theme.space[5] : props.theme.space[4]);
});
var Wrapper = utils_1.withProps()(styled_components_1.default.span)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: inline-block;\n\tposition: relative;\n\n\t&::after {\n\t\tcontent: \"\";\n\t\twidth: 0;\n\t\theight: 0;\n\t\tborder-left: 4px solid transparent;\n\t\tborder-right: 4px solid transparent;\n\t\tborder-top: 5px solid ", ";\n\n\t\tposition: absolute;\n\t\tright: 16px;\n\t\ttop: ", ";\n\t}\n"], ["\n\tdisplay: inline-block;\n\tposition: relative;\n\n\t&::after {\n\t\tcontent: \"\";\n\t\twidth: 0;\n\t\theight: 0;\n\t\tborder-left: 4px solid transparent;\n\t\tborder-right: 4px solid transparent;\n\t\tborder-top: 5px solid ", ";\n\n\t\tposition: absolute;\n\t\tright: 16px;\n\t\ttop: ", ";\n\t}\n"])), function (props) { return props.theme.colors.gray.dark; }, function (props) { return utils_1.px(props.emphasized ? 20 : 16); });
var Component = function (_a) {
    var children = _a.children, disabled = _a.disabled, emphasized = _a.emphasized, onChange = _a.onChange, value = _a.value, props = __rest(_a, ["children", "disabled", "emphasized", "onChange", "value"]);
    return (React.createElement(Wrapper, __assign({ emphasized: emphasized }, props),
        React.createElement(Base, { disabled: disabled, emphasized: emphasized, value: value === null ? undefined : value, onChange: onChange, children: children })));
};
exports.default = recompose_1.compose(styled_components_1.withTheme, asRendition_1.default)(Component);
var templateObject_1, templateObject_2;
