{"version":3,"file":"eui-components-eui-button.mjs","sources":["../../eui-button/eui-button.component.ts","../../eui-button/eui-button.component.html","../../eui-button/index.ts","../../eui-button/eui-components-eui-button.ts"],"sourcesContent":["import {\n    Component,\n    HostBinding,\n    HostListener,\n    Input,\n    Output,\n    EventEmitter,\n    ChangeDetectionStrategy,\n    Renderer2,\n    ElementRef,\n    booleanAttribute,\n    inject,\n} from '@angular/core';\n\nimport { BaseStatesDirective } from '@eui/components/shared';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\n/**\n * @description\n * A versatile button component that supports various states, sizes, and visual styles.\n * It can be used as a native `<button>` or `<a>` element while preserving consistent EUI behavior and styling.\n * \n * @usageNotes\n * #### Basic buttons with variants\n * ```html\n * <button euiButton>Default</button>\n * <button euiButton euiPrimary>Primary</button>\n * <button euiButton euiSecondary>Secondary</button>\n * <button euiButton euiSuccess>Success</button>\n * ```\n *\n * #### Icon button\n * ```html\n * <button euiButton euiIconButton aria-label=\"Notifications\">\n *   <eui-icon-svg icon=\"bell:outline\"></eui-icon-svg>\n * </button>\n * ```\n *\n * #### CTA and block buttons\n * ```html\n * <button euiButton euiCTAButton>Call to Action</button>\n * <button euiButton euiBlockButton>Full Width</button>\n * ```\n *\n * #### Size variants\n * ```html\n * <button euiButton euiSizeS>Small</button>\n * <button euiButton euiSizeM>Medium</button>\n * <button euiButton euiSizeL>Large</button>\n * ```\n *\n * #### Disabled and checked states\n * ```html\n * <button euiButton [euiDisabled]=\"true\">Disabled</button>\n * <button euiButton [isChecked]=\"true\">Checked</button>\n * ```\n *\n * #### As link\n * ```html\n * <a euiButton href=\"/page\">Link Button</a>\n * ```\n *\n * ```ts\n * onButtonClick(button: EuiButtonComponent): void {\n *   console.log('Button clicked:', button);\n * }\n * ```\n *\n * ### Accessibility\n * - Native button/anchor semantics preserved for screen readers\n * - Keyboard accessible with Enter/Space (button) or Enter (link)\n * - euiIconButton requires aria-label for icon-only buttons\n * - Disabled state prevents interaction and is announced to screen readers\n * - Focus ring visible by default (remove with hasNoFocusRing if alternative focus indicator exists)\n * - isChecked state is visually indicated and announced\n *\n * ### Notes\n * - Use on `<button>` or `<a>` elements via euiButton attribute\n * - Color variants: euiPrimary, euiBranding, euiSecondary, euiSuccess, euiInfo, euiWarning, euiDanger, euiInverse\n * - Size variants: euiSizeXS, euiSizeS, euiSizeM (default), euiSizeL\n * - euiBasicButton removes background for minimal styling\n * - euiCTAButton applies prominent call-to-action styling\n * - euiBlockButton makes button full-width\n * - euiIconButton optimizes layout for icon-only content\n * - euiAvatarButton styles for avatar dropdown triggers\n * - euiLineWrap allows multi-line button text\n * - isCompact reduces padding and dimensions\n * - euiOutline applies outline/ghost styling\n * - euiRounded applies rounded corners\n * - euiResponsive adjusts sizing based on viewport\n * - euiStart/euiEnd aligns content within button\n * - buttonClick event emits component instance on click\n */\n@Component({\n    templateUrl: './eui-button.component.html',\n    // eslint-disable-next-line\n    selector: 'button[euiButton], a[euiButton]',\n    styleUrl: './eui-button.scss',\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    hostDirectives: [\n        {\n            directive: BaseStatesDirective,\n            inputs: [\n                'euiPrimary',\n                'euiBranding',\n                'euiSecondary',\n                'euiSuccess',\n                'euiInfo',\n                'euiWarning',\n                'euiDanger',\n                'euiInverse',\n                'euiVariant',\n                'euiSizeXS',\n                'euiSizeS',\n                'euiSizeM',\n                'euiSizeL',\n                'euiSizeVariant',\n                'euiOutline',\n                'euiRounded',\n                'euiResponsive',\n                'euiStart',\n                'euiEnd',\n            ],\n        },\n    ],\n})\nexport class EuiButtonComponent {\n    /**\n     * @description\n     * Computes and returns the CSS classes for the button based on its current state\n     *\n     * @returns {string} Space-separated string of CSS class names\n     */\n    @HostBinding('class')\n    get cssClasses(): string {\n        return [\n            this.baseStatesDirective.getCssClasses('eui-button'),\n            this.euiBasicButton ? 'eui-button--basic eui--basic' : '',\n            this.euiBlockButton ? 'eui-button--block' : '',\n            this.euiIconButton ? 'eui-button--icon-only' : '',\n            this.euiLineWrap ? 'eui-button--line-wrap' : '',\n            this.hasNoFocusRing ? 'eui-button--no-focus-ring': '',\n            this.isCompact ? 'eui-button--compact': '',\n            this.euiCTAButton ? 'eui-button--cta': '',\n            this.euiAvatarButton ? 'eui-button--avatar': '',\n        ]\n            .join(' ')\n            .trim();\n    }\n\n    /**\n     * @description Data attribute for e2e testing\n     * @default eui-button\n     */\n    @HostBinding('attr.data-e2e') @Input() e2eAttr = 'eui-button';\n\n    /** @description ID attribute for the button element */\n    @HostBinding('attr.id')\n    @Input() id: string;\n\n    /**\n     * @description When true, applies basic styling without background\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiBasicButton = false;\n\n    /**\n     * @description When true, styles the button as a call-to-action\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiCTAButton = false;\n\n    /**\n     * @description When true, makes the button full-width\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiBlockButton = false;\n\n    /**\n     * @description When true, styles the button for icon-only content\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiIconButton = false;\n\n    /**\n     * @description When true, style the button when used in avatar trigger (for dropdown trigger f.e. see actionable avatar)\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiAvatarButton = false;\n\n    /**\n     * @description When true, allows text content to wrap\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) euiLineWrap = false;\n\n    /**\n     * @description When true, applies styling with lower padding / reduced height and width\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) isCompact = false;   \n    \n    /**\n     * @description When true, applies styling without focus ring\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) hasNoFocusRing = false;    \n\n    /**\n     * @description\n     * Controls the checked state of the button\n     * When true, applies accent styling\n     */\n    @Input()\n    public get isChecked(): boolean {\n        return this._isChecked;\n    }\n    public set isChecked(value: BooleanInput) {\n        this.baseStatesDirective.euiPrimary = coerceBooleanProperty(value);\n        this.baseStatesDirective.euiOutline = coerceBooleanProperty(!value);\n        this._isChecked = coerceBooleanProperty(value);\n    }\n\n    /**\n     * @description\n     * Controls the disabled state of the button\n     * When true, adds the disabled attribute and prevents interaction\n     */\n    @Input()\n    public get euiDisabled(): boolean {\n        return this._euiDisabled;\n    }\n    public set euiDisabled(value: BooleanInput) {\n        this._euiDisabled = coerceBooleanProperty(value);\n        if (this._euiDisabled) {\n            this._renderer.setAttribute(this._elementRef.nativeElement, 'disabled', 'true');\n        } else {\n            this._renderer.removeAttribute(this._elementRef.nativeElement, 'disabled');\n        }\n    }\n\n    /**\n     * @description\n     * Event emitted when the button is clicked\n     * Emits the button component instance\n     */\n    @Output() buttonClick: EventEmitter<EuiButtonComponent> = new EventEmitter<EuiButtonComponent>();\n\n    public baseStatesDirective: BaseStatesDirective = inject(BaseStatesDirective);\n    protected _renderer: Renderer2 = inject(Renderer2);\n    protected _elementRef: ElementRef<HTMLButtonElement> = inject(ElementRef);\n    private _isChecked = false;\n    private _euiDisabled = false;\n\n    /**\n     * @description\n     * Click event handler that emits the buttonClick event\n     * @private\n     */\n    @HostListener('click')\n    protected onClick(): void {\n        this.buttonClick.emit(this);\n    }\n}\n","<span class=\"eui-button__container\">\n    <ng-content></ng-content>\n</span>\n","import { EuiButtonComponent } from './eui-button.component';\n\nexport * from './eui-button.component';\n\nexport const EUI_BUTTON = [\n    EuiButtonComponent,\n] as const;\n\n// export { EuiButtonComponent as EuiButton } from './eui-button.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EG;MAkCU,kBAAkB,CAAA;AAjC/B,IAAA,WAAA,GAAA;AAyDI;;;AAGG;QACoC,IAAA,CAAA,OAAO,GAAG,YAAY;AAM7D;;;AAGG;QACqC,IAAA,CAAA,cAAc,GAAG,KAAK;AAE9D;;;AAGG;QACqC,IAAA,CAAA,YAAY,GAAG,KA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