'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var clsx = require('clsx');
var neptuneTokens = require('@transferwise/neptune-tokens');
var Body = require('../body/Body.js');
require('../common/theme.js');
require('../common/direction.js');
var control = require('../common/propsValues/control.js');
require('../common/propsValues/size.js');
var typography = require('../common/propsValues/typography.js');
require('../common/propsValues/width.js');
require('../common/propsValues/type.js');
require('../common/propsValues/dateMode.js');
require('../common/propsValues/monthFormat.js');
require('../common/propsValues/position.js');
require('../common/propsValues/layouts.js');
require('../common/propsValues/status.js');
require('../common/propsValues/sentiment.js');
require('../common/propsValues/profileType.js');
require('../common/propsValues/variant.js');
require('../common/propsValues/scroll.js');
require('../common/propsValues/markdownNodeType.js');
require('../common/fileType.js');
require('@transferwise/formatting');
require('@transferwise/icons');
require('react');
require('react-intl');
require('../common/closeButton/CloseButton.messages.js');
var jsxRuntime = require('react/jsx-runtime');
var IconButton = require('../iconButton/IconButton.js');
var useMedia = require('../common/hooks/useMedia.js');

const CircularButton = ({
  className,
  children,
  disabled,
  icon,
  onClick,
  priority = control.Priority.PRIMARY,
  type = 'default'
}) => {
  const isTinyViewport = useMedia.useMedia(`(max-width: ${neptuneTokens.Breakpoint.EXTRA_SMALL}px)`);
  return /*#__PURE__*/jsxRuntime.jsxs("label", {
    className: clsx.clsx('np-circular-btn', `np-circular-btn-${priority}-${type}`, {
      'np-circular-btn-disabled': disabled
    }, className),
    children: [/*#__PURE__*/jsxRuntime.jsx(IconButton.default, {
      size: isTinyViewport ? 32 : 56,
      priority: priority,
      type: ['accent', 'positive'].includes(type) ? 'default' : type,
      className: clsx.clsx('m-b-1'),
      disabled: disabled,
      onClick: onClick,
      children: icon
    }), /*#__PURE__*/jsxRuntime.jsx(Body.default, {
      as: "span",
      className: clsx.clsx('np-circular-btn-label', {
        disabled
      }),
      type: typography.Typography.BODY_DEFAULT_BOLD,
      children: children
    })]
  });
};

exports.default = CircularButton;
//# sourceMappingURL=CircularButton.js.map
