import {type CSSResultGroup, html, unsafeCSS} from 'lit'; import {property} from 'lit/decorators.js'; import ZincElement from '../../internal/zinc-element'; import styles from './progress-bar.scss'; /** * @summary Progress bars provide visual feedback about the completion status of a task or process. * @documentation https://zinc.style/components/progress-bar * @status experimental * @since 1.0 * * @csspart header - The header container that contains the caption and progress text. * @csspart caption - The caption text element. * @csspart progress - The progress percentage text element. * @csspart bar - The SVG element containing the progress bar. * @csspart track - The background track of the progress bar. * @csspart fill - The filled portion of the progress bar indicating progress. * @csspart footer - The footer container that contains the description. * @csspart info - The description text element. * * @cssproperty --zn-border-color - The color of the progress bar background track. * @cssproperty --zn-primary - The color of the progress bar fill. * @cssproperty --zn-text-heading - The color of the caption text. * @cssproperty --zn-text - The color of the progress percentage and description text. * @cssproperty --zn-spacing-x-small - The spacing between header/footer and the progress bar. */ export default class ZnProgressBar extends ZincElement { static styles: CSSResultGroup = unsafeCSS(styles); @property({type: String, reflect: true}) caption: string | undefined; @property({type: String, reflect: true}) description: string | undefined; @property({type: Number, reflect: true}) value: number | undefined; @property({type: Boolean, reflect: true, attribute: 'show-progress'}) showProgress: boolean | undefined; render() { return html` ${this.caption || this.showProgress ? html`

${this.caption}

${this.showProgress ? html`

${this.value}%

` : ''}
` : ''} ${this.description ? html` ` : ''} `; } }