@storybook/react-webpack5 11.0.0-beta.0 → 11.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/index.js +6 -6
- package/dist/preset.js +6 -6
- package/package.json +19 -5
- package/template/cli/js/Button.stories.js +11 -10
- package/template/cli/js/Header.stories.js +6 -5
- package/template/cli/js/Page.stories.js +6 -5
- package/template/cli/ts/Button.stories.ts +11 -14
- package/template/cli/ts/Header.stories.ts +6 -9
- package/template/cli/ts/Page.stories.ts +6 -9
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mkxplhf1aik from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mkxplhf1aik from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mkxplhf1aik from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mkxplhf1aik.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mkxplhf1aik.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mkxplhf1aik.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_mkxplhf1aik from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_mkxplhf1aik from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_mkxplhf1aik from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_mkxplhf1aik.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_mkxplhf1aik.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_mkxplhf1aik.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-webpack5",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.2",
|
|
4
4
|
"description": "Storybook for React and Webpack: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -48,19 +48,33 @@
|
|
|
48
48
|
"!src/**/*"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@storybook/builder-webpack5": "11.0.0-beta.
|
|
52
|
-
"@storybook/preset-react-webpack": "11.0.0-beta.
|
|
53
|
-
"@storybook/react": "11.0.0-beta.
|
|
51
|
+
"@storybook/builder-webpack5": "11.0.0-beta.2",
|
|
52
|
+
"@storybook/preset-react-webpack": "11.0.0-beta.2",
|
|
53
|
+
"@storybook/react": "11.0.0-beta.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^22.19.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
+
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0",
|
|
59
60
|
"react": "^18.0.0 || ^19.0.0",
|
|
61
|
+
"react-docgen": "^8.0.2",
|
|
62
|
+
"react-docgen-typescript": "^2.2.2",
|
|
60
63
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
61
|
-
"storybook": "^11.0.0-beta.
|
|
64
|
+
"storybook": "^11.0.0-beta.2",
|
|
62
65
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
|
|
63
66
|
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@storybook/react-docgen-typescript-plugin": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"react-docgen": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"react-docgen-typescript": {
|
|
75
|
+
"optional": true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
64
78
|
"publishConfig": {
|
|
65
79
|
"access": "public"
|
|
66
80
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { fn } from 'storybook/test';
|
|
2
3
|
|
|
3
4
|
import { Button } from './Button';
|
|
4
5
|
|
|
5
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
-
|
|
7
|
+
const meta = preview.meta({
|
|
7
8
|
title: 'Example/Button',
|
|
8
9
|
component: Button,
|
|
9
10
|
parameters: {
|
|
@@ -18,32 +19,32 @@ export default {
|
|
|
18
19
|
},
|
|
19
20
|
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
|
|
20
21
|
args: { onClick: fn() },
|
|
21
|
-
};
|
|
22
|
+
});
|
|
22
23
|
|
|
23
24
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
24
|
-
export const Primary = {
|
|
25
|
+
export const Primary = meta.story({
|
|
25
26
|
args: {
|
|
26
27
|
primary: true,
|
|
27
28
|
label: 'Button',
|
|
28
29
|
},
|
|
29
|
-
};
|
|
30
|
+
});
|
|
30
31
|
|
|
31
|
-
export const Secondary = {
|
|
32
|
+
export const Secondary = meta.story({
|
|
32
33
|
args: {
|
|
33
34
|
label: 'Button',
|
|
34
35
|
},
|
|
35
|
-
};
|
|
36
|
+
});
|
|
36
37
|
|
|
37
|
-
export const Large = {
|
|
38
|
+
export const Large = meta.story({
|
|
38
39
|
args: {
|
|
39
40
|
size: 'large',
|
|
40
41
|
label: 'Button',
|
|
41
42
|
},
|
|
42
|
-
};
|
|
43
|
+
});
|
|
43
44
|
|
|
44
|
-
export const Small = {
|
|
45
|
+
export const Small = meta.story({
|
|
45
46
|
args: {
|
|
46
47
|
size: 'small',
|
|
47
48
|
label: 'Button',
|
|
48
49
|
},
|
|
49
|
-
};
|
|
50
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { fn } from 'storybook/test';
|
|
2
3
|
|
|
3
4
|
import { Header } from './Header';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const meta = preview.meta({
|
|
6
7
|
title: 'Example/Header',
|
|
7
8
|
component: Header,
|
|
8
9
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
@@ -16,14 +17,14 @@ export default {
|
|
|
16
17
|
onLogout: fn(),
|
|
17
18
|
onCreateAccount: fn(),
|
|
18
19
|
},
|
|
19
|
-
};
|
|
20
|
+
});
|
|
20
21
|
|
|
21
|
-
export const LoggedIn = {
|
|
22
|
+
export const LoggedIn = meta.story({
|
|
22
23
|
args: {
|
|
23
24
|
user: {
|
|
24
25
|
name: 'Jane Doe',
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
|
-
};
|
|
28
|
+
});
|
|
28
29
|
|
|
29
|
-
export const LoggedOut =
|
|
30
|
+
export const LoggedOut = meta.story();
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { expect, userEvent, within } from 'storybook/test';
|
|
2
3
|
|
|
3
4
|
import { Page } from './Page';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const meta = preview.meta({
|
|
6
7
|
title: 'Example/Page',
|
|
7
8
|
component: Page,
|
|
8
9
|
parameters: {
|
|
9
10
|
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
10
11
|
layout: 'fullscreen',
|
|
11
12
|
},
|
|
12
|
-
};
|
|
13
|
+
});
|
|
13
14
|
|
|
14
|
-
export const LoggedOut =
|
|
15
|
+
export const LoggedOut = meta.story();
|
|
15
16
|
|
|
16
17
|
// More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
|
|
17
|
-
export const LoggedIn = {
|
|
18
|
+
export const LoggedIn = meta.story({
|
|
18
19
|
play: async ({ canvasElement }) => {
|
|
19
20
|
const canvas = within(canvasElement);
|
|
20
21
|
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
@@ -25,4 +26,4 @@ export const LoggedIn = {
|
|
|
25
26
|
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
26
27
|
await expect(logoutButton).toBeInTheDocument();
|
|
27
28
|
},
|
|
28
|
-
};
|
|
29
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { fn } from 'storybook/test';
|
|
4
4
|
|
|
5
5
|
import { Button } from './Button';
|
|
6
6
|
|
|
7
7
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
8
|
-
const meta = {
|
|
8
|
+
const meta = preview.meta({
|
|
9
9
|
title: 'Example/Button',
|
|
10
10
|
component: Button,
|
|
11
11
|
parameters: {
|
|
@@ -20,35 +20,32 @@ const meta = {
|
|
|
20
20
|
},
|
|
21
21
|
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
|
|
22
22
|
args: { onClick: fn() },
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
type Story = StoryObj<typeof meta>;
|
|
23
|
+
});
|
|
27
24
|
|
|
28
25
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
29
|
-
export const Primary
|
|
26
|
+
export const Primary = meta.story({
|
|
30
27
|
args: {
|
|
31
28
|
primary: true,
|
|
32
29
|
label: 'Button',
|
|
33
30
|
},
|
|
34
|
-
};
|
|
31
|
+
});
|
|
35
32
|
|
|
36
|
-
export const Secondary
|
|
33
|
+
export const Secondary = meta.story({
|
|
37
34
|
args: {
|
|
38
35
|
label: 'Button',
|
|
39
36
|
},
|
|
40
|
-
};
|
|
37
|
+
});
|
|
41
38
|
|
|
42
|
-
export const Large
|
|
39
|
+
export const Large = meta.story({
|
|
43
40
|
args: {
|
|
44
41
|
size: 'large',
|
|
45
42
|
label: 'Button',
|
|
46
43
|
},
|
|
47
|
-
};
|
|
44
|
+
});
|
|
48
45
|
|
|
49
|
-
export const Small
|
|
46
|
+
export const Small = meta.story({
|
|
50
47
|
args: {
|
|
51
48
|
size: 'small',
|
|
52
49
|
label: 'Button',
|
|
53
50
|
},
|
|
54
|
-
};
|
|
51
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { fn } from 'storybook/test';
|
|
4
4
|
|
|
5
5
|
import { Header } from './Header';
|
|
6
6
|
|
|
7
|
-
const meta = {
|
|
7
|
+
const meta = preview.meta({
|
|
8
8
|
title: 'Example/Header',
|
|
9
9
|
component: Header,
|
|
10
10
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
@@ -18,17 +18,14 @@ const meta = {
|
|
|
18
18
|
onLogout: fn(),
|
|
19
19
|
onCreateAccount: fn(),
|
|
20
20
|
},
|
|
21
|
-
}
|
|
21
|
+
});
|
|
22
22
|
|
|
23
|
-
export
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const LoggedIn: Story = {
|
|
23
|
+
export const LoggedIn = meta.story({
|
|
27
24
|
args: {
|
|
28
25
|
user: {
|
|
29
26
|
name: 'Jane Doe',
|
|
30
27
|
},
|
|
31
28
|
},
|
|
32
|
-
};
|
|
29
|
+
});
|
|
33
30
|
|
|
34
|
-
export const LoggedOut
|
|
31
|
+
export const LoggedOut = meta.story();
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { expect, userEvent, within } from 'storybook/test';
|
|
4
4
|
|
|
5
5
|
import { Page } from './Page';
|
|
6
6
|
|
|
7
|
-
const meta = {
|
|
7
|
+
const meta = preview.meta({
|
|
8
8
|
title: 'Example/Page',
|
|
9
9
|
component: Page,
|
|
10
10
|
parameters: {
|
|
11
11
|
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
12
12
|
layout: 'fullscreen',
|
|
13
13
|
},
|
|
14
|
-
}
|
|
14
|
+
});
|
|
15
15
|
|
|
16
|
-
export
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const LoggedOut: Story = {};
|
|
16
|
+
export const LoggedOut = meta.story();
|
|
20
17
|
|
|
21
18
|
// More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
|
|
22
|
-
export const LoggedIn
|
|
19
|
+
export const LoggedIn = meta.story({
|
|
23
20
|
play: async ({ canvasElement }) => {
|
|
24
21
|
const canvas = within(canvasElement);
|
|
25
22
|
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
@@ -30,4 +27,4 @@ export const LoggedIn: Story = {
|
|
|
30
27
|
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
31
28
|
await expect(logoutButton).toBeInTheDocument();
|
|
32
29
|
},
|
|
33
|
-
};
|
|
30
|
+
});
|