'use strict';

var clsx = require('clsx');
var jsxRuntime = require('react/jsx-runtime');
var typography = require('../common/propsValues/typography.js');

const DEFAULT_TYPE = typography.Typography.TITLE_GROUP;
const titleTypeMapping = {
  [typography.Typography.TITLE_SCREEN]: 'h1',
  [typography.Typography.TITLE_SECTION]: 'h2',
  [typography.Typography.TITLE_SUBSECTION]: 'h3',
  [typography.Typography.TITLE_BODY]: 'h4',
  [typography.Typography.TITLE_GROUP]: 'h5'
};
function Title({
  as,
  type = DEFAULT_TYPE,
  className,
  ...props
}) {
  const mapping = titleTypeMapping[type];
  const isTypeSupported = mapping !== undefined;
  if (isTypeSupported) {
    const HeaderTag = as ?? mapping;
    return /*#__PURE__*/jsxRuntime.jsx(HeaderTag, {
      ...props,
      className: clsx.clsx(`np-text-${type}`, className)
    });
  }
  const HeaderTag = as ?? titleTypeMapping[DEFAULT_TYPE];
  return /*#__PURE__*/jsxRuntime.jsx(HeaderTag, {
    ...props,
    className: clsx.clsx(`np-text-${DEFAULT_TYPE}`, className)
  });
}

module.exports = Title;
//# sourceMappingURL=Title.js.map
