Skip to content

Commit 60847b6

Browse files
[Closes #261] Storybook integration (#265)
Co-authored-by: Max Isom <codetheweb@users.noreply.github.com>
1 parent db0f807 commit 60847b6

File tree

7 files changed

+17779
-5057
lines changed

7 files changed

+17779
-5057
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parser": "@typescript-eslint/parser",
3-
"extends": "next/core-web-vitals",
3+
"extends": ["next/core-web-vitals", "plugin:storybook/recommended"],
44
"ignorePatterns": ["*.json"],
55
"overrides": [
66
{

.storybook/main.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { StorybookConfig } from "@storybook/nextjs";
2+
3+
const config: StorybookConfig = {
4+
staticDirs: ["../public"],
5+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
6+
addons: [
7+
"@storybook/addon-links",
8+
"@storybook/addon-essentials",
9+
"@storybook/addon-onboarding",
10+
"@storybook/addon-interactions",
11+
"@tomfreudenberg/next-auth-mock/storybook",
12+
],
13+
framework: {
14+
name: "@storybook/nextjs",
15+
options: {},
16+
},
17+
docs: {
18+
autodocs: "tag",
19+
},
20+
};
21+
export default config;

.storybook/preview.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
import "../src/styles/globals.css";
4+
5+
const preview: Preview = {
6+
parameters: {
7+
actions: { argTypesRegex: "^on[A-Z].*" },
8+
controls: {
9+
matchers: {
10+
color: /(background|color)$/i,
11+
date: /Date$/i,
12+
},
13+
},
14+
},
15+
};
16+
17+
export default preview;

0 commit comments

Comments
 (0)