add storybook
This commit is contained in:
19
react-advanced-tag1/.storybook/main.ts
Normal file
19
react-advanced-tag1/.storybook/main.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
"stories": [
|
||||
"../src/**/*.mdx",
|
||||
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
|
||||
],
|
||||
"addons": [
|
||||
"@storybook/addon-essentials",
|
||||
"@storybook/addon-onboarding",
|
||||
"@chromatic-com/storybook",
|
||||
"@storybook/experimental-addon-test"
|
||||
],
|
||||
"framework": {
|
||||
"name": "@storybook/react-vite",
|
||||
"options": {}
|
||||
}
|
||||
};
|
||||
export default config;
|
||||
15
react-advanced-tag1/.storybook/preview.ts
Normal file
15
react-advanced-tag1/.storybook/preview.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Preview } from '@storybook/react'
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
},
|
||||
tags: ['autodocs'],
|
||||
}
|
||||
|
||||
export default preview
|
||||
9
react-advanced-tag1/.storybook/vitest.setup.ts
Normal file
9
react-advanced-tag1/.storybook/vitest.setup.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { beforeAll } from 'vitest';
|
||||
import { setProjectAnnotations } from '@storybook/react';
|
||||
import * as projectAnnotations from './preview';
|
||||
|
||||
// This is an important step to apply the right configuration when testing your stories.
|
||||
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
|
||||
const project = setProjectAnnotations([projectAnnotations]);
|
||||
|
||||
beforeAll(project.beforeAll);
|
||||
Reference in New Issue
Block a user