-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0201c72
commit a95cce2
Showing
17 changed files
with
16,413 additions
and
2,999 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,3 +1,6 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"plugin:storybook/recommended" | ||
] | ||
} |
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,49 @@ | ||
import type { StorybookConfig } from "@storybook/nextjs"; | ||
|
||
const config: StorybookConfig = { | ||
stories: [ | ||
"../stories/**/*.mdx", | ||
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)", | ||
], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-interactions", | ||
'storybook-addon-jotai', | ||
"@storybook/addon-styling-webpack", | ||
({ | ||
name: "@storybook/addon-styling-webpack", | ||
|
||
options: { | ||
rules: [{ | ||
test: /\.css$/, | ||
sideEffects: true, | ||
use: [ | ||
require.resolve("style-loader"), | ||
{ | ||
loader: require.resolve("css-loader"), | ||
options: { | ||
|
||
importLoaders: 1, | ||
}, | ||
},{ | ||
loader: require.resolve("postcss-loader"), | ||
options: { | ||
implementation: require.resolve("postcss"), | ||
}, | ||
}, | ||
], | ||
},], | ||
} | ||
}) | ||
], | ||
framework: { | ||
name: "@storybook/nextjs", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
}; | ||
export default config; |
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,18 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
import '../app/globals.css'; // replace with the name of your tailwind css file | ||
|
||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { useAtom } from "jotai"; | ||
import { accuracyAtom, maxProgressAtom, progressAtom } from "../../state"; | ||
|
||
export default function Progress() { | ||
const [progress] = useAtom(progressAtom); | ||
const [maxProgress] = useAtom(maxProgressAtom); | ||
const [accuracy] = useAtom(accuracyAtom); | ||
|
||
const percentage = ((progress / maxProgress) * 100).toFixed(2); | ||
const percentageDisplay = `${percentage}%`; | ||
const progressPercentWidget = ( | ||
<div className="stat"> | ||
<div className="stat-figure text-primary"></div> | ||
<div className="stat-title">Progress</div> | ||
<div className="stat-value text-primary">{percentageDisplay}</div> | ||
</div> | ||
); | ||
const letters = ( | ||
<div className="stat"> | ||
<div className="stat-figure text-secondary"></div> | ||
<div className="stat-title">Letters typed</div> | ||
<div className="stat-value text-secondary">{progress}</div> | ||
</div> | ||
); | ||
|
||
const accuracyComponent = ( | ||
<div className="stat"> | ||
<div className="stat-figure text-secondary"></div> | ||
<div className="stat-title">Accuracy</div> | ||
<div className="stat-value text-secondary">{accuracy}%</div> | ||
</div> | ||
); | ||
const progressBar = ( | ||
<progress | ||
className="progress progress-primary w-full h-4" | ||
value={progress} | ||
max={maxProgress} | ||
></progress> | ||
); | ||
return ( | ||
<div className="flex flex-col gap-4 w-full"> | ||
<div className="flex gap-2"> | ||
{letters} | ||
{progressPercentWidget} | ||
{accuracyComponent} | ||
</div> | ||
{progressBar} | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.