import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { and, not } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import EuiTextAlignComponent from './eui-text-align.js';
import EuiTextColor from './eui-text-color.js';

const EuiTextComponent = setComponentTemplate(precompileTemplate(`
  <div
    class={{classNames
      (unless (argOrDefault @grow true) "euiText--constrainedWidth")
      componentName="EuiText"
      size=(argOrDefault @size "m")
    }}
    ...attributes
  >
    {{#if (and @textAlign @color)}}
      {{#let (component EuiTextAlign) as |Align|}}
        {{#let (component EuiTextColor) as |Color|}}
          <Align @textAlign={{@textAlign}}>
            <Color @color={{@color}} @tagName="div">
              {{yield}}
            </Color>
          </Align>
        {{/let}}
      {{/let}}
    {{else if (and @textAlign (not @color))}}
      {{#let (component EuiTextAlign) as |Align|}}
        <Align @textAlign={{@textAlign}}>
          {{yield}}
        </Align>
      {{/let}}
    {{else if (and (not @textAlign) @color)}}
      {{#let (component EuiTextColor) as |Color|}}
        <Color @color={{@color}} @tagName="div">
          {{yield}}
        </Color>
      {{/let}}
    {{else}}
      {{yield}}
    {{/if}}
  </div>
`, {
  strictMode: true,
  scope: () => ({
    classNames,
    argOrDefault,
    and,
    EuiTextAlign: EuiTextAlignComponent,
    EuiTextColor,
    not
  })
}), templateOnly("eui-text", "EuiTextComponent"));

export { EuiTextComponent as default };
//# sourceMappingURL=eui-text.js.map
