Update proportion bar component

This commit is contained in:
adilallo
2026-02-06 14:33:25 -07:00
parent 162fdf94db
commit 85ff3b8f01
15 changed files with 125 additions and 161 deletions
-110
View File
@@ -1,110 +0,0 @@
import Progress from "../../app/components/progress/Progress";
export default {
title: "Components/Progress",
component: Progress,
parameters: {
layout: "centered",
docs: {
description: {
component:
"Progress bar component for showing completion percentage. Displays a 3-segment progress bar with support for partial fills.",
},
},
},
argTypes: {
progress: {
control: { type: "select" },
options: [
"1-0",
"1-1",
"1-2",
"1-3",
"1-4",
"1-5",
"2-0",
"2-1",
"2-2",
"3-0",
"3-1",
"3-2",
],
description: "Progress state (format: segments-partial)",
},
},
tags: ["autodocs"],
};
export const Default = {
args: {
progress: "3-2",
},
render: (args) => (
<div className="w-full max-w-[600px]">
<Progress {...args} />
</div>
),
};
export const AllStates = {
args: {},
render: (_args) => (
<div className="space-y-4 w-full max-w-[600px]">
<div className="w-full">
<p className="text-white mb-2">1-0</p>
<Progress {..._args} progress="1-0" />
</div>
<div className="w-full">
<p className="text-white mb-2">1-1</p>
<Progress {..._args} progress="1-1" />
</div>
<div className="w-full">
<p className="text-white mb-2">1-2</p>
<Progress {..._args} progress="1-2" />
</div>
<div className="w-full">
<p className="text-white mb-2">1-3</p>
<Progress {..._args} progress="1-3" />
</div>
<div className="w-full">
<p className="text-white mb-2">1-4</p>
<Progress {..._args} progress="1-4" />
</div>
<div className="w-full">
<p className="text-white mb-2">1-5</p>
<Progress {..._args} progress="1-5" />
</div>
<div className="w-full">
<p className="text-white mb-2">2-0</p>
<Progress {..._args} progress="2-0" />
</div>
<div className="w-full">
<p className="text-white mb-2">2-1</p>
<Progress {..._args} progress="2-1" />
</div>
<div className="w-full">
<p className="text-white mb-2">2-2</p>
<Progress {..._args} progress="2-2" />
</div>
<div className="w-full">
<p className="text-white mb-2">3-0</p>
<Progress {..._args} progress="3-0" />
</div>
<div className="w-full">
<p className="text-white mb-2">3-1</p>
<Progress {..._args} progress="3-1" />
</div>
<div className="w-full">
<p className="text-white mb-2">3-2</p>
<Progress {..._args} progress="3-2" />
</div>
</div>
),
parameters: {
docs: {
description: {
story: "Different progress states of the progress bar component.",
},
},
},
};
+74
View File
@@ -0,0 +1,74 @@
import ProportionBar from "../../app/components/progress/ProportionBar";
export default {
title: "Components/Progress/ProportionBar",
component: ProportionBar,
parameters: {
layout: "centered",
docs: {
description: {
component:
"Proportion bar component for showing completion percentage. Displays a 3-segment proportion bar with support for partial fills.",
},
},
},
argTypes: {
progress: {
control: { type: "select" },
options: [
"1-0",
"1-1",
"1-2",
"1-3",
"1-4",
"1-5",
"2-0",
"2-1",
"2-2",
"3-0",
"3-1",
"3-2",
],
description: "Proportion state (format: segments-partial)",
},
},
tags: ["autodocs"],
};
export const Default = {
args: {
progress: "3-2",
},
render: (args) => (
<div className="w-[300px]">
<ProportionBar {...args} />
</div>
),
};
export const AllStates = {
args: {},
render: (_args) => (
<div className="space-y-4 w-[300px]">
<ProportionBar {..._args} progress="1-0" />
<ProportionBar {..._args} progress="1-1" />
<ProportionBar {..._args} progress="1-2" />
<ProportionBar {..._args} progress="1-3" />
<ProportionBar {..._args} progress="1-4" />
<ProportionBar {..._args} progress="1-5" />
<ProportionBar {..._args} progress="2-0" />
<ProportionBar {..._args} progress="2-1" />
<ProportionBar {..._args} progress="2-2" />
<ProportionBar {..._args} progress="3-0" />
<ProportionBar {..._args} progress="3-1" />
<ProportionBar {..._args} progress="3-2" />
</div>
),
parameters: {
docs: {
description: {
story: "Different proportion states of the proportion bar component.",
},
},
},
};