mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
* ProgressBar status feature added * ProgressBar: Removed the css variables and use carbon-css instead. The way of assigning the ProgressBar value has change. It is now a style variable and scale-x is calculated in the css. This way prevent the override of carbon css. * Removed an unessacery span. * Removed an unnecessary span. * Added the status for the ProgressBarUx * Remove `style css` and update docs. * - Fixed the `capped` variable for more readability - Updated docs `label` and `helperText` - Updated docs and css * fix: finished/error states cannot be indeterminate * Run "yarn build:css" * Re-run "yarn build:docs" * test(progress-bar): assert `status` prop * chore: add aria-busy and set valuenow to 0 when not active --------- Co-authored-by: Eric Liu <ericyl.us@gmail.com> Co-authored-by: Enrico Sacchetti <enrico@theetrain.ca>
65 lines
1.1 KiB
TypeScript
65 lines
1.1 KiB
TypeScript
/// <reference types="svelte" />
|
|
import type { SvelteComponentTyped } from "svelte";
|
|
|
|
export interface ProgressBarProps
|
|
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
|
/**
|
|
* Specify the current value
|
|
* @default undefined
|
|
*/
|
|
value?: number;
|
|
|
|
/**
|
|
* Specify the maximum value
|
|
* @default 100
|
|
*/
|
|
max?: number;
|
|
|
|
/**
|
|
* Specify the kind of progress bar
|
|
* @default "default"
|
|
*/
|
|
kind?: "default" | "inline" | "indented";
|
|
|
|
/**
|
|
* Specify the status
|
|
* @default "active"
|
|
*/
|
|
status?: "active" | "finished" | "error";
|
|
|
|
/**
|
|
* Specify the size
|
|
* @default "md"
|
|
*/
|
|
size?: "sm" | "md";
|
|
|
|
/**
|
|
* Specify the label text
|
|
* @default ""
|
|
*/
|
|
labelText?: string;
|
|
|
|
/**
|
|
* Set to `true` to visually hide the label text
|
|
* @default false
|
|
*/
|
|
hideLabel?: boolean;
|
|
|
|
/**
|
|
* Specify the helper text
|
|
* @default ""
|
|
*/
|
|
helperText?: string;
|
|
|
|
/**
|
|
* Set an id for the progress bar element
|
|
* @default "ccs-" + Math.random().toString(36)
|
|
*/
|
|
id?: string;
|
|
}
|
|
|
|
export default class ProgressBar extends SvelteComponentTyped<
|
|
ProgressBarProps,
|
|
{},
|
|
{ labelText: {} }
|
|
> {}
|