Add storybook

This commit is contained in:
Robert Long
2021-12-23 12:45:00 -08:00
parent 658424efa0
commit 87e5cafb77
5 changed files with 9386 additions and 61 deletions

14
.storybook/main.js Normal file
View File

@@ -0,0 +1,14 @@
const svgrPlugin = require("vite-plugin-svgr");
module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
framework: "@storybook/react",
core: {
builder: "storybook-builder-vite",
},
async viteFinal(config) {
config.plugins.push(svgrPlugin());
return config;
},
};

11
.storybook/preview.js Normal file
View File

@@ -0,0 +1,11 @@
import "../src/index.css";
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};