@storybook/react 10.0.0-beta.2 → 10.0.0-beta.3

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 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
+ /** @ts-expect-error We cannot implement the meta faithfully here, but that is okay. */
504
505
  interface ReactPreview<T extends AddonTypes> extends Preview$1<ReactTypes & T> {
505
506
  meta<TArgs extends Args, Decorators extends DecoratorFunction<ReactTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
506
507
  render?: ArgsStoryFn<ReactTypes & T, TArgs>;
@@ -514,13 +515,17 @@ interface ReactPreview<T extends AddonTypes> extends Preview$1<ReactTypes & T> {
514
515
  }>;
515
516
  }
516
517
  type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<Decorators extends DecoratorFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
517
- interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations<T>> extends Meta$1<T, MetaInput> {
518
+ interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations<T>>
519
+ /** @ts-expect-error hard */
520
+ extends Meta$1<T, MetaInput> {
518
521
  story<TInput extends (() => ReactTypes['storyResult']) | (StoryAnnotations<T, T['args']> & {
519
522
  render: () => ReactTypes['storyResult'];
520
523
  })>(story?: TInput): ReactStory<T, TInput extends () => ReactTypes['storyResult'] ? {
521
524
  render: TInput;
522
525
  } : TInput>;
523
- 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>;
526
+ story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story?: TInput
527
+ /** @ts-expect-error hard */
528
+ ): ReactStory<T, TInput>;
524
529
  }
525
530
  interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
526
531
  Component: ComponentType<Partial<T['args']>>;
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_oiqitl42idd from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_oiqitl42idd from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_oiqitl42idd from "node:module";
1
+ import CJS_COMPAT_NODE_URL_5mncgb1j5uv from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_5mncgb1j5uv from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_5mncgb1j5uv from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_oiqitl42idd.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_oiqitl42idd.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_oiqitl42idd.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_5mncgb1j5uv.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_5mncgb1j5uv.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_5mncgb1j5uv.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -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
+ /** @ts-expect-error We cannot implement the meta faithfully here, but that is okay. */
395
396
  interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
396
397
  meta<TArgs extends Args, Decorators extends DecoratorFunction<ReactTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
397
398
  render?: ArgsStoryFn<ReactTypes & T, TArgs>;
@@ -405,13 +406,17 @@ interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
405
406
  }>;
406
407
  }
407
408
  type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<Decorators extends DecoratorFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
408
- interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations<T>> extends Meta<T, MetaInput> {
409
+ interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations<T>>
410
+ /** @ts-expect-error hard */
411
+ extends Meta<T, MetaInput> {
409
412
  story<TInput extends (() => ReactTypes['storyResult']) | (StoryAnnotations<T, T['args']> & {
410
413
  render: () => ReactTypes['storyResult'];
411
414
  })>(story?: TInput): ReactStory<T, TInput extends () => ReactTypes['storyResult'] ? {
412
415
  render: TInput;
413
416
  } : TInput>;
414
- 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>;
417
+ story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story?: TInput
418
+ /** @ts-expect-error hard */
419
+ ): ReactStory<T, TInput>;
415
420
  }
416
421
  interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
417
422
  Component: ComponentType<Partial<T['args']>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react",
3
- "version": "10.0.0-beta.2",
3
+ "version": "10.0.0-beta.3",
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.0.0-beta.2"
57
+ "@storybook/react-dom-shim": "10.0.0-beta.3"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/babel-plugin-react-docgen": "^4.2.3",
@@ -80,7 +80,7 @@
80
80
  "peerDependencies": {
81
81
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
82
82
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
83
- "storybook": "^10.0.0-beta.2",
83
+ "storybook": "^10.0.0-beta.3",
84
84
  "typescript": ">= 4.9.x"
85
85
  },
86
86
  "peerDependenciesMeta": {
@@ -16,7 +16,7 @@ export default {
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
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#story-args
20
20
  args: { onClick: fn() },
21
21
  };
22
22
 
@@ -18,7 +18,7 @@ const meta = {
18
18
  argTypes: {
19
19
  backgroundColor: { control: 'color' },
20
20
  },
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#action-args
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
23
  } satisfies Meta<typeof Button>;
24
24