'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.VerticalLine = exports.ClickableRow = exports.onKeyboardClick = exports.Circle = exports.defaultInactiveColor = exports.defaultAlertColor = exports.defaultActiveColor = undefined;

var _react = require('react');

var React = _interopRequireWildcard(_react);

var _layout = require('styled-material/dist/src/layout');

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

var __rest = undefined && undefined.__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;
};
var defaultActiveColor = exports.defaultActiveColor = '#3f51b5';
var defaultAlertColor = exports.defaultAlertColor = '#f44336';
var defaultInactiveColor = exports.defaultInactiveColor = '#bdbdbd';
/**
 * A simple circle, used for step icons and by the dot tracker.
 */
var Circle = exports.Circle = function Circle(_ref) {
    var size = _ref.size,
        color = _ref.color,
        margin = _ref.margin,
        children = _ref.children,
        style = _ref.style;
    return React.createElement("div", { children: children, style: Object.assign({ margin: margin, width: size, height: size, backgroundColor: color, borderRadius: '50%' }, style) });
};
/**
 * A function to filter keyboard events to spacebar and Enter
 */
var onKeyboardClick = exports.onKeyboardClick = function onKeyboardClick(fn) {
    return function (e) {
        if (e.key === ' ' || e.key === 'Enter') {
            return fn(e);
        }
    };
};
/**
 * A flexbox row that is focusable and clickable like a button
 */
var ClickableRow = exports.ClickableRow = function ClickableRow(_a) {
    var onClick = _a.onClick,
        disabled = _a.disabled,
        style = _a.style,
        props = __rest(_a, ["onClick", "disabled", "style"]);

    return React.createElement(_layout.Row, Object.assign({ role: !disabled && 'button', style: Object.assign({ cursor: disabled ? 'default' : 'pointer' }, style), tabIndex: disabled ? -1 : 0, onClick: onClick, onKeyPress: onKeyboardClick(onClick) }, props));
};
/**
 * A simple vertical line, used for constructing the vertical stepper
 */
var VerticalLine = exports.VerticalLine = function VerticalLine() {
    return React.createElement("div", { style: {
            position: 'absolute',
            top: 0,
            left: 36,
            bottom: 16,
            height: '100%',
            width: 1,
            backgroundColor: 'rgba(0, 0, 0, 0.12)'
        } });
};
//# sourceMappingURL=utils.js.map
