/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "isDisabled", "viewType"];
import "./index.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { forwardRef } from 'react';
import { Pressable } from '@atlaskit/primitives/compiled';
var styles = {
  button: "_1e0c1bgi",
  innerContainer: "_1e0c1nu9 _1y1m1u8q _16d9qvcn _k48p1wq8 _19bv12x7 _ca0qv77o _n3tdv77o _u5f312x7 _y3gn18uv _o5721btx _1nmz9jpi",
  enabled: "_syazi7uo _80omtlke _bfhki8nm _irr3plhp _1di61gdz",
  disabled: "_syaz1gmx _80om13gf _bfhkby5v",
  unauthorised: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _13lilb4i _mrkblb4i _ca0qt94y _n3tdt94y _2hwxt94y _k48pi7a9 _irr31q28 _1di612kk"
};
/**
 * Action button has to be a span for the overflow to work correctly
 */
export var ActionButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
  var children = _ref.children,
    isDisabled = _ref.isDisabled,
    _ref$viewType = _ref.viewType,
    viewType = _ref$viewType === void 0 ? 'default' : _ref$viewType,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement(Pressable, _extends({}, props, {
    isDisabled: isDisabled,
    ref: ref
    // We need to reset Pressable fixed font size to allow inline card to inherit the font size
    // from parent component such as paragraph and heading
    ,
    style: {
      font: "inherit"
    },
    xcss: styles.button
  }), /*#__PURE__*/React.createElement("span", {
    tabIndex: isDisabled ? undefined : 0,
    className: ax([styles.innerContainer, isDisabled ? styles.disabled : viewType === 'unauthorised' ? styles.unauthorised : styles.enabled])
  }, children));
});