import React from 'react';
import { classNames } from '../../utilities/css.js';
import styles from './Text.scss.js';

const Text = ({
  alignment,
  as,
  breakWord,
  children,
  color,
  fontWeight,
  id,
  numeric = false,
  truncate = false,
  variant,
  visuallyHidden = false
}) => {
  const Component = as || (visuallyHidden ? 'span' : 'p');
  const className = classNames(styles.root, variant && styles[variant], fontWeight && styles[fontWeight], (alignment || truncate) && styles.block, alignment && styles[alignment], breakWord && styles.break, color && styles[color], numeric && styles.numeric, truncate && styles.truncate, visuallyHidden && styles.visuallyHidden);
  return /*#__PURE__*/React.createElement(Component, Object.assign({
    className: className
  }, id && {
    id
  }), children);
};

export { Text };
