Skip to content

Commit b24f9f5

Browse files
authored
✨ Add storybook (#6)
* πŸ”§ Add storybook packages + fix config * πŸ™ˆ Update gitignore * πŸ”₯ Remove app * πŸ”§ Create github pages workflow * 🎨 Export ContextMenuProps * ✨ Add StoryWrapper component * ✨ Add stories for ContextMenu * πŸ”§ Adjust start script * πŸ”§ Fix prettier script
1 parent 09158b2 commit b24f9f5

File tree

20 files changed

+7628
-10873
lines changed

20 files changed

+7628
-10873
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build and deploy Storybook
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
- uses: bitovi/[email protected]
24+
with:
25+
path: storybook-static
26+
checkout: false

β€Ž.gitignoreβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ coverage
1616
*.ntvs*
1717
*.njsproj
1818
*.sln
19-
*.sw?
19+
*.sw?
20+
21+
*storybook.log
22+
storybook-static

β€Ž.storybook/main.tsβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
6+
framework: {
7+
name: '@storybook/react-vite',
8+
options: {},
9+
},
10+
};
11+
12+
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+
3+
import '../src/styles.css';
4+
5+
const preview: Preview = {
6+
parameters: {
7+
controls: {
8+
matchers: {
9+
color: /(background|color)$/i,
10+
date: /Date$/i,
11+
},
12+
},
13+
},
14+
};
15+
16+
export default preview;

β€Žapp/components/App.tsxβ€Ž

Lines changed: 0 additions & 28 deletions
This file was deleted.

β€Žapp/components/index.tsβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

β€Žapp/index.htmlβ€Ž

Lines changed: 0 additions & 13 deletions
This file was deleted.

β€Žapp/main.tsxβ€Ž

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
Β (0)