Storybook created
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
/** @type { import('@storybook/nextjs-vite').StorybookConfig } */
|
||||
const config = {
|
||||
"stories": [
|
||||
"../stories/**/*.mdx",
|
||||
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)"
|
||||
],
|
||||
"addons": [
|
||||
"@chromatic-com/storybook",
|
||||
"@storybook/addon-docs",
|
||||
"@storybook/addon-onboarding",
|
||||
"@storybook/addon-a11y",
|
||||
"@storybook/addon-vitest"
|
||||
],
|
||||
"framework": {
|
||||
"name": "@storybook/nextjs-vite",
|
||||
"options": {}
|
||||
},
|
||||
"staticDirs": [
|
||||
"../public"
|
||||
]
|
||||
};
|
||||
export default config;
|
||||
@@ -0,0 +1,23 @@
|
||||
import "../app/globals.css";
|
||||
import "../app/tailwind.css";
|
||||
|
||||
/** @type { import('@storybook/nextjs-vite').Preview } */
|
||||
const preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
|
||||
a11y: {
|
||||
// 'todo' - show a11y violations in the test UI only
|
||||
// 'error' - fail CI on a11y violations
|
||||
// 'off' - skip a11y checks entirely
|
||||
test: "todo",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default preview;
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
|
||||
import { setProjectAnnotations } from '@storybook/nextjs-vite';
|
||||
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
|
||||
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
|
||||
Reference in New Issue
Block a user