'use strict';

exports.__esModule = true;

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactSeeds = require('react-seeds');

var _reactSeeds2 = _interopRequireDefault(_reactSeeds);

var _default = require('react-sow/default');

var _default2 = _interopRequireDefault(_default);

var _colors = require('../colors');

var colors = _interopRequireWildcard(_colors);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

var fontSizeForProps = function fontSizeForProps(props) {
	return props.huge ? 21 : props.small ? 14 : 16;
};

exports.default = function (_ref) {
	var huge = _ref.huge,
	    small = _ref.small,
	    selected = _ref.selected,
	    _ref$padding = _ref.padding,
	    padding = _ref$padding === undefined ? 0 : _ref$padding,
	    _ref$styler = _ref.styler,
	    styler = _ref$styler === undefined ? _default2.default : _ref$styler,
	    props = _objectWithoutProperties(_ref, ['huge', 'small', 'selected', 'padding', 'styler']);

	return _react2.default.createElement(_reactSeeds.Seed, _extends({ Component: 'button'
	}, props, {
		padding: padding,
		font: { size: fontSizeForProps({ huge: huge, small: small }) },
		text: { color: selected ? colors.light : colors.dark },
		background: { color: selected ? colors.dark : colors.light },
		border: 'none',
		cornerRadius: 0
	}, styler({ selected: selected }), {
		styler: styler
	}));
};

module.exports = exports['default'];