1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var tslib_1 = require("tslib");
|
4 |
|
5 | var core_1 = require("@emotion/core");
|
6 | var react_1 = tslib_1.__importDefault(require("react"));
|
7 | var constants_1 = require("@kalamazoo/theme/constants");
|
8 | exports.groupItemStyles = {
|
9 | flex: '1 0 auto',
|
10 | display: 'flex',
|
11 |
|
12 | '& + &::before': {
|
13 | content: "''",
|
14 | display: 'inline-block',
|
15 | width: constants_1.gridSize() / 2 + "px",
|
16 | },
|
17 | };
|
18 | var ButtonGroup = (function (_super) {
|
19 | tslib_1.__extends(ButtonGroup, _super);
|
20 | function ButtonGroup() {
|
21 | return _super !== null && _super.apply(this, arguments) || this;
|
22 | }
|
23 | ButtonGroup.prototype.render = function () {
|
24 | var _a = this.props, appearance = _a.appearance, children = _a.children;
|
25 | return (core_1.jsx("div", { css: { display: 'inline-flex' } }, react_1.default.Children.map(children, function (child, idx) {
|
26 | if (!child) {
|
27 | return null;
|
28 | }
|
29 | return (core_1.jsx("div", { key: idx, css: exports.groupItemStyles }, appearance
|
30 | ? react_1.default.cloneElement(child, { appearance: appearance })
|
31 | : child));
|
32 | })));
|
33 | };
|
34 | return ButtonGroup;
|
35 | }(react_1.default.Component));
|
36 | exports.default = ButtonGroup;
|
37 |
|
\ | No newline at end of file |