{"version":3,"file":"eui-components-eui-progress-bar.mjs","sources":["../../eui-progress-bar/eui-progress-bar.component.ts","../../eui-progress-bar/eui-progress-bar.component.html","../../eui-progress-bar/index.ts","../../eui-progress-bar/eui-components-eui-progress-bar.ts"],"sourcesContent":["import {\n    Component,\n    Input,\n    ChangeDetectionStrategy,\n    SimpleChanges,\n    OnChanges,\n    HostBinding,\n    booleanAttribute,\n    numberAttribute,\n    inject,\n} from '@angular/core';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\n\nimport { BaseStatesDirective } from '@eui/components/shared';\nimport { EUI_ICON } from '@eui/components/eui-icon';\nimport { EUI_ICON_STATE } from '@eui/components/eui-icon-state';\n\n/**\n * Transform function that ensures progress value doesn't exceed 100\n * @param value - The input progress value\n * @returns A number between 0 and 100\n */\nconst progressAttribute = (value: NumberInput): number => Math.min(numberAttribute(value), 100);\n\n/**\n * @description\n * Horizontal progress indicator component that visualizes task completion or loading states.\n * Supports determinate progress with percentage values and indeterminate loading animations.\n * Provides optional labeling and status icons for contextual feedback.\n * Integrates with BaseStatesDirective for theming variants (success, warning, danger) and sizing options.\n * Commonly used for file uploads, form submissions, data processing, and loading indicators.\n *\n * @usageNotes\n * ### Basic usage\n * ```html\n * <eui-progress-bar [progress]=\"75\" label=\"Upload progress\"></eui-progress-bar>\n * ```\n *\n * ### Indeterminate loading\n * ```html\n * <eui-progress-bar [isIndeterminate]=\"true\" label=\"Loading...\"></eui-progress-bar>\n * ```\n *\n * ### With status variants\n * ```html\n * <eui-progress-bar [progress]=\"90\" euiSuccess [hasStatusIcon]=\"true\"></eui-progress-bar>\n * <eui-progress-bar [progress]=\"50\" euiWarning></eui-progress-bar>\n * <eui-progress-bar [progress]=\"25\" euiDanger></eui-progress-bar>\n * ```\n *\n * ### Accessibility\n * - Uses ARIA attributes to communicate progress state to assistive technologies\n * - Label provides context for screen readers\n * - Status icons enhance visual feedback for users with color vision deficiencies\n *\n * ### Notes\n * - Progress values are automatically capped at 100\n * - Indeterminate mode shows continuous animation for unknown duration tasks\n * - Combine with status variants to indicate success, warning, or error states\n */\n@Component({\n    templateUrl: './eui-progress-bar.component.html',\n    selector: 'eui-progress-bar',\n    styleUrl: './eui-progress-bar.scss',\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    imports: [\n        ...EUI_ICON, \n        ...EUI_ICON_STATE,\n    ],\n    hostDirectives: [\n        {\n            directive: BaseStatesDirective,\n            inputs: [\n                'euiSecondary',\n                'euiSuccess',\n                'euiInfo',\n                'euiWarning',\n                'euiDanger',\n                'euiSize2XS',\n                'euiSizeXS',\n                'euiSizeS',\n                'euiSizeM',\n                'euiSizeL',\n                'euiSizeXL',\n                'euiVariant',\n                'euiSizeVariant',\n            ],\n        },\n    ],\n})\nexport class EuiProgressBarComponent implements OnChanges {\n    /** Element attribute for e2e testing */\n    @HostBinding('attr.data-e2e')\n    @Input()\n    e2eAttr = 'eui-progress-bar';\n\n    /** CSS classes applied to the host element */\n    @HostBinding('class')\n    public get cssClasses(): string {\n        return this.getCssClasses();\n    }\n\n    /** Optional label displayed above the progress bar */\n    @Input() label = '';\n\n    /**\n     * Current progress value (0-100)\n     * Values greater than 100 will be capped at 100\n     */\n    @Input({ transform: numberAttribute })\n    progress: NumberInput;\n\n    /**\n     * When true, shows an indeterminate progress animation\n     * instead of a specific progress value\n     */\n    @Input({ transform: booleanAttribute })\n    isIndeterminate: BooleanInput = false;\n\n    /**\n     * When true, displays a status icon based on the current state\n     * (success, warning, error, etc.)\n     */\n    @Input({ transform: booleanAttribute })\n    hasStatusIcon: BooleanInput = false;\n\n    /**\n     * Reference to the BaseStatesDirective for managing component states\n     */\n    public baseStatesDirective: BaseStatesDirective = inject(BaseStatesDirective);\n\n    ngOnChanges(changes: SimpleChanges): void {\n        if (changes['progress']) {\n            this.progress = changes['progress'].currentValue;\n            if ((this?.progress as number) > 100) {\n                this.progress = 100;\n            }\n        }\n    }\n\n    /**\n     * Generates CSS classes for the component based on current state\n     * @returns Space-separated string of CSS class names\n     */\n    private getCssClasses(): string {\n        return [\n            this.baseStatesDirective.getCssClasses('eui-progress-bar'),\n            this.isIndeterminate ? 'eui-progress-bar--indeterminate' : '',\n            this.hasStatusIcon ? 'eui-progress-bar--hasStatusIcon' : '',\n        ]\n            .join(' ')\n            .trim();\n    }\n}\n","@if(label || hasStatusIcon) {\n    <div class=\"eui-progress-bar__header\">\n        @if(label) {\n            <div class=\"eui-progress-bar__header-label\">{{ label }}</div>\n        }\n        @if(hasStatusIcon) {\n            <div class=\"eui-progress-bar__header-status\">\n                <eui-icon-state [euiVariant]=\"baseStatesDirective.euiVariant\"/>\n            </div>\n        }\n    </div>\n}\n<div class=\"eui-progress-bar__indicator-container\">\n    <div class=\"eui-progress-bar__indicator\" [style.width]=\"!isIndeterminate ? progress + '%' : null\"></div>\n</div>\n","import { EuiProgressBarComponent } from './eui-progress-bar.component';\n\nexport * from './eui-progress-bar.component';\n\nexport const EUI_PROGRESS_BAR = [\n    EuiProgressBarComponent,\n] as const;\n\n// export { EuiProgressBarComponent as EuiProgressBar } from './eui-progress-bar.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAiBA;;;;AAIG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAAkB,KAAa,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCG;MA+BU,uBAAuB,CAAA;AA9BpC,IAAA,WAAA,GAAA;;QAkCI,IAAA,CAAA,OAAO,GAAG,kBAAkB;;QASnB,IAAA,CAAA,KAAK,GAAG,EAAE;AASnB;;;AAGG;QAEH,IAAA,CAAA,eAAe,GAAiB,KAAK;AAErC;;;AAGG;QAEH,IAAA,CAAA,aAAa,GAAiB,KAAK;AAEnC;;AAEG;AACI,QAAA,IAAA,CAAA,mBAAmB,GAAwB,MAAM,CAAC,mBAAmB,CAAC;AAwBhF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