Skip to content

Commit faa0e52

Browse files
docs: update storybook guide for v10 (#272)
1 parent 462f88b commit faa0e52

32 files changed

Lines changed: 3576 additions & 7074 deletions
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
// had to add @rollup/rollup-linux-x64-gnu as an optional dep
22
// https://github.com/vitejs/vite/discussions/15532
3-
/** @type { import('@storybook/web-components-vite').StorybookConfig } */
4-
const config = {
3+
import type { StorybookConfig } from "@storybook/web-components-vite";
4+
5+
const config: StorybookConfig = {
56
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
67
addons: [
7-
"@storybook/addon-links",
8-
"@storybook/addon-essentials",
98
"@chromatic-com/storybook",
9+
"@storybook/addon-a11y",
10+
"@storybook/addon-docs",
11+
"@storybook/addon-links",
1012
"storybook-addon-fetch-mock",
1113
],
12-
framework: {
13-
name: "@storybook/web-components-vite",
14-
options: {},
15-
},
16-
docs: {
17-
autodocs: "tag",
18-
},
14+
framework: "@storybook/web-components-vite",
1915
staticDirs: ["../src"],
2016
};
2117

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import "../src/styles/theme.css";
2+
import "./reset.css";
3+
import type { Preview } from "@storybook/web-components-vite";
24

3-
/** @type { import('@storybook/web-components').Preview } */
4-
const preview = {
5+
const preview: Preview = {
56
parameters: {
67
controls: {
78
matchers: {
89
color: /(background|color)$/i,
910
date: /Date$/i,
1011
},
1112
},
13+
a11y: {
14+
test: "error",
15+
},
1216
},
1317
};
1418

.storybook/reset.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
strong {
2+
font-size: 14px;
3+
}

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ Below is an example of a basic Storybook file:
267267
```js
268268
import "./header.js";
269269
270-
export default {
270+
const meta = {
271271
title: "Components/Header",
272272
};
273273
274-
const Template = () => "<app-header></app-header>";
274+
export default meta;
275275
276-
export const Primary = Template.bind({});
276+
export const Primary = () => "<app-header></app-header>";
277277
```
278278
279279
#### Content as Data

0 commit comments

Comments
 (0)