Skip to content

Commit e146ac1

Browse files
committed
Added storybook
1 parent 0cb6a8c commit e146ac1

File tree

6 files changed

+58
-3
lines changed

6 files changed

+58
-3
lines changed

.eslintrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@
6767
"allow": "as-needed",
6868
"extensions": [".tsx"]
6969
}],
70+
"import/no-extraneous-dependencies": [
71+
"error",
72+
{
73+
"devDependencies": [
74+
"**/*.stories.*",
75+
"**/.storybook/**/*.*"
76+
],
77+
"peerDependencies": true
78+
}
79+
],
7080
"react/jsx-uses-react": "off",
7181
"react/react-in-jsx-scope": "off",
7282
"react/require-default-props": "off",

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
tags:
6-
- v*
6+
- '*'
77
# Review gh actions docs if you want to further define triggers, paths, etc
88
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
99

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ node_modules
99
npm-debug.log
1010
npm-debug.log.*
1111

12+
# storybook
13+
/storybook-static
14+
1215
# *Storm
1316
.idea
1417
.idea/*

.storybook/main.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { StorybookConfig } from '@storybook/react-webpack5';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/addon-links',
7+
'@storybook/addon-essentials',
8+
'@storybook/preset-create-react-app',
9+
'@storybook/addon-onboarding',
10+
'@storybook/addon-interactions',
11+
'@storybook/addon-viewport'
12+
],
13+
framework: {
14+
name: '@storybook/react-webpack5',
15+
options: {
16+
builder: {
17+
useSWC: true,
18+
},
19+
},
20+
},
21+
docs: {
22+
autodocs: 'tag',
23+
},
24+
staticDirs: ['../public'],
25+
};
26+
export default config;

.storybook/preview.ts

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

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)