import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
import argOrDefault from '../../helpers/arg-or-default.js';
import classNames from '../../helpers/class-names.js';
import EuiIcon from '../eui-icon.js';
import EuiImage from '../eui-inner-text.js';

const EuiSideNavItemButton = setComponentTemplate(precompileTemplate(`
    {{#let (argOrDefault @truncate true) as |truncate|}}
      <span class="euiSideNavItemButton__content">
        {{#if @icon}}
          <EuiIcon
            @type={{@icon}}
            @size="m"
            class={{classNames "euiSideNavItemButton__icon" @buttonIconClasses}}
          />
        {{/if}}

        <EuiInnerText as |setRef innerText|>
          <span
            class={{classNames
              "euiSideNavItemButton__label"
              (if truncate "euiSideNavItemButton__label--truncated")
            }}
            {{didInsert setRef}}
            title={{if truncate innerText}}
          >
            {{yield}}
          </span>
        </EuiInnerText>
        {{#if @caret}}
          <EuiIcon @type="arrowDown" @color="subdued" @size="s" />
        {{/if}}
      </span>
    {{/let}}
  `, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    EuiIcon,
    classNames,
    EuiInnerText: EuiImage,
    didInsert
  })
}), templateOnly("button", "EuiSideNavItemButton"));

export { EuiSideNavItemButton as default };
//# sourceMappingURL=button.js.map
