import * as i0 from '@angular/core';
import { EventEmitter, inject, booleanAttribute, Output, Input, HostBinding, Component, NgModule } from '@angular/core';
import * as i2 from '@eui/components/eui-icon';
import { EUI_ICON } from '@eui/components/eui-icon';
import * as i1 from '@eui/components/shared';
import { BaseStatesDirective } from '@eui/components/shared';

class EuiIconButtonComponent {
    constructor() {
        this.size = 'm';
        this.ariaLabel = 'eUI Icon button';
        this.tabindex = 0;
        this.hasNoPadding = false;
        this.hasOverflowHover = false;
        this.hasFocusHoverColor = false;
        this.hasFocusHoverBg = true;
        this.euiRounded = false;
        this.euiDisabled = false;
        this.buttonClick = new EventEmitter();
        this.baseStatesDirective = inject(BaseStatesDirective);
    }
    get cssClasses() {
        return [
            this.baseStatesDirective.getCssClasses('eui-icon-button'),
            this.hasNoPadding ? 'eui-icon-button--has-no-padding' : '',
            this.hasOverflowHover ? 'eui-icon-button--has-overflow-hover' : '',
            this.hasFocusHoverColor ? 'eui-icon-button--has-focus-hover-color' : '',
            this.hasFocusHoverBg ? 'eui-icon-button--has-focus-hover-bg' : '',
            this.euiRounded ? 'eui-icon-button--rounded' : '',
            this.euiDisabled ? 'eui-icon-button--disabled' : '',
        ]
            .join(' ')
            .trim();
    }
    onClick(event) {
        this.buttonClick.emit(event);
    }
    ngOnInit() {
        if (this.hasFocusHoverColor) {
            this.hasFocusHoverBg = false;
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.17", type: EuiIconButtonComponent, isStandalone: true, selector: "eui-icon-button", inputs: { icon: "icon", iconUrl: "iconUrl", fillColor: "fillColor", size: "size", ariaLabel: "ariaLabel", tabindex: "tabindex", hasNoPadding: ["hasNoPadding", "hasNoPadding", booleanAttribute], hasOverflowHover: ["hasOverflowHover", "hasOverflowHover", booleanAttribute], hasFocusHoverColor: ["hasFocusHoverColor", "hasFocusHoverColor", booleanAttribute], hasFocusHoverBg: ["hasFocusHoverBg", "hasFocusHoverBg", booleanAttribute], euiRounded: ["euiRounded", "euiRounded", booleanAttribute], euiDisabled: ["euiDisabled", "euiDisabled", booleanAttribute] }, outputs: { buttonClick: "buttonClick" }, host: { properties: { "class": "this.cssClasses" } }, hostDirectives: [{ directive: i1.BaseStatesDirective, inputs: ["euiPrimary", "euiPrimary", "euiSecondary", "euiSecondary", "euiSuccess", "euiSuccess", "euiInfo", "euiInfo", "euiWarning", "euiWarning", "euiDanger", "euiDanger", "euiVariant", "euiVariant"] }], ngImport: i0, template: "<button class=\"eui-icon-button__button\"\n    type=\"button\"\n    (click)=\"onClick($event)\"\n    [attr.aria-label]=\"ariaLabel\"\n    [attr.tabindex]=\"tabindex\">\n    <eui-icon-svg [icon]=\"icon\" [aria-label]=\"ariaLabel\" [iconUrl]=\"iconUrl\" [fillColor]=\"fillColor\" [size]=\"size\" class=\"eui-icon-button__button-icon\">\n        <ng-content select=\"eui-badge\"></ng-content>\n    </eui-icon-svg>\n</button>\n", styles: [".eui-19 :host.eui-icon-button{--_hover-color: var(--eui-c-s-secondary-surface-light-hover);--_color: var(--eui-c-s-secondary)}.eui-19 :host.eui-icon-button--primary{--_hover-color: var(--eui-c-s-primary-surface-light-hover);--_color: var(--eui-c-s-primary)}.eui-19 :host.eui-icon-button--secondary{--_hover-color: var(--eui-c-s-secondary-surface-light-hover);--_color: var(--eui-c-s-secondary)}.eui-19 :host.eui-icon-button--info{--_hover-color: var(--eui-c-s-info-surface-light-hover);--_color: var(--eui-c-s-info)}.eui-19 :host.eui-icon-button--success{--_hover-color: var(--eui-c-s-success-surface-light-hover);--_color: var(--eui-c-s-success)}.eui-19 :host.eui-icon-button--warning{--_hover-color: var(--eui-c-s-warning-surface-light-hover);--_color: var(--eui-c-s-warning)}.eui-19 :host.eui-icon-button--danger{--_hover-color: var(--eui-c-s-danger-surface-light-hover);--_color: var(--eui-c-s-danger)}.eui-19 :host.eui-icon-button{display:inline-flex}.eui-19 :host.eui-icon-button .eui-icon-button__button{background-color:transparent;border:var(--eui-bw-none);cursor:pointer;align-items:center;display:flex;justify-content:center;position:relative;padding:var(--eui-s-xs)}.eui-19 :host.eui-icon-button .eui-icon-button__button:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-icon-button .eui-icon-button__button ::ng-deep .eui-icon-svg svg{fill:var(--_color);color:var(--_color)}.eui-19 :host.eui-icon-button--has-focus-hover-bg .eui-icon-button__button:hover{background-color:var(--_hover-color)}.eui-19 :host.eui-icon-button--has-no-padding .eui-icon-button__button{padding:0}.eui-19 :host.eui-icon-button--has-focus-hover-color .eui-icon-button__button{opacity:var(--eui-o-75)}.eui-19 :host.eui-icon-button--has-focus-hover-color .eui-icon-button__button:hover{opacity:var(--eui-o-100)}.eui-19 :host.eui-icon-button--rounded .eui-icon-button__button{border-radius:var(--eui-br-max)}.eui-19 :host.eui-icon-button--disabled{cursor:not-allowed}.eui-19 :host.eui-icon-button--disabled .eui-icon-button__button{pointer-events:none;background-image:none;box-shadow:none;cursor:not-allowed!important;opacity:var(--eui-o-50)}.eui-19 :host.eui-icon-button--has-overflow-hover{position:relative}.eui-19 :host.eui-icon-button--has-overflow-hover .eui-icon-button__button{padding:0}.eui-19 :host.eui-icon-button--has-overflow-hover:hover:before{background-color:var(--_hover-color);content:\"\";display:block;height:var(--eui-s-3xl);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--eui-s-3xl)}.eui-19 :host.eui-icon-button--rounded.eui-icon-button--has-overflow-hover:hover:before{border-radius:var(--eui-br-max)}\n"], dependencies: [{ kind: "component", type: i2.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiIconButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-icon-button', hostDirectives: [
                        {
                            directive: BaseStatesDirective,
                            inputs: [
                                'euiPrimary',
                                'euiSecondary',
                                'euiSuccess',
                                'euiInfo',
                                'euiWarning',
                                'euiDanger',
                                'euiVariant',
                            ],
                        },
                    ], imports: [...EUI_ICON], template: "<button class=\"eui-icon-button__button\"\n    type=\"button\"\n    (click)=\"onClick($event)\"\n    [attr.aria-label]=\"ariaLabel\"\n    [attr.tabindex]=\"tabindex\">\n    <eui-icon-svg [icon]=\"icon\" [aria-label]=\"ariaLabel\" [iconUrl]=\"iconUrl\" [fillColor]=\"fillColor\" [size]=\"size\" class=\"eui-icon-button__button-icon\">\n        <ng-content select=\"eui-badge\"></ng-content>\n    </eui-icon-svg>\n</button>\n", styles: [".eui-19 :host.eui-icon-button{--_hover-color: var(--eui-c-s-secondary-surface-light-hover);--_color: var(--eui-c-s-secondary)}.eui-19 :host.eui-icon-button--primary{--_hover-color: var(--eui-c-s-primary-surface-light-hover);--_color: var(--eui-c-s-primary)}.eui-19 :host.eui-icon-button--secondary{--_hover-color: var(--eui-c-s-secondary-surface-light-hover);--_color: var(--eui-c-s-secondary)}.eui-19 :host.eui-icon-button--info{--_hover-color: var(--eui-c-s-info-surface-light-hover);--_color: var(--eui-c-s-info)}.eui-19 :host.eui-icon-button--success{--_hover-color: var(--eui-c-s-success-surface-light-hover);--_color: var(--eui-c-s-success)}.eui-19 :host.eui-icon-button--warning{--_hover-color: var(--eui-c-s-warning-surface-light-hover);--_color: var(--eui-c-s-warning)}.eui-19 :host.eui-icon-button--danger{--_hover-color: var(--eui-c-s-danger-surface-light-hover);--_color: var(--eui-c-s-danger)}.eui-19 :host.eui-icon-button{display:inline-flex}.eui-19 :host.eui-icon-button .eui-icon-button__button{background-color:transparent;border:var(--eui-bw-none);cursor:pointer;align-items:center;display:flex;justify-content:center;position:relative;padding:var(--eui-s-xs)}.eui-19 :host.eui-icon-button .eui-icon-button__button:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-icon-button .eui-icon-button__button ::ng-deep .eui-icon-svg svg{fill:var(--_color);color:var(--_color)}.eui-19 :host.eui-icon-button--has-focus-hover-bg .eui-icon-button__button:hover{background-color:var(--_hover-color)}.eui-19 :host.eui-icon-button--has-no-padding .eui-icon-button__button{padding:0}.eui-19 :host.eui-icon-button--has-focus-hover-color .eui-icon-button__button{opacity:var(--eui-o-75)}.eui-19 :host.eui-icon-button--has-focus-hover-color .eui-icon-button__button:hover{opacity:var(--eui-o-100)}.eui-19 :host.eui-icon-button--rounded .eui-icon-button__button{border-radius:var(--eui-br-max)}.eui-19 :host.eui-icon-button--disabled{cursor:not-allowed}.eui-19 :host.eui-icon-button--disabled .eui-icon-button__button{pointer-events:none;background-image:none;box-shadow:none;cursor:not-allowed!important;opacity:var(--eui-o-50)}.eui-19 :host.eui-icon-button--has-overflow-hover{position:relative}.eui-19 :host.eui-icon-button--has-overflow-hover .eui-icon-button__button{padding:0}.eui-19 :host.eui-icon-button--has-overflow-hover:hover:before{background-color:var(--_hover-color);content:\"\";display:block;height:var(--eui-s-3xl);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--eui-s-3xl)}.eui-19 :host.eui-icon-button--rounded.eui-icon-button--has-overflow-hover:hover:before{border-radius:var(--eui-br-max)}\n"] }]
        }], propDecorators: { cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], icon: [{
                type: Input
            }], iconUrl: [{
                type: Input
            }], fillColor: [{
                type: Input
            }], size: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], tabindex: [{
                type: Input
            }], hasNoPadding: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasOverflowHover: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasFocusHoverColor: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasFocusHoverBg: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], euiRounded: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], euiDisabled: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], buttonClick: [{
                type: Output
            }] } });

/**
 * @description
 * Module for the EuiIconButton component.
 *
 * This module provides the EuiIconButtonComponent which is used to create
 * icon buttons with various styles and functionalities.
 *
 * @deprecated Use the {@link EUI_ICON_BUTTON} instead
 */
class EuiIconButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiIconButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiIconButtonModule, imports: [EuiIconButtonComponent], exports: [EuiIconButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiIconButtonModule, imports: [EuiIconButtonComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiIconButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [EuiIconButtonComponent],
                    exports: [EuiIconButtonComponent],
                }]
        }] });

const EUI_ICON_BUTTON = [
    EuiIconButtonComponent,
];
// export { EuiIconButtonComponent as EuiIconButton } from './eui-icon-button.component';

/**
 * Generated bundle index. Do not edit.
 */

export { EUI_ICON_BUTTON, EuiIconButtonComponent, EuiIconButtonModule };
//# sourceMappingURL=eui-components-eui-icon-button.mjs.map
