Skip to content

Commit

Permalink
chore: upgrade storybook to v7
Browse files Browse the repository at this point in the history
  • Loading branch information
Min Htet Oo authored and Min Htet Oo committed Jan 31, 2024
1 parent 4453711 commit 3e10b55
Show file tree
Hide file tree
Showing 10 changed files with 14,300 additions and 17,460 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dist-ssr
*.sln
*.sw?

storybook-static
storybook-static
docs
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# .npmrc
engine-strict=true
engine-strict=true
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const toPath = (_path) => path.join(process.cwd(), _path);
module.exports = {
stories: ["../src/**/*.stories.@(tsx)"],
addons: ["@storybook/addon-essentials"],
framework: {
name: "@storybook/react-webpack5",
options: {},
},
webpackFinal: (config) => {
return {
...config,
Expand Down
19 changes: 19 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { StorybookConfig } from "@storybook/react-webpack5";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-webpack5",
options: {},
},
docs: {
autodocs: true,
},
};
export default config;
5 changes: 3 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import { addDecorator } from "@storybook/react";
import "../src/main.css";

addDecorator((storyFn) => <>{storyFn()}</>);
export default {
decorators: [(storyFn) => <>{storyFn()}</>],
};
15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from "@storybook/react";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
Loading

0 comments on commit 3e10b55

Please sign in to comment.