UNPKG

2.16 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _templateObject = _taggedTemplateLiteral(['\n position: relative;\n background: ', ';\n margin-top: -2em;\n margin-right: 0;\n margin-bottom: 1em;\n margin-left: -1.25em;\n border-radius: 3px 3px 0px 0px;\n width: calc(100% + 2.5em);\n\n ', ' {\n margin-bottom: ', ';\n margin-left: ', ';\n width: calc(100% + ', ');\n }\n'], ['\n position: relative;\n background: ', ';\n margin-top: -2em;\n margin-right: 0;\n margin-bottom: 1em;\n margin-left: -1.25em;\n border-radius: 3px 3px 0px 0px;\n width: calc(100% + 2.5em);\n\n ', ' {\n margin-bottom: ', ';\n margin-left: ', ';\n width: calc(100% + ', ');\n }\n']);
8
9var _styledComponents = require('styled-components');
10
11var _styledComponents2 = _interopRequireDefault(_styledComponents);
12
13var _react = require('react');
14
15var _react2 = _interopRequireDefault(_react);
16
17var _media = require('../library/media');
18
19function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
21function _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; }
22
23function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
24
25var Container = _styledComponents2.default.div(_templateObject, function (props) {
26 return props.theme.color.canvasDim;
27}, (0, _media.mediaQuery)('wide'), function (props) {
28 return props.large ? '1.875em' : '1em';
29}, function (props) {
30 return props.large ? '-1.875em' : '-1.25em';
31}, function (props) {
32 return props.large ? '3.75em' : '2.5em';
33});
34
35/**
36 * Card Header
37 */
38var CardHeader = function CardHeader(_ref) {
39 var children = _ref.children,
40 other = _objectWithoutProperties(_ref, ['children']);
41
42 return _react2.default.createElement(
43 Container,
44 other,
45 children
46 );
47};
48
49CardHeader.propTypes = {
50 children: _react.PropTypes.node.isRequired
51};
52
53exports.default = CardHeader;
\No newline at end of file