@storybook/nextjs 8.0.0-alpha.7 → 8.0.0-alpha.8
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/images/decorator.d.ts +1 -1
- package/dist/{index.d-0a6e03f5.d.ts → index.d-9ff5bc46.d.ts} +0 -31
- package/dist/preset.d.ts +1 -1
- package/dist/preview.d.ts +1 -1
- package/dist/rsc/preview.d.ts +1 -1
- package/package.json +9 -9
- package/template/cli/js/Button.stories.js +3 -0
- package/template/cli/ts-3-8/Button.stories.ts +3 -1
- package/template/cli/ts-3-8/Header.tsx +3 -3
- package/template/cli/ts-4-9/Button.stories.ts +3 -1
- package/template/cli/ts-4-9/Header.tsx +3 -3
|
@@ -2765,20 +2765,6 @@ type StoriesEntry = string | StoriesSpecifier;
|
|
|
2765
2765
|
interface IndexerOptions {
|
|
2766
2766
|
makeTitle: (userTitle?: string) => string;
|
|
2767
2767
|
}
|
|
2768
|
-
interface IndexedStory {
|
|
2769
|
-
id: string;
|
|
2770
|
-
name: string;
|
|
2771
|
-
tags?: Tag[];
|
|
2772
|
-
parameters?: Parameters;
|
|
2773
|
-
}
|
|
2774
|
-
interface IndexedCSFFile {
|
|
2775
|
-
meta: {
|
|
2776
|
-
id?: string;
|
|
2777
|
-
title?: string;
|
|
2778
|
-
tags?: Tag[];
|
|
2779
|
-
};
|
|
2780
|
-
stories: IndexedStory[];
|
|
2781
|
-
}
|
|
2782
2768
|
/**
|
|
2783
2769
|
* FIXME: This is a temporary type to allow us to deprecate the old indexer API.
|
|
2784
2770
|
* We should remove this type and the deprecated indexer API in 8.0.
|
|
@@ -2800,19 +2786,7 @@ type Indexer = BaseIndexer & {
|
|
|
2800
2786
|
* @returns A promise that resolves to an array of {@link IndexInput} objects.
|
|
2801
2787
|
*/
|
|
2802
2788
|
createIndex: (fileName: string, options: IndexerOptions) => Promise<IndexInput[]>;
|
|
2803
|
-
/**
|
|
2804
|
-
* @deprecated Use {@link index} instead
|
|
2805
|
-
*/
|
|
2806
|
-
indexer?: never;
|
|
2807
|
-
};
|
|
2808
|
-
type DeprecatedIndexer = BaseIndexer & {
|
|
2809
|
-
indexer: (fileName: string, options: IndexerOptions) => Promise<IndexedCSFFile>;
|
|
2810
|
-
createIndex?: never;
|
|
2811
2789
|
};
|
|
2812
|
-
/**
|
|
2813
|
-
* @deprecated Use {@link Indexer} instead
|
|
2814
|
-
*/
|
|
2815
|
-
type StoryIndexer = Indexer | DeprecatedIndexer;
|
|
2816
2790
|
/**
|
|
2817
2791
|
* The base input for indexing a story or docs entry.
|
|
2818
2792
|
*/
|
|
@@ -2948,10 +2922,6 @@ interface CLIOptions {
|
|
|
2948
2922
|
host?: string;
|
|
2949
2923
|
initialPath?: string;
|
|
2950
2924
|
exactPort?: boolean;
|
|
2951
|
-
/**
|
|
2952
|
-
* @deprecated Use 'staticDirs' Storybook Configuration option instead
|
|
2953
|
-
*/
|
|
2954
|
-
staticDir?: string[];
|
|
2955
2925
|
configDir?: string;
|
|
2956
2926
|
https?: boolean;
|
|
2957
2927
|
sslCa?: string[];
|
|
@@ -3143,7 +3113,6 @@ interface StorybookConfigRaw {
|
|
|
3143
3113
|
babelDefault?: TransformOptions;
|
|
3144
3114
|
config?: Entry[];
|
|
3145
3115
|
previewAnnotations?: Entry[];
|
|
3146
|
-
storyIndexers?: StoryIndexer[];
|
|
3147
3116
|
experimental_indexers?: Indexer[];
|
|
3148
3117
|
docs?: DocsOptions;
|
|
3149
3118
|
previewHead?: string;
|
package/dist/preset.d.ts
CHANGED
package/dist/preview.d.ts
CHANGED
package/dist/rsc/preview.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/nextjs",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.8",
|
|
4
4
|
"description": "Storybook for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -89,14 +89,14 @@
|
|
|
89
89
|
"@babel/preset-react": "^7.22.15",
|
|
90
90
|
"@babel/preset-typescript": "^7.23.2",
|
|
91
91
|
"@babel/runtime": "^7.23.2",
|
|
92
|
-
"@storybook/addon-actions": "8.0.0-alpha.
|
|
93
|
-
"@storybook/builder-webpack5": "8.0.0-alpha.
|
|
94
|
-
"@storybook/core-common": "8.0.0-alpha.
|
|
95
|
-
"@storybook/core-events": "8.0.0-alpha.
|
|
96
|
-
"@storybook/node-logger": "8.0.0-alpha.
|
|
97
|
-
"@storybook/preset-react-webpack": "8.0.0-alpha.
|
|
98
|
-
"@storybook/preview-api": "8.0.0-alpha.
|
|
99
|
-
"@storybook/react": "8.0.0-alpha.
|
|
92
|
+
"@storybook/addon-actions": "8.0.0-alpha.8",
|
|
93
|
+
"@storybook/builder-webpack5": "8.0.0-alpha.8",
|
|
94
|
+
"@storybook/core-common": "8.0.0-alpha.8",
|
|
95
|
+
"@storybook/core-events": "8.0.0-alpha.8",
|
|
96
|
+
"@storybook/node-logger": "8.0.0-alpha.8",
|
|
97
|
+
"@storybook/preset-react-webpack": "8.0.0-alpha.8",
|
|
98
|
+
"@storybook/preview-api": "8.0.0-alpha.8",
|
|
99
|
+
"@storybook/react": "8.0.0-alpha.8",
|
|
100
100
|
"@types/node": "^18.0.0",
|
|
101
101
|
"@types/semver": "^7.3.4",
|
|
102
102
|
"css-loader": "^6.7.3",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fn } from '@storybook/test';
|
|
1
2
|
import { Button } from './Button';
|
|
2
3
|
|
|
3
4
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
@@ -14,6 +15,8 @@ export default {
|
|
|
14
15
|
argTypes: {
|
|
15
16
|
backgroundColor: { control: 'color' },
|
|
16
17
|
},
|
|
18
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
19
|
+
args: { onClick: fn() },
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
3
3
|
import { Button } from './Button';
|
|
4
4
|
|
|
5
5
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
@@ -16,6 +16,8 @@ const meta: Meta<typeof Button> = {
|
|
|
16
16
|
argTypes: {
|
|
17
17
|
backgroundColor: { control: 'color' },
|
|
18
18
|
},
|
|
19
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
20
|
+
args: { onClick: fn() },
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export default meta;
|
|
@@ -9,9 +9,9 @@ type User = {
|
|
|
9
9
|
|
|
10
10
|
interface HeaderProps {
|
|
11
11
|
user?: User;
|
|
12
|
-
onLogin
|
|
13
|
-
onLogout
|
|
14
|
-
onCreateAccount
|
|
12
|
+
onLogin?: () => void;
|
|
13
|
+
onLogout?: () => void;
|
|
14
|
+
onCreateAccount?: () => void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
3
3
|
import { Button } from './Button';
|
|
4
4
|
|
|
5
5
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
@@ -16,6 +16,8 @@ const meta = {
|
|
|
16
16
|
argTypes: {
|
|
17
17
|
backgroundColor: { control: 'color' },
|
|
18
18
|
},
|
|
19
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
20
|
+
args: { onClick: fn() },
|
|
19
21
|
} satisfies Meta<typeof Button>;
|
|
20
22
|
|
|
21
23
|
export default meta;
|
|
@@ -9,9 +9,9 @@ type User = {
|
|
|
9
9
|
|
|
10
10
|
interface HeaderProps {
|
|
11
11
|
user?: User;
|
|
12
|
-
onLogin
|
|
13
|
-
onLogout
|
|
14
|
-
onCreateAccount
|
|
12
|
+
onLogin?: () => void;
|
|
13
|
+
onLogout?: () => void;
|
|
14
|
+
onCreateAccount?: () => void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
|