@storybook/react 9.1.0-alpha.1 → 9.1.0-alpha.10
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/{chunk-CKO6TW2F.mjs → chunk-6BNVLEVL.mjs} +5 -5
- package/dist/{chunk-AWLHXXSE.mjs → chunk-6PSAWJ36.mjs} +1 -1
- package/dist/{chunk-N3U7HZRZ.mjs → chunk-JQQVJC7C.mjs} +1 -1
- package/dist/chunk-MNKU3DTE.mjs +9 -0
- package/dist/chunk-OZUYIFQK.mjs +8 -0
- package/dist/entry-preview-argtypes.d.ts +2 -2
- package/dist/entry-preview-argtypes.js +5 -5
- package/dist/entry-preview-argtypes.mjs +2 -2
- package/dist/entry-preview-docs.d.ts +2 -1
- package/dist/entry-preview-docs.js +5 -5
- package/dist/entry-preview-docs.mjs +2 -2
- package/dist/entry-preview.d.ts +3 -3
- package/dist/entry-preview.js +1 -1
- package/dist/entry-preview.mjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +9 -9
- package/dist/index.mjs +7 -7
- package/dist/preview.d.ts +22 -20
- package/dist/preview.js +9 -9
- package/dist/preview.mjs +5 -5
- package/dist/{public-types-ebfb1e77.d.ts → public-types-d899d203.d.ts} +7 -2
- package/dist/{types-5617c98e.d.ts → types-7abe74eb.d.ts} +6 -5
- package/package.json +4 -4
- package/dist/chunk-CQ7IB4U6.mjs +0 -9
- package/dist/chunk-JL2J6OGA.mjs +0 -8
- package/dist/observable-like.d-b7430e69.d.ts +0 -5
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { __definePreview } from './chunk-
|
|
2
|
-
import { entry_preview_exports, renderToCanvas } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { __definePreview } from './chunk-OZUYIFQK.mjs';
|
|
2
|
+
import { entry_preview_exports, renderToCanvas } from './chunk-MNKU3DTE.mjs';
|
|
3
|
+
import { entry_preview_argtypes_exports } from './chunk-JQQVJC7C.mjs';
|
|
4
|
+
import './chunk-6PSAWJ36.mjs';
|
|
5
5
|
import './chunk-XLZBPYSH.mjs';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-6BNVLEVL.mjs';
|
|
7
7
|
import './chunk-XP5HYGXS.mjs';
|
|
8
8
|
import { global } from '@storybook/global';
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
import { setDefaultProjectAnnotations, setProjectAnnotations as setProjectAnnotations$1, composeStory as composeStory$1, composeStories as composeStories$1 } from 'storybook/preview-api';
|
|
10
|
+
import { composeConfigs, setDefaultProjectAnnotations, setProjectAnnotations as setProjectAnnotations$1, composeStory as composeStory$1, composeStories as composeStories$1 } from 'storybook/preview-api';
|
|
11
11
|
|
|
12
|
-
var{window:globalWindow}=global;globalWindow&&(globalWindow.STORYBOOK_ENV="react");function setProjectAnnotations(projectAnnotations){return setDefaultProjectAnnotations(INTERNAL_DEFAULT_PROJECT_ANNOTATIONS),setProjectAnnotations$1(projectAnnotations)}var INTERNAL_DEFAULT_PROJECT_ANNOTATIONS=
|
|
12
|
+
var{window:globalWindow}=global;globalWindow&&(globalWindow.STORYBOOK_ENV="react");function setProjectAnnotations(projectAnnotations){return setDefaultProjectAnnotations(INTERNAL_DEFAULT_PROJECT_ANNOTATIONS),setProjectAnnotations$1(projectAnnotations)}var INTERNAL_DEFAULT_PROJECT_ANNOTATIONS=composeConfigs([entry_preview_exports,entry_preview_argtypes_exports,{renderToCanvas:async(renderContext,canvasElement)=>{if(renderContext.storyContext.testingLibraryRender==null)return renderToCanvas(renderContext,canvasElement);let{storyContext:{context,unboundStoryFn:Story,testingLibraryRender:render}}=renderContext,{unmount}=render(React.createElement(Story,{...context}),{container:context.canvasElement});return unmount}}]);function composeStory(story,componentAnnotations,projectAnnotations,exportsName){return composeStory$1(story,componentAnnotations,projectAnnotations,globalThis.globalProjectAnnotations??INTERNAL_DEFAULT_PROJECT_ANNOTATIONS,exportsName)}function composeStories(csfExports,projectAnnotations){return composeStories$1(csfExports,projectAnnotations,composeStory)}
|
|
13
13
|
|
|
14
14
|
export { INTERNAL_DEFAULT_PROJECT_ANNOTATIONS, composeStories, composeStory, setProjectAnnotations };
|
package/dist/preview.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { Preview, Meta, Story } from 'storybook/internal/csf';
|
|
3
|
-
import { Args, DecoratorFunction, ArgsStoryFn, ComponentAnnotations, Renderer, StoryAnnotations } from 'storybook/internal/types';
|
|
4
|
-
import './
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
2
|
+
import { PreviewAddon, InferTypes, AddonTypes, Preview, Meta, Story } from 'storybook/internal/csf';
|
|
3
|
+
import { ProjectAnnotations, Args, DecoratorFunction, ArgsStoryFn, ComponentAnnotations, Renderer, StoryAnnotations } from 'storybook/internal/types';
|
|
4
|
+
import { c as Simplify, A as AddMocks, d as SetOptional } from './public-types-d899d203.js';
|
|
5
|
+
import { a as ReactTypes } from './types-7abe74eb.js';
|
|
6
|
+
import 'react-dom/client';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
Remove any index signatures from the given object type, so that only explicitly defined properties remain.
|
|
@@ -171,30 +171,32 @@ type UnionToIntersection<Union> = (
|
|
|
171
171
|
? Intersection
|
|
172
172
|
: never;
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
declare function __definePreview<Addons extends PreviewAddon<never>[]>(input: {
|
|
175
|
+
addons: Addons;
|
|
176
|
+
} & ProjectAnnotations<ReactTypes & InferTypes<Addons>>): ReactPreview<ReactTypes & InferTypes<Addons>>;
|
|
177
|
+
interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
|
|
178
|
+
meta<TArgs extends Args, Decorators extends DecoratorFunction<ReactTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
|
|
179
|
+
render?: ArgsStoryFn<ReactTypes & T, TArgs>;
|
|
179
180
|
component?: ComponentType<TArgs>;
|
|
180
181
|
decorators?: Decorators | Decorators[];
|
|
181
182
|
args?: TMetaArgs;
|
|
182
|
-
} & Omit<ComponentAnnotations<
|
|
183
|
-
args: Simplify<TArgs & Simplify<RemoveIndexSignature<DecoratorsArgs<
|
|
183
|
+
} & Omit<ComponentAnnotations<ReactTypes & T, TArgs>, 'decorators' | 'component' | 'args' | 'render'>): ReactMeta<ReactTypes & T & {
|
|
184
|
+
args: Simplify<TArgs & Simplify<RemoveIndexSignature<DecoratorsArgs<ReactTypes & T, Decorators>>>>;
|
|
184
185
|
}, {
|
|
185
186
|
args: Partial<TArgs> extends TMetaArgs ? {} : TMetaArgs;
|
|
186
187
|
}>;
|
|
187
188
|
}
|
|
188
189
|
type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<Decorators extends DecoratorFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
|
|
189
|
-
interface ReactMeta<
|
|
190
|
-
args
|
|
191
|
-
|
|
192
|
-
story<TInput extends
|
|
193
|
-
render:
|
|
194
|
-
}
|
|
195
|
-
story<TInput extends Simplify<StoryAnnotations<
|
|
190
|
+
interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations<T>> extends Meta<T, MetaInput> {
|
|
191
|
+
story<TInput extends (() => ReactTypes['storyResult']) | (StoryAnnotations<T, T['args']> & {
|
|
192
|
+
render: () => ReactTypes['storyResult'];
|
|
193
|
+
})>(story?: TInput): ReactStory<T, TInput extends () => ReactTypes['storyResult'] ? {
|
|
194
|
+
render: TInput;
|
|
195
|
+
} : TInput>;
|
|
196
|
+
story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story?: TInput): ReactStory<T, TInput>;
|
|
196
197
|
}
|
|
197
|
-
interface ReactStory extends Story<
|
|
198
|
+
interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
|
|
199
|
+
Component: ComponentType<Partial<T['args']>>;
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
export { ReactPreview, ReactStory, __definePreview };
|