'use strict';

exports.__esModule = true;
exports.title = exports.Preview = exports.button = undefined;
exports.head = head;

var _ramda = require('ramda');

var _ramda2 = _interopRequireDefault(_ramda);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _reactSeeds2 = _interopRequireDefault(_reactSeeds);

var _rgba = require('react-sow/rgba');

var _rgba2 = _interopRequireDefault(_rgba);

var _assets = require('./assets');

var assets = _interopRequireWildcard(_assets);

var _Vanilla = require('./Vanilla');

var Vanilla = _interopRequireWildcard(_Vanilla);

var _render = require('./render');

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 }; }

var buttonTagsToClass = _ramda2.default.converge(_ramda2.default.unapply(_ramda2.default.join(' ')), [_ramda2.default.always('button'), _ramda2.default.cond([[_ramda2.default.has('secondary'), _ramda2.default.always('secondary')], [_ramda2.default.has('disabled'), _ramda2.default.always('disabled')], [_ramda2.default.T, _ramda2.default.always('')]]), _ramda2.default.cond([[_ramda2.default.has('large'), _ramda2.default.always('large')], [_ramda2.default.has('small'), _ramda2.default.always('small')], [_ramda2.default.has('extrasmall'), _ramda2.default.always('tiny')], [_ramda2.default.T, _ramda2.default.always('')]])]);

var button = exports.button = function button(tags, mentions, texts) {
	return _react2.default.createElement(_reactSeeds.Seed, { Component: 'button',
		className: buttonTagsToClass(tags),
		alignSelf: 'center',
		margin: { bottom: '0.5rem' },
		maxWidth: '20em',
		children: texts
	});
};

var elementRendererForTags = Vanilla.extendTagConds([[_ramda2.default.has('button'), _ramda2.default.curry(button)], [_ramda2.default.has('cta'), _ramda2.default.curry(button)]]);

var Preview = exports.Preview = (0, _render.renderTreeUsing)({ elementRendererForTags: elementRendererForTags });

var title = exports.title = 'Foundation';

function head() {
	return [_react2.default.createElement('link', { rel: 'stylesheet', type: 'text/css',
		href: 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.3/foundation-flex.min.css'
	}), _react2.default.createElement('script', {
		src: 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.3/foundation.min.js'
	})];
}