import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { eq } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import screenReaderOnly from '../modifiers/screen-reader-only.js';

const EuiFormLegend = setComponentTemplate(precompileTemplate(`
  {{#let (argOrDefault @display "visible") as |display|}}
    <legend
      class={{classNames
        (if (eq display "hiddden") "euiFormLengend--isHidden")
        (if @compressed "euiFormLegend--compresed")
        "euiFormLegend"
      }}
      ...attributes
    >
      {{#if (eq display "hidden")}}
        <span {{screenReaderOnly}}>
          {{yield}}
        </span>
      {{else}}
        {{yield}}
      {{/if}}
    </legend>
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    classNames,
    eq,
    screenReaderOnly
  })
}), templateOnly("eui-form-legend", "EuiFormLegend"));

export { EuiFormLegend as default };
//# sourceMappingURL=eui-form-legend.js.map
