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 classNames from '../helpers/class-names.js';

const EuiFormLabel = setComponentTemplate(precompileTemplate(`
  {{#let
    (classNames
      (if @isFocused "euiFormLabel-isFocused")
      (if @isInvalid "euiFormLabel-isInvalid")
      "euiFormLabel"
    )
    as |classes|
  }}
    {{#if (eq @type "legend")}}
      <legend class={{classes}} for={{@for}} ...attributes>
        {{@label}}
        {{yield}}
      </legend>
    {{else}}
      <label class={{classes}} for={{@for}} ...attributes>
        {{@label}}
        {{yield}}
      </label>
    {{/if}}
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    classNames,
    eq
  })
}), templateOnly("eui-form-label", "EuiFormLabel"));

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