-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fancy and plain separated, fancy mockup data working
- Loading branch information
Showing
4 changed files
with
68 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,20 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { StepProgress } from "@repo/design-system/stepProgress"; | ||
import { StepProgressFancy } from "@repo/design-system/stepProgressFancy"; | ||
|
||
const meta: Meta<typeof StepProgress> = { | ||
title: "Components/StepProgress", | ||
component: StepProgress, | ||
}; | ||
|
||
const mockupData = { | ||
currentStep: 3, | ||
stepCount: 4, | ||
stepStatus: [ | ||
{ step: 1, status: true }, | ||
{ step: 2, status: false }, | ||
{ step: 3, status: null }, | ||
{ step: 4, status: undefined }, | ||
], | ||
}; | ||
|
||
console.log(mockupData.stepStatus.map((step) => step.step)); | ||
|
||
type StepProgressStory = StoryObj<typeof meta>; | ||
|
||
export const Plain: StepProgressStory = { | ||
args: { | ||
currentStep: 1, | ||
stepCount: 2, | ||
totalStep: 8, | ||
}, | ||
render: (args) => <StepProgress {...args} />, | ||
}; | ||
|
||
export const Fancy: StepProgressStory = { | ||
args: { | ||
currentStep: 1, | ||
stepCount: 2, | ||
}, | ||
render: (args) => <StepProgressFancy {...args} />, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { StepProgressFancy } from "@repo/design-system/stepProgressFancy"; | ||
|
||
const meta: Meta<typeof StepProgressFancy> = { | ||
title: "Components/StepProgress", | ||
component: StepProgressFancy, | ||
}; | ||
|
||
type StepProgressStory = StoryObj<typeof meta>; | ||
|
||
const stepsData = { | ||
answers: [ | ||
{ answerId: "1", status: true }, // positive step (e.g. answerInFavour) | ||
{ answerId: "2", status: null }, | ||
{ answerId: "3", status: null }, // neutral step (e.g. visited / skipped, answerNeutral) | ||
{ answerId: "4", status: false }, // negative step (e.g. answerAgainst) | ||
{ answerId: "5", status: true }, | ||
{ answerId: "6", status: true }, // | ||
{ answerId: "7", status: false }, | ||
{ answerId: "8", status: undefined }, // step with no sratus (e.g. not visited yet) | ||
{ answerId: "8", status: undefined }, // step with no sratus (e.g. not visited yet) | ||
], | ||
totalQuestion: 4, | ||
currentQuestion: 8, | ||
}; | ||
export const Fancy: StepProgressStory = { | ||
args: { stepsData }, | ||
render: (args) => <StepProgressFancy {...args} />, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters