import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _defineProperty from "@babel/runtime/helpers/defineProperty";

var _dec, _class, _class2, _temp;

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { style } from 'typestyle';
import withTheme from '@material-ui/core/styles/withTheme';

var getCn = function getCn(props) {
  return {
    root: style({
      display: 'flex',
      alignItems: 'stretch',
      padding: props.padding !== undefined ? props.padding : props.theme.spacing.unit,
      width: '100%',
      boxSizing: 'border-box',
      zIndex: 1000,
      position: ['-webkit-sticky', 'sticky'],
      top: 0,
      backgroundColor: props.theme.palette.background.paper
    })
  };
};

var CardFloatingBar = (_dec = withTheme(), _dec(_class = (_temp = _class2 =
/*#__PURE__*/
function (_PureComponent) {
  _inherits(CardFloatingBar, _PureComponent);

  function CardFloatingBar() {
    _classCallCheck(this, CardFloatingBar);

    return _possibleConstructorReturn(this, _getPrototypeOf(CardFloatingBar).apply(this, arguments));
  }

  _createClass(CardFloatingBar, [{
    key: "render",
    value: function render() {
      var dcn = getCn(this.props);
      return React.createElement("div", {
        className: dcn.root
      }, this.props.children);
    }
  }]);

  return CardFloatingBar;
}(PureComponent), _defineProperty(_class2, "propTypes", {
  children: PropTypes.node,
  padding: PropTypes.number
}), _temp)) || _class);
export { CardFloatingBar as default };