Skip to content

Commit

Permalink
feat: setup storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
d-koppenhagen committed Jan 13, 2024
1 parent 09ed590 commit 672a803
Show file tree
Hide file tree
Showing 15 changed files with 18,007 additions and 4,472 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
"@angular-eslint/component-selector": [
"error",
{
"type": ["attribute", "element"],
"type": [
"attribute",
"element"
],
"prefix": "app",
"style": "kebab-case"
}
Expand All @@ -43,5 +46,8 @@
],
"rules": {}
}
],
"extends": [
"plugin:storybook/recommended"
]
}
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/angular";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-a11y",
],
framework: {
name: "@storybook/angular",
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
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/angular";

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

export default preview;
11 changes: 11 additions & 0 deletions .storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../tsconfig.app.json",
"compilerOptions": {
"types": ["node"],
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"exclude": ["../src/test.ts", "../src/**/*.spec.ts"],
"include": ["../src/**/*", "./preview.ts"],
"files": ["./typings.d.ts"]
}
4 changes: 4 additions & 0 deletions .storybook/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.md' {
const content: string;
export default content;
}
32 changes: 31 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,36 @@
"src/**/*.html"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"configDir": ".storybook",
"browserTarget": "a11y-demo:build",
"compodoc": true,
"compodocArgs": [
"-e",
"json",
"-d",
"."
],
"port": 6006
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"configDir": ".storybook",
"browserTarget": "a11y-demo:build",
"compodoc": true,
"compodocArgs": [
"-e",
"json",
"-d",
"."
],
"outputDir": "storybook-static"
}
}
}
}
Expand All @@ -113,4 +143,4 @@
"@angular-eslint/schematics"
]
}
}
}
2,264 changes: 2,264 additions & 0 deletions documentation.json

Large diffs are not rendered by default.

Loading

0 comments on commit 672a803

Please sign in to comment.