@storybook/react 10.1.9 → 10.1.11
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/index.d.ts +8 -4
- package/dist/preset.js +6 -6
- package/dist/preview.d.ts +8 -4
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -501,6 +501,7 @@ declare function composeStories<TModule extends Store_CSFExports<ReactRenderer,
|
|
|
501
501
|
declare function __definePreview<Addons extends PreviewAddon<never>[]>(input: {
|
|
502
502
|
addons: Addons;
|
|
503
503
|
} & ProjectAnnotations<ReactTypes & InferTypes<Addons>>): ReactPreview<ReactTypes & InferTypes<Addons>>;
|
|
504
|
+
type InferArgs<TArgs extends Args, T extends AddonTypes, Decorators extends DecoratorFunction<ReactTypes & T, any>> = Simplify<TArgs & Simplify<RemoveIndexSignature<DecoratorsArgs<ReactTypes & T, Decorators>>>>;
|
|
504
505
|
/** @ts-expect-error We cannot implement the meta faithfully here, but that is okay. */
|
|
505
506
|
interface ReactPreview<T extends AddonTypes> extends Preview$1<ReactTypes & T> {
|
|
506
507
|
meta<TArgs extends Args, Decorators extends DecoratorFunction<ReactTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
|
|
@@ -509,8 +510,10 @@ interface ReactPreview<T extends AddonTypes> extends Preview$1<ReactTypes & T> {
|
|
|
509
510
|
decorators?: Decorators | Decorators[];
|
|
510
511
|
args?: TMetaArgs;
|
|
511
512
|
} & Omit<ComponentAnnotations<ReactTypes & T, TArgs>, 'decorators' | 'component' | 'args' | 'render'>): ReactMeta<ReactTypes & T & {
|
|
512
|
-
args:
|
|
513
|
-
}, {
|
|
513
|
+
args: InferArgs<TArgs, T, Decorators>;
|
|
514
|
+
}, Omit<ComponentAnnotations<ReactTypes & T & {
|
|
515
|
+
args: InferArgs<TArgs, T, Decorators>;
|
|
516
|
+
}>, 'args'> & {
|
|
514
517
|
args: Partial<TArgs> extends TMetaArgs ? {} : TMetaArgs;
|
|
515
518
|
}>;
|
|
516
519
|
}
|
|
@@ -520,12 +523,13 @@ interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations
|
|
|
520
523
|
extends Meta$1<T, MetaInput> {
|
|
521
524
|
story<TInput extends (() => ReactTypes['storyResult']) | (StoryAnnotations<T, T['args']> & {
|
|
522
525
|
render: () => ReactTypes['storyResult'];
|
|
523
|
-
})>(story
|
|
526
|
+
})>(story: TInput): ReactStory<T, TInput extends () => ReactTypes['storyResult'] ? {
|
|
524
527
|
render: TInput;
|
|
525
528
|
} : TInput>;
|
|
526
|
-
story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story
|
|
529
|
+
story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story: TInput
|
|
527
530
|
/** @ts-expect-error hard */
|
|
528
531
|
): ReactStory<T, TInput>;
|
|
532
|
+
story(..._args: Partial<T['args']> extends SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']> ? [] : [never]): ReactStory<T, {}>;
|
|
529
533
|
}
|
|
530
534
|
interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
|
|
531
535
|
Component: ComponentType<Partial<T['args']>>;
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_w3x2216o9 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_w3x2216o9 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_w3x2216o9 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_w3x2216o9.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_w3x2216o9.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_w3x2216o9.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preview.d.ts
CHANGED
|
@@ -392,6 +392,7 @@ type AddMocks<TArgs, DefaultArgs> = Simplify<{
|
|
|
392
392
|
declare function __definePreview<Addons extends PreviewAddon<never>[]>(input: {
|
|
393
393
|
addons: Addons;
|
|
394
394
|
} & ProjectAnnotations<ReactTypes & InferTypes<Addons>>): ReactPreview<ReactTypes & InferTypes<Addons>>;
|
|
395
|
+
type InferArgs<TArgs extends Args, T extends AddonTypes, Decorators extends DecoratorFunction<ReactTypes & T, any>> = Simplify<TArgs & Simplify<RemoveIndexSignature<DecoratorsArgs<ReactTypes & T, Decorators>>>>;
|
|
395
396
|
/** @ts-expect-error We cannot implement the meta faithfully here, but that is okay. */
|
|
396
397
|
interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
|
|
397
398
|
meta<TArgs extends Args, Decorators extends DecoratorFunction<ReactTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
|
|
@@ -400,8 +401,10 @@ interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
|
|
|
400
401
|
decorators?: Decorators | Decorators[];
|
|
401
402
|
args?: TMetaArgs;
|
|
402
403
|
} & Omit<ComponentAnnotations<ReactTypes & T, TArgs>, 'decorators' | 'component' | 'args' | 'render'>): ReactMeta<ReactTypes & T & {
|
|
403
|
-
args:
|
|
404
|
-
}, {
|
|
404
|
+
args: InferArgs<TArgs, T, Decorators>;
|
|
405
|
+
}, Omit<ComponentAnnotations<ReactTypes & T & {
|
|
406
|
+
args: InferArgs<TArgs, T, Decorators>;
|
|
407
|
+
}>, 'args'> & {
|
|
405
408
|
args: Partial<TArgs> extends TMetaArgs ? {} : TMetaArgs;
|
|
406
409
|
}>;
|
|
407
410
|
}
|
|
@@ -411,12 +414,13 @@ interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations
|
|
|
411
414
|
extends Meta<T, MetaInput> {
|
|
412
415
|
story<TInput extends (() => ReactTypes['storyResult']) | (StoryAnnotations<T, T['args']> & {
|
|
413
416
|
render: () => ReactTypes['storyResult'];
|
|
414
|
-
})>(story
|
|
417
|
+
})>(story: TInput): ReactStory<T, TInput extends () => ReactTypes['storyResult'] ? {
|
|
415
418
|
render: TInput;
|
|
416
419
|
} : TInput>;
|
|
417
|
-
story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story
|
|
420
|
+
story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story: TInput
|
|
418
421
|
/** @ts-expect-error hard */
|
|
419
422
|
): ReactStory<T, TInput>;
|
|
423
|
+
story(..._args: Partial<T['args']> extends SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']> ? [] : [never]): ReactStory<T, {}>;
|
|
420
424
|
}
|
|
421
425
|
interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
|
|
422
426
|
Component: ComponentType<Partial<T['args']>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.11",
|
|
4
4
|
"description": "Storybook React renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@storybook/global": "^5.0.0",
|
|
57
|
-
"@storybook/react-dom-shim": "10.1.
|
|
57
|
+
"@storybook/react-dom-shim": "10.1.11",
|
|
58
58
|
"react-docgen": "^8.0.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
83
83
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
84
|
-
"storybook": "^10.1.
|
|
84
|
+
"storybook": "^10.1.11",
|
|
85
85
|
"typescript": ">= 4.9.x"
|
|
86
86
|
},
|
|
87
87
|
"peerDependenciesMeta": {
|