Skip to content

Commit 77266b2

Browse files
committed
chore: steps-stories
1 parent 34b3399 commit 77266b2

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

src/stories/steps.stories.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
3+
import { IPreviewArgs } from "./utils";
4+
5+
import StepComponent from "../lib/progress/steps";
6+
7+
const meta = {
8+
component: StepComponent,
9+
title: "Progress/Steps",
10+
tags: ["autodocs"],
11+
argTypes: {
12+
horizontal: {
13+
control: "boolean",
14+
},
15+
currentItemIndex: {
16+
control: "number",
17+
},
18+
},
19+
} satisfies Meta<typeof StepComponent>;
20+
21+
export default meta;
22+
23+
type Story = StoryObj<typeof meta> & IPreviewArgs;
24+
25+
export const Default: Story = {
26+
args: {
27+
themeUI: "light",
28+
backgroundUI: "light",
29+
items: [
30+
{ title: "Escrow Details" },
31+
{ title: "Terms" },
32+
{ title: "Preview" },
33+
],
34+
horizontal: true,
35+
currentItemIndex: 1,
36+
className: "h-auto w-[500px]",
37+
},
38+
};
39+
40+
/** Steps can be oriented vertically. */
41+
export const VerticalOrientation: Story = {
42+
args: {
43+
...Default.args,
44+
horizontal: false,
45+
className: "h-[300px] w-auto",
46+
},
47+
};
48+
49+
/** Sub items can be provided for each individual step. */
50+
export const SubItems: Story = {
51+
args: {
52+
...Default.args,
53+
items: [
54+
{ title: "Escrow Details", subitems: ["Type of Escrow", "Title"] },
55+
{ title: "Terms", subitems: ["Deliverable", "Payment", "Deadline"] },
56+
{ title: "Preview" },
57+
],
58+
},
59+
};

0 commit comments

Comments
 (0)