Skip to content

Commit b23f25d

Browse files
committed
docs: update to storybook 10 and add a11y tests
1 parent 25c728d commit b23f25d

76 files changed

Lines changed: 8566 additions & 9428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
extends: ['@etchteam', 'plugin:storybook/recommended'],
2+
extends: ['@etchteam'],
33
rules: {
44
'@next/next/no-html-link-for-pages': 0,
55
'@next/next/no-img-element': 0,

.storybook/DocPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Stories,
88
useOf,
99
Description,
10-
} from '@storybook/blocks';
10+
} from '@storybook/addon-docs/blocks';
1111
import { PreparedStory, Renderer } from 'storybook/internal/types';
1212
import Related from './blocks/Related';
1313
import Meta from './blocks/Meta';

.storybook/blocks/Meta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useOf } from '@storybook/blocks';
1+
import { useOf } from '@storybook/addon-docs/blocks';
22
import React from 'react';
33

44
/**

.storybook/blocks/Related.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useOf } from '@storybook/blocks';
1+
import { useOf } from '@storybook/addon-docs/blocks';
22
import React, { useEffect, useState } from 'react';
33

44
import '../../src/components/composition/Grid/Grid';

.storybook/main.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1+
// This file has been automatically migrated to valid ESM format by Storybook.
2+
import { fileURLToPath } from "node:url";
13
import type { StorybookConfig } from '@storybook/react-vite';
2-
import path from 'node:path';
4+
import path, { dirname } from 'node:path';
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = dirname(__filename);
38

49
const config: StorybookConfig = {
510
stories: [
611
'../src/**/*.mdx',
712
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'
813
],
14+
915
addons: [
1016
'@storybook/addon-a11y',
1117
'@storybook/addon-docs',
1218
'@chromatic-com/storybook',
13-
{
14-
name: '@storybook/addon-essentials',
15-
options: {
16-
toolbars: true,
17-
backgrounds: false,
18-
actions: false,
19-
outline: false,
20-
measure: false,
21-
viewport: true,
22-
},
23-
},
24-
'@storybook/addon-interactions',
2519
{
2620
name: '@storybook/preset-scss',
2721
options: {
@@ -33,20 +27,32 @@ const config: StorybookConfig = {
3327

3428
}
3529
}
36-
},
30+
}
3731
],
32+
3833
framework: {
3934
name: '@storybook/react-vite',
4035
options: {}
4136
},
37+
4238
staticDirs: [path.resolve(__dirname, '../src/assets')],
39+
4340
typescript: {
4441
reactDocgen: 'react-docgen-typescript',
4542
reactDocgenTypescriptOptions: {
4643
shouldExtractLiteralValuesFromEnum: true,
4744
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
4845
},
4946
},
47+
48+
features: {
49+
toolbars: true,
50+
backgrounds: false,
51+
actions: false,
52+
outline: false,
53+
measure: false,
54+
viewport: true
55+
}
5056
};
5157

5258
export default config;

.storybook/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { addons } from '@storybook/manager-api';
2-
import { create } from '@storybook/theming/create';
1+
import { addons } from 'storybook/manager-api';
2+
import { create } from 'storybook/theming/create';
33

44

55
addons.setConfig({

.storybook/preview.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Preview } from '@storybook/react'
1+
import type { Preview } from '@storybook/react-vite'
22
import { DocPage } from './DocPage';
33
import tokens from '@wrap.ngo/tokens/dist/index.css?raw'
44

@@ -52,7 +52,7 @@ const preview: Preview = {
5252
page: ({ of }: { of: any }) => DocPage({ of }),
5353
},
5454
backgrounds: {
55-
disable: true,
55+
disabled: true,
5656
},
5757
designTokenTables: {
5858
tokens: [
@@ -72,7 +72,7 @@ const preview: Preview = {
7272
},
7373
},
7474
viewport: {
75-
viewports: {
75+
options: {
7676
aaMinimum: {
7777
name: 'AA minimum small mobile',
7878
styles: {

0 commit comments

Comments
 (0)