-
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.
feat: add storybook [MDS-1442] (#224)
* feat: add storybook [MDS-1442] * fix: remove unnecesary files [MDS-1442] * feat: add storybook [MDS-1442] * Prettified Code! * fix: put themes.css in the last line [MDS-1442] * Prettified Code! * feat: add stories to gitignore [MDS-1442] * fix: ignore public/stories in cspell.json [MDS-1442] * feat: add storybook:build to main build script [MDS-1442] * fix: modify build:storybook script to prevent copying public files into subdirectory issue * fix: remove output files [MDS-1442] * fix: remove .gitignore change [MDS-1442] --------- Co-authored-by: robb91-dev <[email protected]>
- Loading branch information
1 parent
15211ae
commit 02677a6
Showing
17 changed files
with
5,108 additions
and
120 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"docs": minor | ||
--- | ||
|
||
feat: add storybook [MDS-1442] |
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ cache | |
|
||
# next.js | ||
/docs/.next | ||
/docs/public/stories/ | ||
/.next/ | ||
/out/ | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"plugins": ["prettier"], | ||
"extends": ["next/core-web-vitals", "prettier"] | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"prettier", | ||
"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,20 @@ | ||
import type { StorybookConfig } from "@storybook/nextjs"; | ||
|
||
const config: StorybookConfig = { | ||
stories: [ | ||
"../app/stories/**/*.mdx", | ||
"../app/stories/**/*.stories.@(js|jsx|mjs|ts|tsx)", | ||
], | ||
addons: [ | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-essentials", | ||
"@chromatic-com/storybook", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/nextjs", | ||
options: {}, | ||
}, | ||
staticDirs: ["../public"], | ||
}; | ||
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,7 @@ | ||
<html> | ||
<body | ||
class="light-theme theme-moon-light flex items-center justify-center h-screen" | ||
> | ||
<div id="storybook-root"></div> | ||
</body> | ||
</html> |
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,15 @@ | ||
import type { Preview } from "@storybook/react"; | ||
import "../app/globals.css"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Avatar as AvatarComponent } from "@heathmont/moon-core-tw"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
const meta: Meta<typeof AvatarComponent> = { | ||
component: AvatarComponent, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof AvatarComponent>; | ||
|
||
export const Avatar: Story = { | ||
args: { | ||
size: "sm", | ||
}, | ||
}; |
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,20 @@ | ||
import { Button as ButtonComponent } from "@heathmont/moon-core-tw"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
const meta: Meta<typeof ButtonComponent> = { | ||
component: ButtonComponent, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ButtonComponent>; | ||
|
||
export const Button: Story = { | ||
args: { | ||
children: <span>Click me</span>, | ||
variant: "primary", | ||
size: "xl", | ||
disabled: false, | ||
fullWidth: false, | ||
animation: "pulse", | ||
}, | ||
}; |
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,21 @@ | ||
import { Chip as ChipComponent } from "@heathmont/moon-core-tw"; | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
const meta: Meta<typeof ChipComponent> = { | ||
component: ChipComponent, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ChipComponent>; | ||
|
||
const args = { | ||
isActive: true, | ||
size: "md", | ||
isStroke: true, | ||
children: <span>To the moon</span>, | ||
}; | ||
|
||
export const Chip: Story = { | ||
args, | ||
}; |
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,16 @@ | ||
import { Textarea as TextareaComponent } from "@heathmont/moon-core-tw"; | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
const meta: Meta<typeof TextareaComponent> = { | ||
component: TextareaComponent, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof TextareaComponent>; | ||
|
||
export const Textarea: Story = { | ||
args: { | ||
error: false, | ||
}, | ||
}; |
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,5 @@ | ||
import { redirect } from "next/navigation"; | ||
|
||
export default function StoriesPage() { | ||
redirect("/stories/index.html"); | ||
} |
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
Oops, something went wrong.