'use strict';

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

var React = require('react');
var PrimitiveButton = require('../primitives/PrimitiveButton/PrimitiveButton.js');
var PrimitiveAnchor = require('../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
var Circle = require('../common/circle/Circle.js');
var clsx = require('clsx');
var jsxRuntime = require('react/jsx-runtime');

const IconButton = /*#__PURE__*/React.forwardRef(function IconButton({
  size = 48,
  href = '#',
  children,
  className,
  priority = 'primary',
  type = 'default',
  ...props
}, ref) {
  const isLink = href !== '#';
  return (
    /*#__PURE__*/
    // @ts-expect-error it's either link or `button` element so it has `onClick` / `href`
    jsxRuntime.jsx(Circle.default, {
      ref: ref,
      as: isLink ? PrimitiveAnchor.default : PrimitiveButton.default,
      size: size,
      fixedSize: true,
      className: clsx.clsx('np-icon-button', `np-icon-button-${priority}-${type}`, {
        disabled: props.disabled
      }, className),
      ...(isLink ? {
        href
      } : {}),
      ...props,
      children: children
    })
  );
});

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