@storybook/react 8.6.0-beta.0 → 8.6.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/entry-preview.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { D as Decorator } from './public-types-
|
|
1
|
+
import { D as Decorator } from './public-types-f2c70f25.js';
|
|
2
2
|
import { ArgsStoryFn, RenderContext, BaseAnnotations } from 'storybook/internal/types';
|
|
3
3
|
import { R as ReactRenderer } from './types-5617c98e.js';
|
|
4
|
-
import './set-optional.d-c7228b0c.js';
|
|
5
4
|
import 'react';
|
|
6
5
|
|
|
7
6
|
declare const render: ArgsStoryFn<ReactRenderer>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { M as Meta } from './public-types-
|
|
2
|
-
export { A as AddMocks, D as Decorator, L as Loader, P as Preview, b as StoryContext, S as StoryFn, a as StoryObj } from './public-types-
|
|
1
|
+
import { M as Meta } from './public-types-f2c70f25.js';
|
|
2
|
+
export { A as AddMocks, D as Decorator, L as Loader, P as Preview, b as StoryContext, S as StoryFn, a as StoryObj } from './public-types-f2c70f25.js';
|
|
3
3
|
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, ProjectAnnotations, Args, StoryAnnotationsOrFn, ComposedStoryFn, Store_CSFExports, StoriesWithPartialProps } from 'storybook/internal/types';
|
|
4
4
|
export { ArgTypes, Args, Parameters, StrictArgs } from 'storybook/internal/types';
|
|
5
5
|
import { R as ReactRenderer } from './types-5617c98e.js';
|
|
6
6
|
export { a as ReactParameters } from './types-5617c98e.js';
|
|
7
7
|
export { ReactPreview, definePreview } from './preview.js';
|
|
8
8
|
import 'react';
|
|
9
|
-
import './set-optional.d-c7228b0c.js';
|
|
10
9
|
import 'storybook/internal/csf';
|
|
11
|
-
import 'src/public-types';
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* Function that sets the globalConfig of your storybook. The global config is the preview module of
|
package/dist/preview.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import { Preview, Meta, Story } from 'storybook/internal/csf';
|
|
3
3
|
import { Args, DecoratorFunction, ArgsStoryFn, ComponentAnnotations, Renderer, StoryAnnotations } from 'storybook/internal/types';
|
|
4
|
-
import { AddMocks } from '
|
|
5
|
-
import { S as Simplify, a as SetOptional } from './set-optional.d-c7228b0c.js';
|
|
4
|
+
import { c as Simplify, A as AddMocks, d as SetOptional } from './public-types-f2c70f25.js';
|
|
6
5
|
import { R as ReactRenderer } from './types-5617c98e.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ComponentType, ComponentProps } from 'react';
|
|
2
|
+
import { Args, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, ArgsFromMeta, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations } from 'storybook/internal/types';
|
|
3
|
+
import { R as ReactRenderer } from './types-5617c98e.js';
|
|
4
|
+
|
|
1
5
|
declare global {
|
|
2
6
|
interface SymbolConstructor {
|
|
3
7
|
readonly observable: symbol;
|
|
@@ -189,4 +193,38 @@ type SetOptional<BaseType, Keys extends keyof BaseType> =
|
|
|
189
193
|
Partial<Pick<BaseType, Keys>>
|
|
190
194
|
>;
|
|
191
195
|
|
|
192
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Metadata to configure the stories for a component.
|
|
198
|
+
*
|
|
199
|
+
* @see [Default export](https://storybook.js.org/docs/api/csf#default-export)
|
|
200
|
+
*/
|
|
201
|
+
type Meta<TCmpOrArgs = Args> = [TCmpOrArgs] extends [ComponentType<any>] ? ComponentAnnotations<ReactRenderer, ComponentProps<TCmpOrArgs>> : ComponentAnnotations<ReactRenderer, TCmpOrArgs>;
|
|
202
|
+
/**
|
|
203
|
+
* Story function that represents a CSFv2 component example.
|
|
204
|
+
*
|
|
205
|
+
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
206
|
+
*/
|
|
207
|
+
type StoryFn<TCmpOrArgs = Args> = [TCmpOrArgs] extends [ComponentType<any>] ? AnnotatedStoryFn<ReactRenderer, ComponentProps<TCmpOrArgs>> : AnnotatedStoryFn<ReactRenderer, TCmpOrArgs>;
|
|
208
|
+
/**
|
|
209
|
+
* Story object that represents a CSFv3 component example.
|
|
210
|
+
*
|
|
211
|
+
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
212
|
+
*/
|
|
213
|
+
type StoryObj<TMetaOrCmpOrArgs = Args> = [TMetaOrCmpOrArgs] extends [
|
|
214
|
+
{
|
|
215
|
+
render?: ArgsStoryFn<ReactRenderer, any>;
|
|
216
|
+
component?: infer Component;
|
|
217
|
+
args?: infer DefaultArgs;
|
|
218
|
+
}
|
|
219
|
+
] ? Simplify<(Component extends ComponentType<any> ? ComponentProps<Component> : unknown) & ArgsFromMeta<ReactRenderer, TMetaOrCmpOrArgs>> extends infer TArgs ? StoryAnnotations<ReactRenderer, AddMocks<TArgs, DefaultArgs>, SetOptional<TArgs, keyof TArgs & keyof DefaultArgs>> : never : TMetaOrCmpOrArgs extends ComponentType<any> ? StoryAnnotations<ReactRenderer, ComponentProps<TMetaOrCmpOrArgs>> : StoryAnnotations<ReactRenderer, TMetaOrCmpOrArgs>;
|
|
220
|
+
type AddMocks<TArgs, DefaultArgs> = Simplify<{
|
|
221
|
+
[T in keyof TArgs]: T extends keyof DefaultArgs ? DefaultArgs[T] extends (...args: any) => any & {
|
|
222
|
+
mock: {};
|
|
223
|
+
} ? DefaultArgs[T] : TArgs[T] : TArgs[T];
|
|
224
|
+
}>;
|
|
225
|
+
type Decorator<TArgs = StrictArgs> = DecoratorFunction<ReactRenderer, TArgs>;
|
|
226
|
+
type Loader<TArgs = StrictArgs> = LoaderFunction<ReactRenderer, TArgs>;
|
|
227
|
+
type StoryContext<TArgs = StrictArgs> = StoryContext$1<ReactRenderer, TArgs>;
|
|
228
|
+
type Preview = ProjectAnnotations<ReactRenderer>;
|
|
229
|
+
|
|
230
|
+
export { AddMocks as A, Decorator as D, Loader as L, Meta as M, Preview as P, StoryFn as S, StoryObj as a, StoryContext as b, Simplify as c, SetOptional as d };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react",
|
|
3
|
-
"version": "8.6.0-beta.
|
|
3
|
+
"version": "8.6.0-beta.2",
|
|
4
4
|
"description": "Storybook React renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -70,15 +70,15 @@
|
|
|
70
70
|
"prep": "jiti ../../../scripts/prepare/bundle.ts"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@storybook/components": "8.6.0-beta.
|
|
73
|
+
"@storybook/components": "8.6.0-beta.2",
|
|
74
74
|
"@storybook/global": "^5.0.0",
|
|
75
|
-
"@storybook/manager-api": "8.6.0-beta.
|
|
76
|
-
"@storybook/preview-api": "8.6.0-beta.
|
|
77
|
-
"@storybook/react-dom-shim": "8.6.0-beta.
|
|
78
|
-
"@storybook/theming": "8.6.0-beta.
|
|
75
|
+
"@storybook/manager-api": "8.6.0-beta.2",
|
|
76
|
+
"@storybook/preview-api": "8.6.0-beta.2",
|
|
77
|
+
"@storybook/react-dom-shim": "8.6.0-beta.2",
|
|
78
|
+
"@storybook/theming": "8.6.0-beta.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@storybook/test": "8.6.0-beta.
|
|
81
|
+
"@storybook/test": "8.6.0-beta.2",
|
|
82
82
|
"@types/babel-plugin-react-docgen": "^4",
|
|
83
83
|
"@types/escodegen": "^0.0.6",
|
|
84
84
|
"@types/estree": "^0.0.51",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"type-fest": "~2.19"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
|
-
"@storybook/test": "8.6.0-beta.
|
|
103
|
+
"@storybook/test": "8.6.0-beta.2",
|
|
104
104
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
|
|
105
105
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
|
|
106
|
-
"storybook": "^8.6.0-beta.
|
|
106
|
+
"storybook": "^8.6.0-beta.2",
|
|
107
107
|
"typescript": ">= 4.2.x"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ComponentType, ComponentProps } from 'react';
|
|
2
|
-
import { Args, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, ArgsFromMeta, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations } from 'storybook/internal/types';
|
|
3
|
-
import { S as Simplify, a as SetOptional } from './set-optional.d-c7228b0c.js';
|
|
4
|
-
import { R as ReactRenderer } from './types-5617c98e.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Metadata to configure the stories for a component.
|
|
8
|
-
*
|
|
9
|
-
* @see [Default export](https://storybook.js.org/docs/api/csf#default-export)
|
|
10
|
-
*/
|
|
11
|
-
type Meta<TCmpOrArgs = Args> = [TCmpOrArgs] extends [ComponentType<any>] ? ComponentAnnotations<ReactRenderer, ComponentProps<TCmpOrArgs>> : ComponentAnnotations<ReactRenderer, TCmpOrArgs>;
|
|
12
|
-
/**
|
|
13
|
-
* Story function that represents a CSFv2 component example.
|
|
14
|
-
*
|
|
15
|
-
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
16
|
-
*/
|
|
17
|
-
type StoryFn<TCmpOrArgs = Args> = [TCmpOrArgs] extends [ComponentType<any>] ? AnnotatedStoryFn<ReactRenderer, ComponentProps<TCmpOrArgs>> : AnnotatedStoryFn<ReactRenderer, TCmpOrArgs>;
|
|
18
|
-
/**
|
|
19
|
-
* Story object that represents a CSFv3 component example.
|
|
20
|
-
*
|
|
21
|
-
* @see [Named Story exports](https://storybook.js.org/docs/api/csf#named-story-exports)
|
|
22
|
-
*/
|
|
23
|
-
type StoryObj<TMetaOrCmpOrArgs = Args> = [TMetaOrCmpOrArgs] extends [
|
|
24
|
-
{
|
|
25
|
-
render?: ArgsStoryFn<ReactRenderer, any>;
|
|
26
|
-
component?: infer Component;
|
|
27
|
-
args?: infer DefaultArgs;
|
|
28
|
-
}
|
|
29
|
-
] ? Simplify<(Component extends ComponentType<any> ? ComponentProps<Component> : unknown) & ArgsFromMeta<ReactRenderer, TMetaOrCmpOrArgs>> extends infer TArgs ? StoryAnnotations<ReactRenderer, AddMocks<TArgs, DefaultArgs>, SetOptional<TArgs, keyof TArgs & keyof DefaultArgs>> : never : TMetaOrCmpOrArgs extends ComponentType<any> ? StoryAnnotations<ReactRenderer, ComponentProps<TMetaOrCmpOrArgs>> : StoryAnnotations<ReactRenderer, TMetaOrCmpOrArgs>;
|
|
30
|
-
type AddMocks<TArgs, DefaultArgs> = Simplify<{
|
|
31
|
-
[T in keyof TArgs]: T extends keyof DefaultArgs ? DefaultArgs[T] extends (...args: any) => any & {
|
|
32
|
-
mock: {};
|
|
33
|
-
} ? DefaultArgs[T] : TArgs[T] : TArgs[T];
|
|
34
|
-
}>;
|
|
35
|
-
type Decorator<TArgs = StrictArgs> = DecoratorFunction<ReactRenderer, TArgs>;
|
|
36
|
-
type Loader<TArgs = StrictArgs> = LoaderFunction<ReactRenderer, TArgs>;
|
|
37
|
-
type StoryContext<TArgs = StrictArgs> = StoryContext$1<ReactRenderer, TArgs>;
|
|
38
|
-
type Preview = ProjectAnnotations<ReactRenderer>;
|
|
39
|
-
|
|
40
|
-
export { AddMocks as A, Decorator as D, Loader as L, Meta as M, Preview as P, StoryFn as S, StoryObj as a, StoryContext as b };
|