{"version":3,"file":"eui-components-eui-icon-button-expander.mjs","sources":["../../eui-icon-button-expander/eui-icon-button-expander.component.ts","../../eui-icon-button-expander/eui-icon-button-expander.component.html","../../eui-icon-button-expander/index.ts","../../eui-icon-button-expander/eui-components-eui-icon-button-expander.ts"],"sourcesContent":["import { Component, HostBinding, Input, Output, EventEmitter, booleanAttribute, ChangeDetectionStrategy } from '@angular/core';\nimport { EUI_ICON } from '@eui/components/eui-icon';\n\n/**\n * A button component that displays an icon indicating expandable/collapsible state, typically used for accordion panels, tree nodes, or disclosure widgets.\n * The icon rotates based on the expanded state and can be oriented in forward or reverse direction.\n *\n * @usageNotes\n * ### Basic expander button\n * ```html\n * <eui-icon-button-expander \n *   [isExpanded]=\"expanded\"\n *   ariaLabel=\"Toggle section\"\n *   (buttonClick)=\"expanded = !expanded\">\n * </eui-icon-button-expander>\n * ```\n *\n * ### Forward direction (horizontal expansion)\n * ```html\n * <eui-icon-button-expander \n *   [isExpanded]=\"sidebarOpen\"\n *   [isDirectionForward]=\"true\"\n *   ariaLabel=\"Toggle sidebar\">\n * </eui-icon-button-expander>\n * ```\n *\n * ### Accessibility\n * - Provide descriptive `ariaLabel` indicating expand/collapse action\n * - Visual rotation clearly indicates state change\n * - Keyboard accessible via Tab and Enter/Space\n *\n * ### Notes\n * - Default direction is downward (for vertical expansion)\n * - Set `isDirectionForward=\"true\"` for horizontal/sidebar expansion\n * - Icon automatically rotates based on `isExpanded` state\n * - Commonly paired with eui-fieldset or custom collapsible sections\n */\n@Component({\n    selector: 'eui-icon-button-expander',\n    templateUrl: './eui-icon-button-expander.component.html',\n    styleUrls: [ './eui-icon-button-expander.component.scss' ],\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    imports: [ ...EUI_ICON ],\n})\nexport class EuiIconButtonExpanderComponent {\n    @HostBinding('class')\n    get cssClasses(): string {\n        return [\n            'eui-icon-button-expander',\n            this.isDirectionForward ? 'eui-icon-button-expander--direction-forward': '',\n        ].join(' ').trim();\n    }\n\n    /**\n     * The fill color of the icon. Accepts any valid CSS color value.\n     */\n    @Input() fillColor: string;\n\n    /**\n     * The size of the icon button. Default is 'm'.\n     */\n    @Input() size: '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' = 'm';\n\n    /**\n     * Accessible label for screen readers describing the button's purpose.\n     */\n    @Input() ariaLabel: string;\n\n    /**\n     * Controls the visual state of the expander icon. When true, the icon rotates to indicate expanded state. Default is false.\n     */\n    @Input({ transform: booleanAttribute }) isExpanded = false;\n\n    /**\n     * Controls the rotation direction of the icon. When true, the icon points forward (right) when collapsed; when false, it points downward when collapsed. Default is false.\n     */\n    @Input({ transform: booleanAttribute }) isDirectionForward = false;\n\n    // TODO handle disabled attr (see button implementation)\n    /**\n     * Disables the button interaction when true. Default is false.\n     */\n    @Input({ transform: booleanAttribute }) euiDisabled = false;\n\n    /**\n     * Emitted when the button is clicked. Payload is the native click Event.\n     */\n    @Output() buttonClick = new EventEmitter<Event>();\n\n    onClick(event: Event): void {\n        this.buttonClick.emit(event);\n    }\n}\n","<button\n    type=\"button\"\n    class=\"eui-icon-button-expander-toggle\"\n    [class.eui-icon-button-expander-toggle--expanded]=\"isExpanded\"\n    [attr.aria-label]=\"isExpanded ? 'expanded' : 'collapsed'\"\n    [attr.aria-expanded]=\"isExpanded\"\n    (click)=\"onClick($event)\">\n    @if (fillColor) {\n        @if (isDirectionForward) {\n            <eui-icon-svg icon=\"eui-chevron-right\" fillColor=\"{{fillColor}}\" size=\"{{size}}\"></eui-icon-svg>\n        } @else {\n            <eui-icon-svg icon=\"eui-chevron-down\" fillColor=\"{{fillColor}}\" size=\"{{size}}\"></eui-icon-svg>\n        }\n\n    } @else {\n        @if (isDirectionForward) {\n            <eui-icon-svg icon=\"eui-chevron-right\" size=\"{{size}}\"></eui-icon-svg>\n        } @else {\n            <eui-icon-svg icon=\"eui-chevron-down\" size=\"{{size}}\"></eui-icon-svg>\n        }\n    }\n</button>\n","import { EuiIconButtonExpanderComponent } from './eui-icon-button-expander.component';\n\nexport * from './eui-icon-button-expander.component';\n\nexport const EUI_ICON_BUTTON_EXPANDER = [\n    EuiIconButtonExpanderComponent,\n] as const;\n\n// export { EuiIconButtonExpanderComponent as EuiIconButtonExpander } from './eui-icon-button-expander.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MAQU,8BAA8B,CAAA;AAP3C,IAAA,WAAA,GAAA;AAqBI;;AAEG;QACM,IAAA,CAAA,IAAI,GAAkE,GAAG;AAOlF;;AAEG;QACqC,IAAA,CAAA,UAAU,GAAG,KAAK;AAE1D;;AAEG;QACqC,IAAA,CAAA,kBAAkB,GAAG,KAAK;;AAGlE;;AAEG;QACqC,IAAA,CAAA,WAAW,GAAG,KAAK;AAE3D;;AAEG;AACO,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAS;AAKpD,IAAA;AA/CG,IAAA,IACI,UAAU,GAAA;QACV,OAAO;YACH,0BAA0B;YAC1B,IAAI,CAAC,kBAAkB,GAAG,6CAA6C,GAAE,EAAE;AAC9E,SAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;IACtB;AAsCA,IAAA,OAAO,CAAC,KAAY,EAAA;AAChB,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;IAChC;8GA/CS,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,6KA2BnB,gBAAgB,CAAA,EAAA,kBAAA,EAAA,CAAA,oBAAA,EAAA,oBAAA,EAKhB,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