Skip to content

Commit 7db3cfa

Browse files
authored
Merge pull request #4 from NandhakumarE/develop
Corrected Depth Calculation and Added Storybook documentation
2 parents 8ade3fa + ffed7cd commit 7db3cfa

20 files changed

Lines changed: 3936 additions & 197 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ dist-ssr
2929
*.njsproj
3030
*.sln
3131
*.sw?
32+
33+
*storybook.log
34+
storybook-static

.storybook/main.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
import tailwindcss from '@tailwindcss/vite';
3+
4+
const config: StorybookConfig = {
5+
"stories": [
6+
"../src/**/*.mdx",
7+
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
8+
],
9+
"addons": [
10+
"@chromatic-com/storybook",
11+
"@storybook/addon-vitest",
12+
"@storybook/addon-a11y",
13+
"@storybook/addon-docs",
14+
"@storybook/addon-onboarding"
15+
],
16+
"framework": "@storybook/react-vite",
17+
viteFinal: (config) => {
18+
config.plugins = [...(config.plugins || []), tailwindcss()];
19+
return config;
20+
},
21+
};
22+
export default config;

.storybook/preview.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { Preview } from '@storybook/react-vite'
2+
import '../src/stories/stories.css';
3+
const preview: Preview = {
4+
parameters: {
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/i,
9+
},
10+
},
11+
12+
a11y: {
13+
// 'todo' - show a11y violations in the test UI only
14+
// 'error' - fail CI on a11y violations
15+
// 'off' - skip a11y checks entirely
16+
test: 'todo'
17+
}
18+
},
19+
};
20+
21+
export default preview;

.storybook/vitest.setup.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
2+
import { setProjectAnnotations } from '@storybook/react-vite';
3+
import * as projectAnnotations from './preview';
4+
5+
// This is an important step to apply the right configuration when testing your stories.
6+
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
7+
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
import storybook from "eslint-plugin-storybook";
3+
14
import js from '@eslint/js'
25
import globals from 'globals'
36
import reactHooks from 'eslint-plugin-react-hooks'

0 commit comments

Comments
 (0)