import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { helper } from '@ember/component/helper';
import { eq } from 'ember-truth-helpers';
import classNames from '../helpers/class-names.js';
import screenReaderOnly from '../modifiers/screen-reader-only.js';
import EuiIcon from './eui-icon.js';
import EuiLoadingSpinner from './eui-loading-spinner.js';

const getIconSize = helper(([titleSize]) => titleSize === 'xs' ? 's' : 'm');
const EuiStepNumber = setComponentTemplate(precompileTemplate(`
  {{#let (getIconSize @titleSize) as |iconSize|}}
    <span
      class={{classNames
        (if @isHollow "euiStepNumber-isHollow")
        componentName="EuiStepNumber"
        type=@status
      }}
      ...attributes
    >
      {{#if (eq @status "complete")}}
        <EuiIcon
          @iconClasses="euiStepNumber__icon"
          @type="check"
          @size={{iconSize}}
        />
      {{else if (eq @status "warning")}}
        <EuiIcon
          @iconClasses="euiStepNumber__icon"
          @type="warning"
          @size={{iconSize}}
        />
      {{else if (eq @status "danger")}}
        <EuiIcon
          @iconClasses="euiStepNumber__icon"
          @type="cross"
          @size={{iconSize}}
        />
      {{else if (eq @status "loading")}}
        <span {{screenReaderOnly}}>{{@stepAriaLabel}}</span>
        <EuiLoadingSpinner
          class="euiStepNumber__loader"
          @size={{if (eq iconSize "s") "l" "xl"}}
        />
      {{else}}
        <span {{screenReaderOnly}}>{{@stepAriaLabel}}</span>
        <span class="euiStepNumber__number" aria-hidden="true">
          {{@number}}
        </span>
      {{/if}}
    </span>
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    getIconSize,
    classNames,
    eq,
    EuiIcon,
    screenReaderOnly,
    EuiLoadingSpinner
  })
}), templateOnly("eui-step-number", "EuiStepNumber"));

export { EuiStepNumber as default };
//# sourceMappingURL=eui-step-number.js.map
