import { __rest } from '../../_virtual/_tslib.js';
import React__default from 'react';
import { ProgressBarContainer, ProgressBarHeader, LabelText, LabelDetailsText, ProgressBarEmpty, ProgressBarFiller, IndeterminateProgressBarFiller, AssistiveText } from './styles.js';
import { getId } from '../../utils/index.js';

function ProgressBar(_a) {
    var { percentage, label, labelDetails, assistiveText, color = 'primary', variant = 'default' } = _a, props = __rest(_a, ["percentage", "label", "labelDetails", "assistiveText", "color", "variant"]);
    if (percentage < 0 || percentage > 100) {
        console.warn('Component with wrong percentage value ', percentage);
        return null;
    }
    const appendTestId = getId(props['data-testid']);
    const appendTrackId = getId(props['data-testid']);
    return (React__default.createElement(ProgressBarContainer, { "data-testid": appendTestId('progress-bar'), "data-trackid": appendTrackId('progress-bar'), "aria-label": props['aria-label'] },
        (label || labelDetails) && (React__default.createElement(ProgressBarHeader, null,
            React__default.createElement(LabelText, null, label),
            React__default.createElement(LabelDetailsText, null, labelDetails))),
        React__default.createElement(ProgressBarEmpty, null, variant === 'default' ? (React__default.createElement(ProgressBarFiller, { color: color, width: percentage })) : (React__default.createElement(IndeterminateProgressBarFiller, { color: color, width: percentage }))),
        assistiveText && React__default.createElement(AssistiveText, null, assistiveText)));
}

export { ProgressBar };
