'use strict';

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

var clsx = require('clsx');
var Body = require('../body/Body.js');
require('../common/theme.js');
require('../common/direction.js');
require('../common/propsValues/control.js');
require('../common/propsValues/breakpoint.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/icons');
require('react');
require('react-intl');
require('../common/closeButton/CloseButton.messages.js');
var jsxRuntime = require('react/jsx-runtime');
var Title = require('../title/Title.js');

function Tile({
  'aria-label': ariaLabel,
  className,
  description,
  disabled,
  href,
  target,
  media,
  onClick,
  size = 'md',
  title
}) {
  const isSmall = size === 'sm';
  const Element = href ? 'a' : 'button';
  return /*#__PURE__*/jsxRuntime.jsxs(Element, {
    className: clsx.clsx('decision', 'flex-column', 'np-tile', 'text-no-decoration', 'text-xs-center', className, {
      'p-a-3': !isSmall,
      'p-a-2 np-tile--small': isSmall
    }, disabled && 'disabled'),
    href: href,
    target: target,
    "aria-label": ariaLabel,
    onClick: disabled ? undefined : onClick,
    onKeyDown: disabled ? undefined : ({
      key
    }) => {
      if (key === 'Enter' || key === ' ') {
        onClick?.();
      }
    },
    children: [/*#__PURE__*/jsxRuntime.jsx("div", {
      className: "np-tile__media d-flex justify-content-center",
      children: media
    }), /*#__PURE__*/jsxRuntime.jsx(Title.default, {
      type: typography.Typography.TITLE_SUBSECTION,
      className: clsx.clsx(isSmall ? 'm-t-1' : 'm-t-2'),
      children: title
    }), description ? /*#__PURE__*/jsxRuntime.jsx(Body.default, {
      as: "span",
      type: typography.Typography.BODY_DEFAULT,
      className: "m-t-1",
      children: description
    }) : null]
  });
}

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