'use strict';

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

var clsx = require('clsx');
var React = require('react');
var CloseButton = require('../closeButton/CloseButton.js');
var documentIosClick = require('../domHelpers/documentIosClick.js');
var jsxRuntime = require('react/jsx-runtime');

const BaseCard = /*#__PURE__*/React.forwardRef(({
  className,
  children = null,
  id,
  isDisabled = false,
  isSmall = false,
  onDismiss,
  testId,
  ...props
}, ref) => {
  const closeButtonReference = React.useRef(null);
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
    ref: ref,
    className: clsx.clsx('np-Card', {
      'np-Card--small': !!isSmall,
      'is-disabled': !!isDisabled
    }, className),
    id: id,
    "data-testid": testId,
    ...props,
    children: [onDismiss && /*#__PURE__*/jsxRuntime.jsx(CloseButton.CloseButton, {
      ref: closeButtonReference,
      className: "np-Card-closeButton",
      size: isSmall ? 'sm' : 'md',
      isDisabled: isDisabled,
      testId: "close-button",
      onClick: e => {
        documentIosClick.stopPropagation(e);
        onDismiss();
      }
    }), children]
  });
});
BaseCard.displayName = 'Card';

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