import _pt from "prop-types";
import React from 'react';
import classNames from 'classnames';
import { t } from '../i18n';
export var Spinner = function Spinner(props) {
  var _props$ariaValuetext;

  var className = classNames('ds-c-spinner', props.size && "ds-c-spinner--".concat(props.size), props.inversed && 'ds-c-spinner--inverse', props.filled && 'ds-c-spinner--filled', props.className);
  return /*#__PURE__*/React.createElement("span", {
    className: className,
    role: props.role
  }, /*#__PURE__*/React.createElement("span", {
    className: "ds-u-visibility--screen-reader"
  }, (_props$ariaValuetext = props['aria-valuetext']) !== null && _props$ariaValuetext !== void 0 ? _props$ariaValuetext : t('spinner.ariaText')));
};
Spinner.propTypes = {
  /**
     * The text announced to screen readers
     */
  'aria-valuetext': _pt.string,

  /**
     * Additional classes to be added to the spinner element.
     * Useful for adding utility classes.
     */
  className: _pt.string,

  /**
     * Applies the inverse theme styling
     */
  inversed: _pt.bool,

  /**
     * Adds a background behind the spinner for extra contrast
     */
  filled: _pt.bool,

  /**
     * Landmark role so the spinner can receive keyboard focus
     */
  role: _pt.string,

  /**
     * Smaller or larger variant
     */
  size: _pt.oneOf(['small', 'big'])
};
Spinner.defaultProps = {
  role: 'status'
};
export default Spinner;