import { clsx } from 'clsx';
import { jsx } from 'react/jsx-runtime';
import { Typography } from '../common/propsValues/typography.mjs';

const DEFAULT_TYPE = Typography.TITLE_GROUP;
const titleTypeMapping = {
  [Typography.TITLE_SCREEN]: 'h1',
  [Typography.TITLE_SECTION]: 'h2',
  [Typography.TITLE_SUBSECTION]: 'h3',
  [Typography.TITLE_BODY]: 'h4',
  [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__*/jsx(HeaderTag, {
      ...props,
      className: clsx(`np-text-${type}`, className)
    });
  }
  const HeaderTag = as ?? titleTypeMapping[DEFAULT_TYPE];
  return /*#__PURE__*/jsx(HeaderTag, {
    ...props,
    className: clsx(`np-text-${DEFAULT_TYPE}`, className)
  });
}

export { Title as default };
//# sourceMappingURL=Title.mjs.map
