import * as i0 from '@angular/core';
import { booleanAttribute, Input, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';

/**
 * A layout component that positions button elements relative to input fields.
 * Enables the creation of input groups with leading or trailing action buttons,
 * commonly used for search inputs, password visibility toggles, or clear actions.
 *
 * @usageNotes
 * ### Button at end of input (default)
 * ```html
 * <eui-input-button>
 *   <input euiInputText placeholder="Search..." />
 *   <button euiButton euiPrimary>Search</button>
 * </eui-input-button>
 * ```
 *
 * ### Button at start of input
 * ```html
 * <eui-input-button [euiButtonPositionStart]="true">
 *   <button euiIconButton icon="filter" ariaLabel="Filter"></button>
 *   <input euiInputText placeholder="Filter results..." />
 * </eui-input-button>
 * ```
 *
 * ### Accessibility
 * - Button and input maintain separate focus states
 * - Ensure button has descriptive label or aria-label
 * - Tab order follows visual layout
 *
 * ### Notes
 * - Default position is end (right in LTR)
 * - When `euiButtonPositionStart` is true, it overrides end positioning
 * - Works with all button variants (euiButton, euiIconButton)
 * - Commonly used for search, clear, and submit actions
 */
class EuiInputButtonComponent {
    constructor() {
        /**
         * Positions the button at the start (left in LTR, right in RTL) of the input field.
         * When true, overrides euiButtonPositionEnd. Defaults to false.
         */
        this.euiButtonPositionStart = false;
        /**
         * Positions the button at the end (right in LTR, left in RTL) of the input field.
         * Ignored when euiButtonPositionStart is true. Defaults to true.
         */
        this.euiButtonPositionEnd = true;
    }
    get cssClasses() {
        return [
            'eui-input-button',
            this.euiButtonPositionEnd && !this.euiButtonPositionStart ? 'eui-input-button--end' : '',
            this.euiButtonPositionStart ? 'eui-input-button--start' : '',
        ]
            .join(' ')
            .trim();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: EuiInputButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.2.16", type: EuiInputButtonComponent, isStandalone: true, selector: "eui-input-button", inputs: { euiButtonPositionStart: ["euiButtonPositionStart", "euiButtonPositionStart", booleanAttribute], euiButtonPositionEnd: ["euiButtonPositionEnd", "euiButtonPositionEnd", booleanAttribute] }, host: { properties: { "class": "this.cssClasses" } }, ngImport: i0, template: "<ng-content />\n<ng-content select=\"button\"/>", styles: [".eui-21 :host{display:flex;width:100%;border-radius:var(--eui-br-s)}.eui-21 :host ::ng-deep .eui-button{border:1px solid var(--eui-c-secondary-border);background-color:var(--eui-c-surface-container);position:relative}.eui-21 :host.eui-input-button--start{flex-direction:row-reverse}.eui-21 :host.eui-input-button--start ::ng-deep .eui-button{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.eui-21 :host.eui-input-button--start ::ng-deep .eui-button:after{background-color:var(--eui-c-secondary-border);content:\"\";display:block;height:1.75rem;right:-1px;position:absolute;top:var(--eui-s-2xs);width:1px}.eui-21 :host.eui-input-button--start ::ng-deep .eui-input-text{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.eui-21 :host.eui-input-button--end ::ng-deep .eui-button{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.eui-21 :host.eui-input-button--end ::ng-deep .eui-button:before{background-color:var(--eui-c-secondary-border);content:\"\";display:block;height:1.75rem;left:-1px;position:absolute;top:var(--eui-s-2xs);width:1px}.eui-21 :host.eui-input-button--end ::ng-deep .eui-input-text{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: EuiInputButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-input-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n<ng-content select=\"button\"/>", styles: [".eui-21 :host{display:flex;width:100%;border-radius:var(--eui-br-s)}.eui-21 :host ::ng-deep .eui-button{border:1px solid var(--eui-c-secondary-border);background-color:var(--eui-c-surface-container);position:relative}.eui-21 :host.eui-input-button--start{flex-direction:row-reverse}.eui-21 :host.eui-input-button--start ::ng-deep .eui-button{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.eui-21 :host.eui-input-button--start ::ng-deep .eui-button:after{background-color:var(--eui-c-secondary-border);content:\"\";display:block;height:1.75rem;right:-1px;position:absolute;top:var(--eui-s-2xs);width:1px}.eui-21 :host.eui-input-button--start ::ng-deep .eui-input-text{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.eui-21 :host.eui-input-button--end ::ng-deep .eui-button{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.eui-21 :host.eui-input-button--end ::ng-deep .eui-button:before{background-color:var(--eui-c-secondary-border);content:\"\";display:block;height:1.75rem;left:-1px;position:absolute;top:var(--eui-s-2xs);width:1px}.eui-21 :host.eui-input-button--end ::ng-deep .eui-input-text{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}\n"] }]
        }], propDecorators: { cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], euiButtonPositionStart: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], euiButtonPositionEnd: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }] } });

const EUI_INPUT_BUTTON = [
    EuiInputButtonComponent,
];

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

export { EUI_INPUT_BUTTON, EuiInputButtonComponent };
//# sourceMappingURL=eui-components-eui-input-button.mjs.map
