diff --git a/commitlint.config.js b/commitlint.config.js
index b996e9dc..93315861 100644
--- a/commitlint.config.js
+++ b/commitlint.config.js
@@ -13,7 +13,8 @@ module.exports = {
'input',
'badge',
'tab',
- 'tooltip'
+ 'tooltip',
+ 'progress-indicator'
],
],
},
diff --git a/src/baklava.ts b/src/baklava.ts
index 9fede22f..08062896 100644
--- a/src/baklava.ts
+++ b/src/baklava.ts
@@ -5,5 +5,6 @@ export { default as BlInput } from './components/input/bl-input';
export { default as BlTab } from './components/tab-group/tab/bl-tab';
export { default as BlTabGroup } from './components/tab-group/bl-tab-group';
export { default as BlTabPanel } from './components/tab-group/tab-panel/bl-tab-panel';
-export { getIconPath, setIconPath } from './utilities/asset-paths';
export { default as BlTooltip } from './components/tooltip/bl-tooltip';
+export { default as BlProgressIndicator } from './components/progress-indicator/bl-progress-indicator';
+export { getIconPath, setIconPath } from './utilities/asset-paths';
diff --git a/src/components/input/bl-input.stories.mdx b/src/components/input/bl-input.stories.mdx
index 0bce5448..c091d9e8 100644
--- a/src/components/input/bl-input.stories.mdx
+++ b/src/components/input/bl-input.stories.mdx
@@ -62,9 +62,6 @@ import {
'label-fixed': {
control: 'boolean',
},
- '': {
- control: 'text',
- },
helpText: {
control: 'text'
}
diff --git a/src/components/progress-indicator/bl-progress-indicator.css b/src/components/progress-indicator/bl-progress-indicator.css
new file mode 100644
index 00000000..461ff9d5
--- /dev/null
+++ b/src/components/progress-indicator/bl-progress-indicator.css
@@ -0,0 +1,36 @@
+.progress-indicator {
+ --max: 100;
+ --value: 0;
+ --value-color: var(--bl-color-success);
+ --height: var(--bl-size-2xs);
+ --radius: var(--bl-size-3xs);
+
+ position: relative;
+ background-color: var(--bl-color-secondary-background);
+ height: var(--height);
+ border-radius: var(--radius);
+ width: 100%;
+}
+
+.progress-indicator::before {
+ content: '';
+ position: absolute;
+ height: 100%;
+ width: calc(100% / var(--max) * var(--value));
+ background-color: var(--value-color);
+ border-radius: var(--radius);
+}
+
+:host([size='small']) .progress-indicator {
+ --height: var(--bl-size-3xs);
+ --radius: var(--bl-size-4xs);
+}
+
+:host([size='large']) .progress-indicator {
+ --height: var(--bl-size-xs);
+ --radius: 6px;
+}
+
+:host([failed]) .progress-indicator {
+ --value-color: var(--bl-color-danger);
+}
diff --git a/src/components/progress-indicator/bl-progress-indicator.stories.mdx b/src/components/progress-indicator/bl-progress-indicator.stories.mdx
new file mode 100644
index 00000000..203bccf9
--- /dev/null
+++ b/src/components/progress-indicator/bl-progress-indicator.stories.mdx
@@ -0,0 +1,100 @@
+import { html } from 'lit';
+import { ifDefined } from 'lit/directives/if-defined.js';
+import { styleMap } from 'lit/directives/style-map.js';
+import { Meta, Canvas, ArgsTable, Story, Preview, Source } from '@storybook/addon-docs';
+
+
+
+export const ProgressIndicatorTemplate = (args) => html`
+`
+
+export const FailedTemplate = (args) => html`
+
+
Upload Failed - Image must not be larger than 3mb.
${ProgressIndicatorTemplate({ value:'100', failed:true, ...args })}
+
`;
+
+export const WithMaxTemplate = (args) => html`
+
+
Completed Tasks: 5/8
${ProgressIndicatorTemplate({ max:'8', value: '5', ...args })}
+
`;
+
+# Progress Indicator
+
+A progress indicator provides feedback about the duration and progression of a process to indicate how long a user will be waiting.
+
+Progress indicator component used for a long operation or a process that can take a considerable or unknown amount of time. It visually shows the progression of a system operation such as downloading, uploading, loading data, submitting a form, or saving updates.
+
+
+## Basic Usage
+
+By default, the `max` is 100 and the progress indicator is evaluated over 100. So the `value` must be a valid floating point number between 0 and `max`, or between 0 and 100 if `max` is omitted.
+
+
+
+
+You don't have to pass the `value` according to 100 percent. For example, if you have a total of 8 tasks and completed 5 tasks you can pass parameters like `max="8" value="5"`. The progress indicator will divide into 8 parts and 5 parts will be full.
+
+
+
+## Progress Indicator Status
+The progress indicator appears in success mode (green) by default. But if you need to show fail status for example failed to upload or failed to complete tasks you can pass `failed` parameters.
+
+
+
+## Progress Indicator Sizes
+
+We have 3 sizes of progress indicator: `large`, `medium`, `small`. Default size is `medium`.
+
+
+
+
diff --git a/src/components/progress-indicator/bl-progress-indicator.test.ts b/src/components/progress-indicator/bl-progress-indicator.test.ts
new file mode 100644
index 00000000..0510d247
--- /dev/null
+++ b/src/components/progress-indicator/bl-progress-indicator.test.ts
@@ -0,0 +1,85 @@
+import { assert, elementUpdated, expect, fixture, html } from '@open-wc/testing';
+import BlProgressIndicator from './bl-progress-indicator';
+import type typeOfBlProgressIndicator from './bl-progress-indicator';
+
+describe('bl-progress-indicator', () => {
+ it('should be defined progress indicator instance', () => {
+ //when
+ const el = document.createElement('bl-progress-indicator');
+
+ //then
+ assert.instanceOf(el, BlProgressIndicator);
+ });
+
+ it('should be rendered with default values', async () => {
+ //when
+ const el = await fixture(
+ html``
+ );
+
+ //then
+ assert.shadowDom.equal(
+ el,
+ `
+
+ `
+ );
+ });
+
+ it('should have correct default values', async () => {
+ //when
+ const el = await fixture(
+ html``
+ );
+
+ //then
+ expect(el.size).to.equal('medium');
+ expect(el.max).to.equal(100);
+ expect(el.value).to.equal(0);
+ expect(el.failed).to.equal(false);
+ });
+
+ it('should be rendered with correct size,max,failed,value attributes', async () => {
+ //when
+ const el = await fixture(
+ html``
+ );
+
+ //then
+ const wrapper = el.shadowRoot?.querySelector('.progress-indicator') as HTMLDivElement;
+ const cssMaxVariable = getComputedStyle(wrapper).getPropertyValue('--max');
+ const cssValueVariable = getComputedStyle(wrapper).getPropertyValue('--value');
+
+ expect(el.size).to.eq('large');
+ expect(el.max).to.eq(8);
+ expect(el.value).to.eq(3);
+ expect(el.failed).to.eq(true);
+ expect(cssMaxVariable).to.eq('8');
+ expect(cssValueVariable).to.eq('3');
+ });
+
+ it('should be rendered with correct size,max,failed,value attributes when size,max,failed,value attributes was changed', async () => {
+ //given
+ const el = await fixture(
+ html``
+ );
+ el.setAttribute('size', 'small');
+ el.setAttribute('max', '5');
+ el.setAttribute('value', '4');
+ el.setAttribute('failed', 'true');
+
+ //when
+ await elementUpdated(el);
+
+ //then
+ expect(el.size).to.eq('small');
+ expect(el.max).to.eq(5);
+ expect(el.value).to.eq(4);
+ expect(el.failed).to.eq(true);
+ });
+});
diff --git a/src/components/progress-indicator/bl-progress-indicator.ts b/src/components/progress-indicator/bl-progress-indicator.ts
new file mode 100644
index 00000000..2daa5918
--- /dev/null
+++ b/src/components/progress-indicator/bl-progress-indicator.ts
@@ -0,0 +1,82 @@
+import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';
+import { customElement, property, query, state } from 'lit/decorators.js';
+import style from './bl-progress-indicator.css';
+
+export type ProgressIndicatorSize = 'small' | 'medium' | 'large';
+
+/**
+ * @tag bl-progress-indicator
+ * @summary Baklava Progress Indicator component
+ *
+ * @property {max} [max=100]
+ * @property {number} [value=0]
+ */
+
+@customElement('bl-progress-indicator')
+export default class BlProgressIndicator extends LitElement {
+ static get styles(): CSSResultGroup {
+ return style;
+ }
+
+ @query('.progress-indicator') private wrapper: HTMLElement;
+
+ /**
+ * Sets the size
+ */
+ @property({ type: String })
+ size: ProgressIndicatorSize = 'medium';
+
+ /**
+ * Sets the status
+ */
+ @property({ type: Boolean })
+ failed = false;
+
+ /**
+ * Sets the max
+ */
+ @property({ type: Number })
+ get max() {
+ return this._max;
+ }
+ set max(max: number) {
+ this._max = max;
+ this.updateCssVariable();
+ }
+
+ /**
+ * Sets the value
+ */
+ @property({ type: Number })
+ get value() {
+ return this._value;
+ }
+ set value(value: number) {
+ this._value = value;
+ this.updateCssVariable();
+ }
+
+ @state() private _max = 100;
+ @state() private _value = 0;
+
+ async updateCssVariable() {
+ await this.updateComplete;
+ this.wrapper.style.setProperty('--value', `${this.value}`);
+ this.wrapper.style.setProperty('--max', `${this.max}`);
+ }
+
+ render(): TemplateResult {
+ return html``;
+ }
+}
+
+declare global {
+ interface HTMLElementTagNameMap {
+ 'bl-progress-indicator': BlProgressIndicator;
+ }
+}