From 7a87f2897875b432445b624464c0fa4c175fbb4a Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Tue, 13 Aug 2024 13:34:37 +0530 Subject: [PATCH 1/9] feat: circular progress bar --- src/components/CircularProgressBar.vue | 140 +++++++++++++++++++++++++ src/index.js | 1 + 2 files changed, 141 insertions(+) create mode 100644 src/components/CircularProgressBar.vue diff --git a/src/components/CircularProgressBar.vue b/src/components/CircularProgressBar.vue new file mode 100644 index 00000000..dff95944 --- /dev/null +++ b/src/components/CircularProgressBar.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/index.js b/src/index.js index 7e2a6189..ece7e07f 100644 --- a/src/index.js +++ b/src/index.js @@ -61,6 +61,7 @@ export { default as CommandPaletteItem } from './components/CommandPalette/Comma export { default as ListFilter } from './components/ListFilter/ListFilter.vue' export { default as Calendar } from './components/Calendar/Calendar.vue' export { default as NestedPopover } from './components/ListFilter/NestedPopover.vue' +export { default as CircularProgressBar } from './components/CircularProgressBar.vue' // directives export { default as onOutsideClickDirective } from './directives/onOutsideClick.js' From 8455f6ba76b6cdb803508cded352bc141630dc20 Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Tue, 13 Aug 2024 14:20:43 +0530 Subject: [PATCH 2/9] fix: add story and docs for circular progress bar --- src/components/CircularProgressBar.story.md | 37 ++++++++++ src/components/CircularProgressBar.story.vue | 45 +++++++++++++ src/components/CircularProgressBar.vue | 71 ++++++++------------ 3 files changed, 109 insertions(+), 44 deletions(-) create mode 100644 src/components/CircularProgressBar.story.md create mode 100644 src/components/CircularProgressBar.story.vue diff --git a/src/components/CircularProgressBar.story.md b/src/components/CircularProgressBar.story.md new file mode 100644 index 00000000..6aad1aaa --- /dev/null +++ b/src/components/CircularProgressBar.story.md @@ -0,0 +1,37 @@ +## Props + + +### step +The current step of the progress bar. +It is required. + +### totalSteps +The total number of steps in the progress bar. Default value is 100. +It is required. + +### ringSize +The size of the ring. +The type of the value should be a string with a valid CSS unit (e.g. '42px', '2rem', '5em'). Default value is 42px. + +### ringBarWidth +The width of the ring bar in pixels. +The type of the value should be a string with a valid CSS unit (e.g. '10px', '0.5rem', '1em'). Default value is 10px. + +### innerTextFontSize +The font size of the inner text. +The type of the value should be a string with a valid CSS unit (e.g. '16px', '1rem', '2em'). Default value is 16px. + +### progressColor +The color of the how much progress has been made. Default value is #333 (dark grey). + +### progressRemainingColor +The color of the remaining progress. Default value is #888 (light grey). + +### progressCompleteColor +The color of the completed progress. Default value is #76f7be (light green). + +### isOuterCircleFilledOnComplete +If true, the outer circle will be filled with the `progressCompleteColor` when the progress is completed. Else, the inner circle will be filled with the `progressCompleteColor`. Default value is false. + +### showPercentage +If true, the percentage of the progress will be shown in the center of the circle. Else, the absolute value of the current step will be shown. Default value is false. \ No newline at end of file diff --git a/src/components/CircularProgressBar.story.vue b/src/components/CircularProgressBar.story.vue new file mode 100644 index 00000000..5a03c1ed --- /dev/null +++ b/src/components/CircularProgressBar.story.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/CircularProgressBar.vue b/src/components/CircularProgressBar.vue index dff95944..397184cf 100644 --- a/src/components/CircularProgressBar.vue +++ b/src/components/CircularProgressBar.vue @@ -18,47 +18,30 @@